Add SCEV cprop dumping.
authorMarek Polacek <polacek@redhat.com>
Thu, 16 May 2013 09:23:47 +0000 (09:23 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 16 May 2013 09:23:47 +0000 (09:23 +0000)
From-SVN: r198963

gcc/ChangeLog
gcc/tree-scalar-evolution.c

index 9690c684c9a20151939366d429becd3877010c58..a54dceca35c3cd49dc9589a380aca408d450464e 100644 (file)
@@ -1,3 +1,7 @@
+2013-05-16  Marek Polacek  <polacek@redhat.com>
+
+       * tree-scalar-evolution.c (scev_const_prop): Add more dumps.
+
 2013-05-15  Leif Ekblad  <leif@rdos.net>
 
        * config/i386/i386.c (ix86_decompose_address): Use
index de2d7d853a5416711320fd37d5a6a39b03ea8755..c7e9d4b46cdfdda5eb6b7b0f557ce076d2281db5 100644 (file)
@@ -3385,12 +3385,24 @@ scev_const_prop (void)
                 to be turned into n %= 45.  */
              || expression_expensive_p (def))
            {
+             if (dump_file && (dump_flags & TDF_DETAILS))
+               {
+                 fprintf (dump_file, "not replacing:\n  ");
+                 print_gimple_stmt (dump_file, phi, 0, 0);
+                 fprintf (dump_file, "\n");
+               }
              gsi_next (&psi);
              continue;
            }
 
          /* Eliminate the PHI node and replace it by a computation outside
             the loop.  */
+         if (dump_file)
+           {
+             fprintf (dump_file, "\nfinal value replacement:\n  ");
+             print_gimple_stmt (dump_file, phi, 0, 0);
+             fprintf (dump_file, "  with\n  ");
+           }
          def = unshare_expr (def);
          remove_phi_node (&psi, false);
 
@@ -3398,6 +3410,11 @@ scev_const_prop (void)
                                          true, GSI_SAME_STMT);
          ass = gimple_build_assign (rslt, def);
          gsi_insert_before (&bsi, ass, GSI_SAME_STMT);
+         if (dump_file)
+           {
+             print_gimple_stmt (dump_file, ass, 0, 0);
+             fprintf (dump_file, "\n");
+           }
        }
     }
   return 0;