From: Chris Lattner Date: Fri, 14 Jan 2005 17:35:12 +0000 (+0000) Subject: Fix some bugs in an xform added yesterday. This fixes Prolangs-C/allroots. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=906ab50acf4f33ee47053138900a8d5a4160aa06;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 840dbd47d43..6d4718d42ca 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); } } }