fix a buggy check that accidentally disabled this xform
authorChris Lattner <sabre@nondot.org>
Sun, 15 Oct 2006 22:42:15 +0000 (22:42 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 15 Oct 2006 22:42:15 +0000 (22:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30967 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index 739493e2740daf54c1ed26a26c2d4c2794f33a72..6654daff37d0f3ac5d805a0d905898565ccb456d 100644 (file)
@@ -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<ConstantSInt>(Op0))
-          if (CSI->isNullValue())
+          if (!CSI->isNullValue())
             if (Constant *DivRHS = dyn_cast<Constant>(Op1I->getOperand(1)))
               return BinaryOperator::createDiv(Op1I->getOperand(0),
                                                ConstantExpr::getNeg(DivRHS));