From 02c0e3659fb055dd23f33e3aa5b2793798ccb66f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 15 Oct 2006 22:42:15 +0000 Subject: [PATCH] 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 --- 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 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));