summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-10-16 23:08:08 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-10-16 23:08:08 +0000
commit3c514959ddaeb31e0f4eaea9f1f28041e4a1a594 (patch)
tree7ac7ca90eb880baf0971b658f134aa0f41bf25c3 /llvm/lib
parent1367ff084df5aa8138d2cd17658750d4bf40d3f7 (diff)
downloadbcm5719-llvm-3c514959ddaeb31e0f4eaea9f1f28041e4a1a594.tar.gz
bcm5719-llvm-3c514959ddaeb31e0f4eaea9f1f28041e4a1a594.zip
Undo Chris' last patch, it caused a regression.
llvm-svn: 30991
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 6654daff37d..f0961de5274 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -1970,10 +1970,10 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) {
return BinaryOperator::createAnd(Op0, NewNot);
}
- // -(X sdiv C) -> (X sdiv -C)
+ // 0 - (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));
OpenPOWER on IntegriCloud