diff --git a/lib/Transforms/InstCombine/InstCombinePHI.cpp b/lib/Transforms/InstCombine/InstCombinePHI.cpp index c91b79338ea..37c3cd9a04c 100644 --- a/lib/Transforms/InstCombine/InstCombinePHI.cpp +++ b/lib/Transforms/InstCombine/InstCombinePHI.cpp @@ -831,7 +831,7 @@ Instruction *InstCombiner::visitPHINode(PHINode &PN) { ++InValNo; if (InValNo != NumOperandVals) { - Value *NonPhiInVal = PN.getOperand(InValNo); + Value *NonPhiInVal = PN.getIncomingValue(InValNo); // Scan the rest of the operands to see if there are any conflicts, if so // there is no need to recursively scan other phis.