[llvm-commits] [llvm] r137981 - /llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp
Bill Wendling
isanbard at gmail.com
Thu Aug 18 14:10:01 PDT 2011
Author: void
Date: Thu Aug 18 16:10:01 2011
New Revision: 137981
URL: http://llvm.org/viewvc/llvm-project?rev=137981&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp
Modified: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp?rev=137981&r1=137980&r2=137981&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Thu Aug 18 16:10:01 2011
@@ -398,9 +398,6 @@
/// 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)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 @@
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;
}
}
More information about the llvm-commits
mailing list