aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-08-06 20:43:28 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-08-06 20:43:28 +0000
commitc18115db9c36fe70d1a9667d284138bd9a3f4998 (patch)
treeff4a5691fd11dd26fb79a04670790eb0318b5fef /llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
parent5da19695c5fb8daa530c960ae2a68a4f0a4b6b9d (diff)
downloadllvm-c18115db9c36fe70d1a9667d284138bd9a3f4998.zip
llvm-c18115db9c36fe70d1a9667d284138bd9a3f4998.tar.gz
llvm-c18115db9c36fe70d1a9667d284138bd9a3f4998.tar.bz2
[IndVars] Improved logging under DEBUG(); NFC.
Before this, we'd print the modified comparision in the "Simplified comparison" case. That looked misleading. llvm-svn: 244264
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyIndVar.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyIndVar.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
index b3055a4..fa0459f 100644
--- a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
@@ -169,18 +169,16 @@ void SimplifyIndvar::eliminateIVComparison(ICmpInst *ICmp, Value *IVOperand) {
ICmpInst::Predicate InvariantPredicate;
const SCEV *InvariantLHS, *InvariantRHS;
- const char *Verb = nullptr;
-
// If the condition is always true or always false, replace it with
// a constant value.
if (SE->isKnownPredicate(Pred, S, X)) {
ICmp->replaceAllUsesWith(ConstantInt::getTrue(ICmp->getContext()));
DeadInsts.emplace_back(ICmp);
- Verb = "Eliminated";
+ DEBUG(dbgs() << "INDVARS: Eliminated comparison: " << *ICmp << '\n');
} else if (SE->isKnownPredicate(ICmpInst::getInversePredicate(Pred), S, X)) {
ICmp->replaceAllUsesWith(ConstantInt::getFalse(ICmp->getContext()));
DeadInsts.emplace_back(ICmp);
- Verb = "Eliminated";
+ DEBUG(dbgs() << "INDVARS: Eliminated comparison: " << *ICmp << '\n');
} else if (isa<PHINode>(IVOperand) &&
SE->isLoopInvariantPredicate(Pred, S, X, ICmpLoop,
InvariantPredicate, InvariantLHS,
@@ -218,14 +216,13 @@ void SimplifyIndvar::eliminateIVComparison(ICmpInst *ICmp, Value *IVOperand) {
// for now.
return;
- Verb = "Simplified";
+ DEBUG(dbgs() << "INDVARS: Simplified comparison: " << *ICmp << '\n');
ICmp->setPredicate(InvariantPredicate);
ICmp->setOperand(0, NewLHS);
ICmp->setOperand(1, NewRHS);
} else
return;
- DEBUG(dbgs() << "INDVARS: " << Verb << " comparison: " << *ICmp << '\n');
++NumElimCmp;
Changed = true;
}