diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-08-18 21:10:01 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-08-18 21:10:01 +0000 |
commit | 66af89f642628c0d52138e86f9e4a0b9f5994474 (patch) | |
tree | 3309c690f98d54b906e9aa8bb38e058c9eae611d /lib/Transforms/Utils | |
parent | 1c44d869cd920f3c2d7fdc9196677db202440089 (diff) | |
download | llvm-66af89f642628c0d52138e86f9e4a0b9f5994474.tar.gz llvm-66af89f642628c0d52138e86f9e4a0b9f5994474.tar.bz2 llvm-66af89f642628c0d52138e86f9e4a0b9f5994474.tar.xz |
Revert r137871. The loop simplify pass should require all exits from a loop that
aren't from an indirect branch need to be dominated by the loop header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137981 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r-- | lib/Transforms/Utils/LoopSimplify.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index b019684021..46bdf57da5 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -398,9 +398,6 @@ BasicBlock *LoopSimplify::InsertPreheaderForLoop(Loop *L) { /// blocks. This method is used to split exit blocks that have predecessors /// outside of the loop. BasicBlock *LoopSimplify::RewriteLoopExitBlock(Loop *L, BasicBlock *Exit) { - // Don't split a landing pad block. - if (Exit->isLandingPad()) return 0; - SmallVector<BasicBlock*, 8> LoopBlocks; for (pred_iterator I = pred_begin(Exit), E = pred_end(Exit); I != E; ++I) { BasicBlock *P = *I; @@ -749,10 +746,9 @@ void LoopSimplify::verifyAnalysis() const { (void)HasIndBrPred; } - // Indirectbr and LandingPad can interfere with exit block canonicalization. + // Indirectbr can interfere with exit block canonicalization. if (!L->hasDedicatedExits()) { bool HasIndBrExiting = false; - bool HasLPadExiting = false; SmallVector<BasicBlock*, 8> ExitingBlocks; L->getExitingBlocks(ExitingBlocks); for (unsigned i = 0, e = ExitingBlocks.size(); i != e; ++i) { @@ -760,18 +756,10 @@ void LoopSimplify::verifyAnalysis() const { HasIndBrExiting = true; break; } - if (const InvokeInst *II = - dyn_cast<InvokeInst>(ExitingBlocks[i]->getTerminator())) { - if (L->contains(II->getNormalDest()) && - !L->contains(II->getUnwindDest())) { - HasLPadExiting = true; - break; - } - } } - assert((HasIndBrExiting || HasLPadExiting) && + assert(HasIndBrExiting && "LoopSimplify has no excuse for missing exit block info!"); - (void)HasIndBrExiting; (void)HasLPadExiting; + (void)HasIndBrExiting; } } |