diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-10-16 23:08:08 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-10-16 23:08:08 +0000 |
commit | ac5209e5fe8a09a9baf0c001ed8ada755f34336d (patch) | |
tree | f54d5197e8466b1dfc1b78e1fac5583cb3be3206 /lib/Transforms | |
parent | 348b00dc49c71b1f8e830d14e8af53d0c0024678 (diff) |
Undo Chris' last patch, it caused a regression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30991 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 6654daff37..f0961de527 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/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)); |