[llvm] [LLVM][SLSR] Add a debug counter (PR #119981)

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 18 23:00:03 PST 2024


================
@@ -690,7 +694,8 @@ bool StraightLineStrengthReduce::runOnFunction(Function &F) {
   while (!Candidates.empty()) {
     const Candidate &C = Candidates.back();
     if (C.Basis != nullptr) {
-      rewriteCandidateWithBasis(C, *C.Basis);
+      if (DebugCounter::shouldExecute(StraightLineStrengthReduceCounter))
+        rewriteCandidateWithBasis(C, *C.Basis);
----------------
GrumpyPigSkin wrote:

Good point, I have moved it to the top of `rewriteCandidateWithBasis` :)

https://github.com/llvm/llvm-project/pull/119981


More information about the llvm-commits mailing list