mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Fix bug: ADCE/2003-04-25-PHIPostDominateProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5952 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
152eee1249
commit
619f825640
@ -310,15 +310,16 @@ bool ADCE::doADCE() {
|
||||
// should be identical to the incoming values for LastDead.
|
||||
//
|
||||
for (BasicBlock::iterator II = NextAlive->begin();
|
||||
PHINode *PN = dyn_cast<PHINode>(II); ++II) {
|
||||
// Get the incoming value for LastDead...
|
||||
int OldIdx = PN->getBasicBlockIndex(LastDead);
|
||||
assert(OldIdx != -1 && "LastDead is not a pred of NextAlive!");
|
||||
Value *InVal = PN->getIncomingValue(OldIdx);
|
||||
|
||||
// Add an incoming value for BB now...
|
||||
PN->addIncoming(InVal, BB);
|
||||
}
|
||||
PHINode *PN = dyn_cast<PHINode>(II); ++II)
|
||||
if (LiveSet.count(PN)) { // Only modify live phi nodes
|
||||
// Get the incoming value for LastDead...
|
||||
int OldIdx = PN->getBasicBlockIndex(LastDead);
|
||||
assert(OldIdx != -1 &&"LastDead is not a pred of NextAlive!");
|
||||
Value *InVal = PN->getIncomingValue(OldIdx);
|
||||
|
||||
// Add an incoming value for BB now...
|
||||
PN->addIncoming(InVal, BB);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user