1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Replace indunction variable with split value in loop body.

This fixes art miscompile.

llvm-svn: 41195
This commit is contained in:
Devang Patel 2007-08-20 20:49:01 +00:00
parent 6c91023dad
commit b6ebf8cbf3

View File

@ -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());