In my analysis for r56076 I missed the case where the original

multiplication overflows.

llvm-svn: 56082
This commit is contained in:
Dan Gohman 2008-09-11 00:25:00 +00:00
parent ebfb483309
commit 36e01356ec

View File

@ -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