Fix some bugs in an xform added yesterday. This fixes Prolangs-C/allroots.

llvm-svn: 19553
This commit is contained in:
Chris Lattner 2005-01-14 17:35:12 +00:00
parent 13fd87be57
commit 708ff662ba

@ -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);
}
}
}