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
This commit is contained in:
Chris Lattner 2006-10-15 22:42:15 +00:00
parent 32b5d717ce
commit 02c0e3659f

View 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));