From: Chris Lattner Date: Sun, 15 Oct 2006 22:42:15 +0000 (+0000) Subject: fix a buggy check that accidentally disabled this xform X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=02c0e3659fb055dd23f33e3aa5b2793798ccb66f;p=oota-llvm.git fix a buggy check that accidentally disabled this xform git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30967 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 739493e2740..6654daff37d 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -1973,7 +1973,7 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) { // -(X sdiv C) -> (X sdiv -C) if (Op1I->getOpcode() == Instruction::Div) if (ConstantSInt *CSI = dyn_cast(Op0)) - if (CSI->isNullValue()) + if (!CSI->isNullValue()) if (Constant *DivRHS = dyn_cast(Op1I->getOperand(1))) return BinaryOperator::createDiv(Op1I->getOperand(0), ConstantExpr::getNeg(DivRHS));