]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add a debug counter for late-combine
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 25 Jun 2024 11:58:12 +0000 (12:58 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 25 Jun 2024 11:58:12 +0000 (12:58 +0100)
This should help to diagnose problems like PR115631.

gcc/
* dbgcnt.def (late_combine): New debug counter.
* late-combine.cc (insn_combination::run): Use it.

gcc/dbgcnt.def
gcc/late-combine.cc

index ed9f062eac2c28c52df76b39d4312dd9fde1c800..e0b9b1b2a76229157dcd8a12444b977ca030b802 100644 (file)
@@ -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)
index 22a1d81d38ee2d302a7564ef07e6670bc5e6f9a7..fc75d1c56d76d6abe264daed9cb4614f131937d4 100644 (file)
@@ -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 ();