OSDN Git Service

Fix bug when checking phi operands in InstCombiner::visitPHINode(),
authorJay Foad <jay.foad@gmail.com>
Sat, 16 Apr 2011 14:17:37 +0000 (14:17 +0000)
committerJay Foad <jay.foad@gmail.com>
Sat, 16 Apr 2011 14:17:37 +0000 (14:17 +0000)
found by code inspection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129641 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombinePHI.cpp

index c91b793..37c3cd9 100644 (file)
@@ -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.