mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-20 12:31:40 +00:00
Replace indunction variable with split value in loop body.
This fixes art miscompile. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41195 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d651f657f2
commit
ebc5fea695
@ -418,7 +418,11 @@ bool LoopIndexSplit::processOneIterationLoop(SplitInfo &SD) {
|
||||
|
||||
// Update CFG.
|
||||
|
||||
// As a first step to break this loop, remove Latch to Header edge.
|
||||
// Replace index variable with split value in loop body. Loop body is executed
|
||||
// only when index variable is equal to split value.
|
||||
IndVar->replaceAllUsesWith(SD.SplitValue);
|
||||
|
||||
// Remove Latch to Header edge.
|
||||
BasicBlock *Latch = L->getLoopLatch();
|
||||
BasicBlock *LatchSucc = NULL;
|
||||
BranchInst *BR = dyn_cast<BranchInst>(Latch->getTerminator());
|
||||
|
Loading…
x
Reference in New Issue
Block a user