diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2024-06-25 12:58:12 +0100 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2024-06-25 12:58:12 +0100 |
commit | b6215065a5b14317a342176d5304ecaea3163639 (patch) | |
tree | ecadf6dc2bbc043ace07ad0d5b8997cab7be0ea9 | |
parent | 7107574958e2bed11d916a1480ef1319f15e5ffe (diff) | |
download | gcc-b6215065a5b14317a342176d5304ecaea3163639.zip gcc-b6215065a5b14317a342176d5304ecaea3163639.tar.gz gcc-b6215065a5b14317a342176d5304ecaea3163639.tar.bz2 |
Add a debug counter for late-combine
This should help to diagnose problems like PR115631.
gcc/
* dbgcnt.def (late_combine): New debug counter.
* late-combine.cc (insn_combination::run): Use it.
-rw-r--r-- | gcc/dbgcnt.def | 1 | ||||
-rw-r--r-- | gcc/late-combine.cc | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/dbgcnt.def b/gcc/dbgcnt.def index ed9f062..e0b9b1b 100644 --- a/gcc/dbgcnt.def +++ b/gcc/dbgcnt.def @@ -186,6 +186,7 @@ DEBUG_COUNTER (ipa_sra_params) DEBUG_COUNTER (ipa_sra_retvalues) DEBUG_COUNTER (ira_move) DEBUG_COUNTER (ivopts_loop) +DEBUG_COUNTER (late_combine) DEBUG_COUNTER (lim) DEBUG_COUNTER (local_alloc_for_sched) DEBUG_COUNTER (loop_unswitch) diff --git a/gcc/late-combine.cc b/gcc/late-combine.cc index 22a1d81..fc75d1c 100644 --- a/gcc/late-combine.cc +++ b/gcc/late-combine.cc @@ -41,6 +41,7 @@ #include "tree-pass.h" #include "cfgcleanup.h" #include "target.h" +#include "dbgcnt.h" using namespace rtl_ssa; @@ -428,6 +429,11 @@ insn_combination::run () || !crtl->ssa->verify_insn_changes (m_nondebug_changes)) return false; + // We've now decided that the optimization is valid and profitable. + // Allow it to be suppressed for bisection purposes. + if (!dbg_cnt (::late_combine)) + return false; + substitute_optional_uses (m_def); confirm_change_group (); |