mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-21 16:24:47 +00:00
make a temporary for *SI, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36782 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
01dfdcd84b
commit
a0c54f3ada
@ -302,17 +302,18 @@ bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) {
|
|||||||
|
|
||||||
for (SmallPtrSet<PHINode*,8>::iterator SI = Users.begin(), SE = Users.end();
|
for (SmallPtrSet<PHINode*,8>::iterator SI = Users.begin(), SE = Users.end();
|
||||||
SI != SE; ++SI) {
|
SI != SE; ++SI) {
|
||||||
Value* InVal = (*SI)->getIncomingValueForBlock(LatchBlock);
|
PHINode *PN = *SI;
|
||||||
|
Value* InVal = PN->getIncomingValueForBlock(LatchBlock);
|
||||||
if (isa<Instruction>(InVal))
|
if (isa<Instruction>(InVal))
|
||||||
InVal = LastValueMap[InVal];
|
InVal = LastValueMap[InVal];
|
||||||
(*SI)->removeIncomingValue(LatchBlock, false);
|
PN->removeIncomingValue(LatchBlock, false);
|
||||||
if (InVal)
|
if (InVal)
|
||||||
(*SI)->addIncoming(InVal, cast<BasicBlock>(LastValueMap[LatchBlock]));
|
PN->addIncoming(InVal, cast<BasicBlock>(LastValueMap[LatchBlock]));
|
||||||
if ((*SI)->getNumIncomingValues() == 0) {
|
if (PN->getNumIncomingValues() == 0) {
|
||||||
// Remove this phi node.
|
// Remove this phi node.
|
||||||
// If anyone is using this PHI, make them use a dummy value instead...
|
// If anyone is using this PHI, make them use a dummy value instead...
|
||||||
(*SI)->replaceAllUsesWith(UndefValue::get((*SI)->getType()));
|
PN->replaceAllUsesWith(UndefValue::get(PN->getType()));
|
||||||
(*SI)->eraseFromParent();
|
PN->eraseFromParent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user