a missed optimization that Eli spotted

llvm-svn: 53449
This commit is contained in:
Chris Lattner 2008-07-11 06:40:29 +00:00
parent 13a6911ea2
commit 3994bed1a9
1 changed files with 1 additions and 1 deletions

View File

@ -5336,7 +5336,7 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {
case ICmpInst::ICMP_SLT: case ICmpInst::ICMP_SLT:
if (Max.slt(RHSVal)) // A <s C -> true iff max(A) < C if (Max.slt(RHSVal)) // A <s C -> true iff max(A) < C
return ReplaceInstUsesWith(I, ConstantInt::getTrue()); return ReplaceInstUsesWith(I, ConstantInt::getTrue());
if (Min.sgt(RHSVal)) // A <s C -> false iff min(A) >= C if (Min.sge(RHSVal)) // A <s C -> false iff min(A) >= C
return ReplaceInstUsesWith(I, ConstantInt::getFalse()); return ReplaceInstUsesWith(I, ConstantInt::getFalse());
if (RHSVal == Max) // A <s MAX -> A != MAX if (RHSVal == Max) // A <s MAX -> A != MAX
return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1);