mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Fix another instance where PHI nodes need special treatment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28774 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -215,6 +215,12 @@ void LCSSA::processInstruction(Instruction* Instr,
|
|||||||
for (Instruction::use_iterator UI = Instr->use_begin(), UE = Instr->use_end();
|
for (Instruction::use_iterator UI = Instr->use_begin(), UE = Instr->use_end();
|
||||||
UI != UE; ++UI) {
|
UI != UE; ++UI) {
|
||||||
Instruction* use = cast<Instruction>(*UI);
|
Instruction* use = cast<Instruction>(*UI);
|
||||||
|
BasicBlock* UserBB = use->getParent();
|
||||||
|
if (PHINode* p = dyn_cast<PHINode>(use)) {
|
||||||
|
unsigned OperandNo = UI.getOperandNo();
|
||||||
|
UserBB = p->getIncomingBlock(OperandNo/2);
|
||||||
|
}
|
||||||
|
|
||||||
// Don't need to update uses within the loop body.
|
// Don't need to update uses within the loop body.
|
||||||
if (!inLoop(use->getParent()))
|
if (!inLoop(use->getParent()))
|
||||||
Uses.push_back(use);
|
Uses.push_back(use);
|
||||||
|
Reference in New Issue
Block a user