diff options
author | Andrew Pinski <quic_apinski@quicinc.com> | 2024-09-17 14:26:54 -0700 |
---|---|---|
committer | Andrew Pinski <quic_apinski@quicinc.com> | 2024-09-17 23:20:40 -0700 |
commit | 8590dcd318151336261f8381e1a24caece9e2375 (patch) | |
tree | 7ab9caac9eae5aac1e258d03955c7d887d1d05e4 /gcc/tree-ssa-phiopt.cc | |
parent | a82896ed7bbdb5f64ae741433bba4c1db2f2a562 (diff) | |
download | gcc-8590dcd318151336261f8381e1a24caece9e2375.zip gcc-8590dcd318151336261f8381e1a24caece9e2375.tar.gz gcc-8590dcd318151336261f8381e1a24caece9e2375.tar.bz2 |
phiopt: Add some details dump to cselim
While trying to debug PR 116747, I noticed there was no dump
saying what was done. So this adds the debug dump and it helps
debug what is going on in PR 116747 too.
Bootstrapped and tested on x86_64-linux-gnu.
gcc/ChangeLog:
* tree-ssa-phiopt.cc (cond_if_else_store_replacement_1): Add debug dump.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc/tree-ssa-phiopt.cc')
-rw-r--r-- | gcc/tree-ssa-phiopt.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc index 7b12692..488b450 100644 --- a/gcc/tree-ssa-phiopt.cc +++ b/gcc/tree-ssa-phiopt.cc @@ -3469,6 +3469,17 @@ cond_if_else_store_replacement_1 (basic_block then_bb, basic_block else_bb, then_locus = gimple_location (then_assign); else_locus = gimple_location (else_assign); + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf(dump_file, "factoring out stores:\n\tthen:\n"); + print_gimple_stmt (dump_file, then_assign, 0, + TDF_VOPS|TDF_MEMSYMS); + fprintf(dump_file, "\telse:\n"); + print_gimple_stmt (dump_file, else_assign, 0, + TDF_VOPS|TDF_MEMSYMS); + fprintf (dump_file, "\n"); + } + /* Now we've checked the constraints, so do the transformation: 1) Remove the stores. */ gsi = gsi_for_stmt (then_assign); @@ -3490,6 +3501,16 @@ cond_if_else_store_replacement_1 (basic_block then_bb, basic_block else_bb, add_phi_arg (newphi, else_rhs, EDGE_SUCC (else_bb, 0), else_locus); new_stmt = gimple_build_assign (lhs, gimple_phi_result (newphi)); + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf(dump_file, "to use phi:\n"); + print_gimple_stmt (dump_file, newphi, 0, + TDF_VOPS|TDF_MEMSYMS); + fprintf(dump_file, "\n"); + print_gimple_stmt (dump_file, new_stmt, 0, + TDF_VOPS|TDF_MEMSYMS); + fprintf(dump_file, "\n\n"); + } /* 3) Insert that PHI node. */ gsi = gsi_after_labels (join_bb); |