summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2017-02-19 04:29:01 +0000
committerDaniel Berlin <dberlin@dberlin.org>2017-02-19 04:29:01 +0000
commita4b5c01dd2f8a4420f8ab63742ed55eb2539edb6 (patch)
treeb04072ad9a394462244d462e80e4ffba13511207 /llvm/lib/Transforms
parent25f1db11118b8b073cfecd37876fee43228cb9ca (diff)
downloadbcm5719-llvm-a4b5c01dd2f8a4420f8ab63742ed55eb2539edb6.tar.gz
bcm5719-llvm-a4b5c01dd2f8a4420f8ab63742ed55eb2539edb6.zip
Add a DebugCounter for PredicateInfo renaming, and an associated test
llvm-svn: 295594
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/PredicateInfo.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/PredicateInfo.cpp b/llvm/lib/Transforms/Utils/PredicateInfo.cpp
index b97a1bc766c..ac6843ff04d 100644
--- a/llvm/lib/Transforms/Utils/PredicateInfo.cpp
+++ b/llvm/lib/Transforms/Utils/PredicateInfo.cpp
@@ -31,6 +31,7 @@
#include "llvm/IR/Module.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/DebugCounter.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Transforms/Scalar.h"
#include <algorithm>
@@ -48,6 +49,9 @@ INITIALIZE_PASS_END(PredicateInfoPrinterLegacyPass, "print-predicateinfo",
static cl::opt<bool> VerifyPredicateInfo(
"verify-predicateinfo", cl::init(false), cl::Hidden,
cl::desc("Verify PredicateInfo in legacy printer pass."));
+DEBUG_COUNTER(RenameCounter, "predicateinfo-rename",
+ "Controls which variables are renamed with predicateinfo");
+
namespace llvm {
namespace PredicateInfoClasses {
enum LocalNum {
@@ -578,6 +582,10 @@ void PredicateInfo::renameUses(SmallPtrSetImpl<Value *> &OpsToRename) {
// Skip values, only want to rename the uses
if (VD.Def || PossibleCopy)
continue;
+ if (!DebugCounter::shouldExecute(RenameCounter)) {
+ DEBUG(dbgs() << "Skipping execution due to debug counter\n");
+ continue;
+ }
ValueDFS &Result = RenameStack.back();
// If the possible copy dominates something, materialize our stack up to
OpenPOWER on IntegriCloud