From: Jay Foad Date: Sat, 16 Apr 2011 14:17:37 +0000 (+0000) Subject: Fix bug when checking phi operands in InstCombiner::visitPHINode(), X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4130278fbee97b9cd1ea4069e9c666bbe89d61f9;p=oota-llvm.git Fix bug when checking phi operands in InstCombiner::visitPHINode(), found by code inspection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129641 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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.