Fix bug: test/Regression/Transforms/InstCombine/2002-05-14-SubFailure.ll
authorChris Lattner <sabre@nondot.org>
Tue, 14 May 2002 16:44:07 +0000 (16:44 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 14 May 2002 16:44:07 +0000 (16:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2627 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index 0812fca6e97994ba07374b10fb1f70c2a55004f1..b6727d5f9e039ffea85a5a84206422292c705785 100644 (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);