summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-09-11 00:25:00 +0000
committerDan Gohman <gohman@apple.com>2008-09-11 00:25:00 +0000
commit7f85fbd9de5a4bb1474075b46eb3a8246ea5220d (patch)
tree02718e4f6d77999aeb13b351dda3c94a106fa639 /lib/Transforms
parent1df3fd66835453a5516fe3336cd725778b39be97 (diff)
downloadllvm-7f85fbd9de5a4bb1474075b46eb3a8246ea5220d.tar.gz
llvm-7f85fbd9de5a4bb1474075b46eb3a8246ea5220d.tar.bz2
llvm-7f85fbd9de5a4bb1474075b46eb3a8246ea5220d.tar.xz
In my analysis for r56076 I missed the case where the original
multiplication overflows. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56082 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 8f578200d6..46ac762b0a 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -5789,7 +5789,8 @@ Instruction *InstCombiner::FoldICmpDivCst(ICmpInst &ICI, BinaryOperator *DivI,
// e.g. X/-5 op -3 --> [15, 20)
LoBound = Prod;
LoOverflow = HiOverflow = ProdOV ? 1 : 0;
- HiOverflow = SubWithOverflow(HiBound, Prod, DivRHS, true);
+ if (!HiOverflow)
+ HiOverflow = SubWithOverflow(HiBound, Prod, DivRHS, true);
}
// Dividing by a negative swaps the condition. LT <-> GT