Fix bug: test/Regression/Transforms/InstCombine/2002-05-14-SubFailure.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2627 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-05-14 16:44:07 +00:00
parent cdece545dd
commit 86c25fd556

View File

@ -187,7 +187,7 @@ Instruction *InstCombiner::visitSub(BinaryOperator *I) {
// not used by anyone else...
//
if (BinaryOperator *Op1I = dyn_cast<BinaryOperator>(Op1))
if (Op1I->use_size() == 1) {
if (Op1I->use_size() == 1 && Op1I->getOpcode() == Instruction::Sub) {
// Swap the two operands of the subexpr...
Value *IIOp0 = Op1I->getOperand(0), *IIOp1 = Op1I->getOperand(1);
Op1I->setOperand(0, IIOp1);