summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 9ee375c3825..8d7616053b1 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -2937,8 +2937,7 @@ Instruction *InstCombiner::visitSDiv(BinaryOperator &I) {
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,
- ConstantExpr::getNeg(RHS));
+ return BinaryOperator::CreateSDiv(LHSNeg, RHSNeg);
}
}
}
OpenPOWER on IntegriCloud