mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
Fix for 2006-06-27-DeadSwitchCase.ll
Be more careful when updating Phi nodes after eliminating dead switch cases. Fix proposed by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28947 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2f62a9eb2e
commit
bef8508737
@ -971,11 +971,12 @@ void LoopUnswitch::RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC,
|
||||
|
||||
Old->getTerminator()->eraseFromParent();
|
||||
|
||||
for (BasicBlock::iterator II = SI->getSuccessor(i)->begin(),
|
||||
IE = SI->getSuccessor(i)->end(); II != IE; ++II) {
|
||||
if (isa<PHINode>(*II)) {
|
||||
(*II).replaceUsesOfWith(Split, Old);
|
||||
}
|
||||
|
||||
PHINode *PN;
|
||||
for (BasicBlock::iterator II = SI->getSuccessor(i)->begin();
|
||||
(PN = dyn_cast<PHINode>(II)); ++II) {
|
||||
Value *InVal = PN->removeIncomingValue(Split, false);
|
||||
PN->addIncoming(InVal, Old);
|
||||
}
|
||||
|
||||
SI->removeCase(i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user