summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2017-02-20 23:37:11 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2017-02-20 23:37:11 +0000
commit85cd132068b8010f63feb9354fbd7ab4e2c2aff8 (patch)
tree32356859a3eb0e0fa186764c221802ab6e11633a /llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
parenta9de0109b3bc438bd1bb9f88b05b4229d4b253ff (diff)
downloadbcm5719-llvm-85cd132068b8010f63feb9354fbd7ab4e2c2aff8.tar.gz
bcm5719-llvm-85cd132068b8010f63feb9354fbd7ab4e2c2aff8.zip
[IndVars] Add an assert
We've already checked that the loop is in simplify form before, but a little paranoia never hurt anyone. llvm-svn: 295680
Diffstat (limited to 'llvm/lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 0aa5f2d9a46..1991acbf4bc 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -2152,6 +2152,8 @@ linearFunctionTestReplace(Loop *L,
Value *CmpIndVar = IndVar;
const SCEV *IVCount = BackedgeTakenCount;
+ assert(L->getLoopLatch() && "Loop no longer in simplified form?");
+
// If the exiting block is the same as the backedge block, we prefer to
// compare against the post-incremented value, otherwise we must compare
// against the preincremented value.
@@ -2376,6 +2378,7 @@ bool IndVarSimplify::run(Loop *L) {
// Loop::getCanonicalInductionVariable only supports loops with preheaders,
// and we're in trouble if we can't find the induction variable even when
// we've manually inserted one.
+ // - LFTR relies on having a single backedge.
if (!L->isLoopSimplifyForm())
return false;
OpenPOWER on IntegriCloud