summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-09-06 20:20:38 +0000
committerAndrew Trick <atrick@apple.com>2011-09-06 20:20:38 +0000
commit75ebc0ec2019f391648d3bc3bac6f6da11cfbabd (patch)
treeaf202faad9eaf4f6820be88704bfa7f32c052c1e /lib/Transforms
parent79d56a66c3d763b3a8147581c75c184cd48abcdc (diff)
downloadllvm-75ebc0ec2019f391648d3bc3bac6f6da11cfbabd.tar.gz
llvm-75ebc0ec2019f391648d3bc3bac6f6da11cfbabd.tar.bz2
llvm-75ebc0ec2019f391648d3bc3bac6f6da11cfbabd.tar.xz
Add -verify-indvars for imperfect SCEV trip count verification after indvars.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139169 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index b12a76acf8..636fefaf22 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -76,6 +76,13 @@ namespace llvm {
cl::opt<bool> DisableIVRewrite(
"disable-iv-rewrite", cl::Hidden,
cl::desc("Disable canonical induction variable rewriting"));
+
+ // Trip count verification can be enabled by default under NDEBUG if we
+ // implement a strong expression equivalence checker in SCEV. Until then, we
+ // use the verify-indvars flag, which may assert in some cases.
+ cl::opt<bool> VerifyIndvars(
+ "verify-indvars", cl::Hidden,
+ cl::desc("Verify the ScalarEvolution result after running indvars"));
}
// Temporary flag for use with -disable-iv-rewrite to force a canonical IV for
@@ -1968,7 +1975,8 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
// Verify that LFTR, and any other change have not interfered with SCEV's
// ability to compute trip count.
#ifndef NDEBUG
- if (DisableIVRewrite && !isa<SCEVCouldNotCompute>(BackedgeTakenCount)) {
+ if (DisableIVRewrite && VerifyIndvars &&
+ !isa<SCEVCouldNotCompute>(BackedgeTakenCount)) {
SE->forgetLoop(L);
const SCEV *NewBECount = SE->getBackedgeTakenCount(L);
if (SE->getTypeSizeInBits(BackedgeTakenCount->getType()) <