]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Forwprop: add a debug dump after propagate into comparison does something
authorAndrew Pinski <quic_apinski@quicinc.com>
Thu, 15 May 2025 03:41:22 +0000 (20:41 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Fri, 16 May 2025 16:26:33 +0000 (09:26 -0700)
I noticed that fowprop does not dump when forward_propagate_into_comparison
did a change to the assign statement.
I am actually using it to help guide changing/improving/add match patterns
instead of depending on doing a tree "combiner" here.

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

* tree-ssa-forwprop.cc (forward_propagate_into_comparison): Dump
when replacing statement.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/tree-ssa-forwprop.cc

index 0f52e8fe6efc6f07b8eb7a1ca7cc61fb4beed104..4c048a9a2986803d35adb6e7308834b1c19aae87 100644 (file)
@@ -523,6 +523,14 @@ forward_propagate_into_comparison (gimple_stmt_iterator *gsi)
                                             type, rhs1, rhs2);
   if (tmp && useless_type_conversion_p (type, TREE_TYPE (tmp)))
     {
+      if (dump_file)
+       {
+         fprintf (dump_file, "  Replaced '");
+         print_gimple_expr (dump_file, stmt, 0);
+         fprintf (dump_file, "' with '");
+         print_generic_expr (dump_file, tmp);
+         fprintf (dump_file, "'\n");
+       }
       gimple_assign_set_rhs_from_tree (gsi, tmp);
       fold_stmt (gsi);
       update_stmt (gsi_stmt (*gsi));