From: Chris Lattner Date: Tue, 14 May 2002 16:44:07 +0000 (+0000) Subject: Fix bug: test/Regression/Transforms/InstCombine/2002-05-14-SubFailure.ll X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=86c25fd5560dd9df92ccfd37ffa2dba1a007eeae;p=oota-llvm.git 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 --- 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);