mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-27 07:12:06 +00:00
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:
parent
32b5d717ce
commit
02c0e3659f
@ -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…
x
Reference in New Issue
Block a user