fix a buggy check that accidentally disabled this xform

llvm-svn: 30967
This commit is contained in:
Chris Lattner 2006-10-15 22:42:15 +00:00
parent c1fb4264f5
commit 9a1c7dd27a
1 changed files with 1 additions and 1 deletions

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