summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-02-21 17:11:59 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-02-21 17:11:59 +0000
commit979a11d5b21f375450dc89970f5c6320a44cf8f0 (patch)
tree3e2406ef6585a19828803eebb5538b98fda1ffb2 /llvm/lib/Transforms
parent6e135f45a8666874d1600659cd1b1bd6bb49b06e (diff)
downloadbcm5719-llvm-979a11d5b21f375450dc89970f5c6320a44cf8f0.tar.gz
bcm5719-llvm-979a11d5b21f375450dc89970f5c6320a44cf8f0.zip
[LoopDeletion] Add an assert that verifies LCSSA
This is inspired by PR24804 -- had this assert been there before, isolating the root cause for PR24804 would have been far easier. llvm-svn: 261481
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopDeletion.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
index 498e7d64376..856c3ca5c6b 100644
--- a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
@@ -122,6 +122,9 @@ bool LoopDeletion::runOnLoop(Loop *L, LPPassManager &) {
if (skipOptnoneFunction(L))
return false;
+ DominatorTree &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
+ assert(L->isLCSSAForm(DT) && "Expected LCSSA!");
+
// We can only remove the loop if there is a preheader that we can
// branch from after removing it.
BasicBlock *preheader = L->getLoopPreheader();
@@ -194,7 +197,6 @@ bool LoopDeletion::runOnLoop(Loop *L, LPPassManager &) {
// Update the dominator tree and remove the instructions and blocks that will
// be deleted from the reference counting scheme.
- DominatorTree &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
SmallVector<DomTreeNode*, 8> ChildNodes;
for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end();
LI != LE; ++LI) {
OpenPOWER on IntegriCloud