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:
Owen Anderson 2006-06-13 20:50:09 +00:00
parent 3cc86cc11f
commit 8b92d0cae1

View File

@ -215,6 +215,12 @@ void LCSSA::processInstruction(Instruction* Instr,
for (Instruction::use_iterator UI = Instr->use_begin(), UE = Instr->use_end();
UI != UE; ++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.
if (!inLoop(use->getParent()))
Uses.push_back(use);