[PATCH] D36553: [InstCombine] Add a DEBUG_COUNTER to InstCombine to limit how many instructions are visited for debug

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 10:49:16 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL310638: [InstCombine] Add a DEBUG_COUNTER to InstCombine to limit how many instructions… (authored by ctopper).

Changed prior to commit:
  https://reviews.llvm.org/D36553?vs=110481&id=110609#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D36553

Files:
  llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp


Index: llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
===================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -60,6 +60,7 @@
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/DebugCounter.h"
 #include "llvm/Support/KnownBits.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Transforms/InstCombine/InstCombine.h"
@@ -79,6 +80,8 @@
 STATISTIC(NumExpand,    "Number of expansions");
 STATISTIC(NumFactor   , "Number of factorizations");
 STATISTIC(NumReassoc  , "Number of reassociations");
+DEBUG_COUNTER(VisitCounter, "instcombine-visit",
+              "Controls which instructions are visited");
 
 static cl::opt<bool>
 EnableExpensiveCombines("expensive-combines",
@@ -2882,6 +2885,9 @@
       continue;
     }
 
+    if (!DebugCounter::shouldExecute(VisitCounter))
+      continue;
+
     // Instruction isn't dead, see if we can constant propagate it.
     if (!I->use_empty() &&
         (I->getNumOperands() == 0 || isa<Constant>(I->getOperand(0)))) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36553.110609.patch
Type: text/x-patch
Size: 1213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170810/b8ac6678/attachment.bin>


More information about the llvm-commits mailing list