diff options
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 840dbd47d4..6d4718d42c 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -3651,7 +3651,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) { BinaryOperator::createNeg(SubOp->getOperand(1)), SI); } - Value *NewTrueOp = AddOp->getOperand(1); + Value *NewTrueOp = OtherAddOp; Value *NewFalseOp = NegVal; if (AddOp != TI) std::swap(NewTrueOp, NewFalseOp); @@ -3659,7 +3659,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) { new SelectInst(CondVal, NewTrueOp,NewFalseOp,SI.getName()+".p"); NewSel = InsertNewInstBefore(NewSel, SI); - return BinaryOperator::createAdd(AddOp->getOperand(0), NewSel); + return BinaryOperator::createAdd(SubOp->getOperand(0), NewSel); } } } |