summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
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
commit51726c47fe61ebaf5cd9c6c43beeb8dadb0651d8 (patch)
tree4e5c7caf6df1c71e0921f531c86f83854b17c96c /llvm/lib/Transforms
parent7aa41cfa88ae99880e86e5091266900982db4a75 (diff)
downloadbcm5719-llvm-51726c47fe61ebaf5cd9c6c43beeb8dadb0651d8.tar.gz
bcm5719-llvm-51726c47fe61ebaf5cd9c6c43beeb8dadb0651d8.zip
Fix some bugs in an xform added yesterday. This fixes Prolangs-C/allroots.
llvm-svn: 19553
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 840dbd47d43..6d4718d42ca 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/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);
}
}
}
OpenPOWER on IntegriCloud