aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 7ad75d24b4..34c5fb3375 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -2929,18 +2929,6 @@ Instruction *InstCombiner::visitSDiv(BinaryOperator &I) {
// sdiv X, -1 == -X
if (RHS->isAllOnesValue())
return BinaryOperator::CreateNeg(Op0);
-
- // -X/C -> X/-C, if and only if negation doesn't overflow.
- if (Value *LHSNeg = dyn_castNegVal(Op0)) {
- if (ConstantInt *CI = dyn_cast<ConstantInt>(LHSNeg)) {
- Constant *RHSNeg = ConstantExpr::getNeg(RHS);
- if (RHS != RHSNeg) { // Check that there is no overflow.
- Constant *CINeg = ConstantExpr::getNeg(CI);
- if (CI != CINeg) // Check that there is no overflow.
- return BinaryOperator::CreateSDiv(LHSNeg, RHSNeg);
- }
- }
- }
}
// If the sign bits of both operands are zero (i.e. we can prove they are