mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-23 01:25:32 +00:00
Fix 12513: Loop unrolling breaks with indirect branches.
Take this opportunity to generalize the indirectbr bailout logic for loop transformations. CFG transformations will never get indirectbr right, and there's no point trying. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154386 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -149,6 +149,12 @@ bool llvm::UnrollLoop(Loop *L, unsigned Count, unsigned TripCount,
|
||||
return false;
|
||||
}
|
||||
|
||||
// Loops with indirectbr cannot be cloned.
|
||||
if (!L->isSafeToClone()) {
|
||||
DEBUG(dbgs() << " Can't unroll; Loop body cannot be cloned.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
BasicBlock *Header = L->getHeader();
|
||||
BranchInst *BI = dyn_cast<BranchInst>(LatchBlock->getTerminator());
|
||||
|
||||
|
Reference in New Issue
Block a user