mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-23 17:32:49 +00:00
Teach LoopUnroll how to bail if LoopSimplify can't give it what it needs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86164 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6a02fc3070
commit
692ad8dd06
@ -108,8 +108,19 @@ static BasicBlock *FoldBlockIntoPredecessor(BasicBlock *BB, LoopInfo* LI) {
|
||||
bool llvm::UnrollLoop(Loop *L, unsigned Count, LoopInfo* LI, LPPassManager* LPM) {
|
||||
assert(L->isLCSSAForm());
|
||||
|
||||
BasicBlock *Header = L->getHeader();
|
||||
BasicBlock *Preheader = L->getLoopPreheader();
|
||||
if (!Preheader) {
|
||||
DEBUG(errs() << " Can't unroll; loop preheader-insertion failed.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
BasicBlock *LatchBlock = L->getLoopLatch();
|
||||
if (!LatchBlock) {
|
||||
DEBUG(errs() << " Can't unroll; loop exit-block-insertion failed.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
BasicBlock *Header = L->getHeader();
|
||||
BranchInst *BI = dyn_cast<BranchInst>(LatchBlock->getTerminator());
|
||||
|
||||
if (!BI || BI->isUnconditional()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user