aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-14 17:35:12 +0000
committerChris Lattner <sabre@nondot.org>2005-01-14 17:35:12 +0000
commit906ab50acf4f33ee47053138900a8d5a4160aa06 (patch)
treedec07a0c5e9eb6096c9d98c6cbdd3d973a1d7fa7
parent6f7f02fdeccf33f5d3a1684945a04a3c1eaee72e (diff)
Fix some bugs in an xform added yesterday. This fixes Prolangs-C/allroots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19553 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp4
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);
}
}
}