From 86c25fd5560dd9df92ccfd37ffa2dba1a007eeae Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 14 May 2002 16:44:07 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/InstructionCombining.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 0812fca6e97..b6727d5f9e0 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -187,7 +187,7 @@ Instruction *InstCombiner::visitSub(BinaryOperator *I) { // not used by anyone else... // if (BinaryOperator *Op1I = dyn_cast(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);