public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8193] RISC-V: fix some vsetvl debug info in pass's Phase 2 code [NFC]
@ 2024-01-17 18:59 Vineet Gupta
  0 siblings, 0 replies; only message in thread
From: Vineet Gupta @ 2024-01-17 18:59 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:3340878009acfc69f5315386437841a277174c83

commit r14-8193-g3340878009acfc69f5315386437841a277174c83
Author: Vineet Gupta <vineetg@rivosinc.com>
Date:   Tue Jan 16 13:23:42 2024 -0800

    RISC-V: fix some vsetvl debug info in pass's Phase 2 code [NFC]
    
    When staring at VSETVL pass for PR/113429, spotted some minor
    improvements.
    
    1. For readablity, remove some redundant condition check in Phase 2
       function  earliest_fuse_vsetvl_info ().
    2. Add iteration count in debug prints in same function.
    
    gcc/ChangeLog:
            * config/riscv/riscv-vsetvl.cc (earliest_fuse_vsetvl_info):
            Remove redundant checks in else condition for readablity.
            (earliest_fuse_vsetvl_info) Print iteration count in debug
            prints.
            (earliest_fuse_vsetvl_info) Fix misleading vsetvl info
            dump details in certain cases.
    
    Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>

Diff:
---
 gcc/config/riscv/riscv-vsetvl.cc | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc
index 78a2f7b38fa..41d4b80648f 100644
--- a/gcc/config/riscv/riscv-vsetvl.cc
+++ b/gcc/config/riscv/riscv-vsetvl.cc
@@ -2343,7 +2343,7 @@ public:
   void compute_lcm_local_properties ();
 
   void fuse_local_vsetvl_info ();
-  bool earliest_fuse_vsetvl_info ();
+  bool earliest_fuse_vsetvl_info (int iter);
   void pre_global_vsetvl_info ();
   void emit_vsetvl ();
   void cleaup ();
@@ -2961,7 +2961,7 @@ pre_vsetvl::fuse_local_vsetvl_info ()
 
 
 bool
-pre_vsetvl::earliest_fuse_vsetvl_info ()
+pre_vsetvl::earliest_fuse_vsetvl_info (int iter)
 {
   compute_avl_def_data ();
   compute_vsetvl_def_data ();
@@ -2984,7 +2984,8 @@ pre_vsetvl::earliest_fuse_vsetvl_info ()
 
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
-      fprintf (dump_file, "\n  Compute LCM earliest insert data:\n\n");
+      fprintf (dump_file, "\n  Compute LCM earliest insert data (lift %d):\n\n",
+	       iter);
       fprintf (dump_file, "    Expression List (%u):\n", num_exprs);
       for (unsigned i = 0; i < num_exprs; i++)
 	{
@@ -3032,7 +3033,7 @@ pre_vsetvl::earliest_fuse_vsetvl_info ()
 
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
-      fprintf (dump_file, "    Fused global info result:\n");
+      fprintf (dump_file, "    Fused global info result (lift %d):\n", iter);
     }
 
   bool changed = false;
@@ -3142,8 +3143,7 @@ pre_vsetvl::earliest_fuse_vsetvl_info ()
 		  if (src_block_info.has_info ())
 		    src_block_info.probability += dest_block_info.probability;
 		}
-	      else if (src_block_info.has_info ()
-		       && !m_dem.compatible_p (prev_info, curr_info))
+	      else
 		{
 		  /* Cancel lift up if probabilities are equal.  */
 		  if (successors_probability_equal_p (eg->src))
@@ -3151,11 +3151,11 @@ pre_vsetvl::earliest_fuse_vsetvl_info ()
 		      if (dump_file && (dump_flags & TDF_DETAILS))
 			{
 			  fprintf (dump_file,
-				   "      Change empty bb %u to from:",
+				   "      Reset bb %u:",
 				   eg->src->index);
 			  prev_info.dump (dump_file, "        ");
 			  fprintf (dump_file,
-				   "        to (higher probability):");
+				   "	due to (same probability):");
 			  curr_info.dump (dump_file, "        ");
 			}
 		      src_block_info.set_empty_info ();
@@ -3170,7 +3170,7 @@ pre_vsetvl::earliest_fuse_vsetvl_info ()
 		      if (dump_file && (dump_flags & TDF_DETAILS))
 			{
 			  fprintf (dump_file,
-				   "      Change empty bb %u to from:",
+				   "      Change bb %u from:",
 				   eg->src->index);
 			  prev_info.dump (dump_file, "        ");
 			  fprintf (dump_file,
@@ -3627,7 +3627,7 @@ pass_vsetvl::lazy_vsetvl ()
     {
       if (dump_file)
 	fprintf (dump_file, "  Try lift up %d.\n\n", fused_count);
-      changed = pre.earliest_fuse_vsetvl_info ();
+      changed = pre.earliest_fuse_vsetvl_info (fused_count);
       fused_count += 1;
   } while (changed);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-17 18:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-17 18:59 [gcc r14-8193] RISC-V: fix some vsetvl debug info in pass's Phase 2 code [NFC] Vineet Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).