mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
[Unroll] Don't analyze blocks outside the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243466 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -586,16 +586,20 @@ analyzeLoopUnrollCost(const Loop *L, unsigned TripCount, ScalarEvolution &SE,
|
||||
if (BI->isConditional()) {
|
||||
if (Constant *SimpleCond =
|
||||
SimplifiedValues.lookup(BI->getCondition())) {
|
||||
BBWorklist.insert(BI->getSuccessor(
|
||||
cast<ConstantInt>(SimpleCond)->isZero() ? 1 : 0));
|
||||
BasicBlock *Succ = BI->getSuccessor(
|
||||
cast<ConstantInt>(SimpleCond)->isZero() ? 1 : 0);
|
||||
if (L->contains(Succ))
|
||||
BBWorklist.insert(Succ);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else if (SwitchInst *SI = dyn_cast<SwitchInst>(TI)) {
|
||||
if (Constant *SimpleCond =
|
||||
SimplifiedValues.lookup(SI->getCondition())) {
|
||||
BBWorklist.insert(
|
||||
SI->getSuccessor(cast<ConstantInt>(SimpleCond)->getSExtValue()));
|
||||
BasicBlock *Succ =
|
||||
SI->getSuccessor(cast<ConstantInt>(SimpleCond)->getSExtValue());
|
||||
if (L->contains(Succ))
|
||||
BBWorklist.insert(Succ);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user