forked from OSchip/llvm-project
fix a buggy check that accidentally disabled this xform
llvm-svn: 30967
This commit is contained in:
parent
c1fb4264f5
commit
9a1c7dd27a
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue