summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-05-30 01:37:39 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-05-30 01:37:39 +0000
commit3e5ce2b737d11bbadc2cde5901e178eade37caf6 (patch)
tree7c3d0353324cfe49c77b7ec0f49f541860a9a37a /llvm/lib
parent9ef549212c2c952ef5314432b7230270466a62ca (diff)
downloadbcm5719-llvm-3e5ce2b737d11bbadc2cde5901e178eade37caf6.tar.gz
bcm5719-llvm-3e5ce2b737d11bbadc2cde5901e178eade37caf6.zip
[IndVars] Assert that the incoming IR is in LCSSA
Since we already assert that the outgoing IR is in LCSSA, it is easy to get misled into thinking that -indvars broke LCSSA if the incoming IR is non-LCSSA. Checking this pre-condition will make such cases break in more obvious ways. Inspired by (but does _not_ fix) PR26682. llvm-svn: 271196
Diffstat (limited to 'llvm/lib')
-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 07c1256a495..0ae179f9c6f 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -2101,6 +2101,9 @@ void IndVarSimplify::sinkUnusedInvariants(Loop *L) {
//===----------------------------------------------------------------------===//
bool IndVarSimplify::run(Loop *L) {
+ // We need (and expect!) the incoming loop to be in LCSSA.
+ assert(L->isRecursivelyLCSSAForm(*DT) && "LCSSA required to run indvars!");
+
// If LoopSimplify form is not available, stay out of trouble. Some notes:
// - LSR currently only supports LoopSimplify-form loops. Indvars'
// canonicalization can be a pessimization without LSR to "clean up"
OpenPOWER on IntegriCloud