aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 321b032505..d2827af3d7 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -2699,6 +2699,8 @@ Instruction *InstCombiner::visitSetCondInst(SetCondInst &I) {
if (CI->isNullValue()) { // (X / neg) op 0
LoBound = AddOne(DivRHS);
HiBound = cast<ConstantInt>(ConstantExpr::getNeg(DivRHS));
+ if (HiBound == DivRHS)
+ LoBound = 0; // - INTMIN = INTMIN
} else if (isPositive(CI)) { // (X / neg) op pos
HiOverflow = LoOverflow = ProdOV;
if (!LoOverflow)