aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-04-09 23:52:13 +0000
committerChris Lattner <sabre@nondot.org>2007-04-09 23:52:13 +0000
commit81973ef7cb1c3c203297ddf4ee9c3e34d2acce70 (patch)
tree82f2ad9e18228c0f791b85048cd4753365c4ab80
parent5c05fa0d0bcfe97ef5d99fcb71e24f25fe6cd5db (diff)
Strengthen the boundary conditions of this fold, implementing
InstCombine/set.ll:test25 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35852 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 62f2b5afd0..c8ec52ef8d 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -4741,13 +4741,13 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {
case ICmpInst::ICMP_ULT:
if (Max.ult(RHSVal))
return ReplaceInstUsesWith(I, ConstantInt::getTrue());
- if (Min.ugt(RHSVal))
+ if (Min.uge(RHSVal))
return ReplaceInstUsesWith(I, ConstantInt::getFalse());
break;
case ICmpInst::ICMP_UGT:
if (Min.ugt(RHSVal))
return ReplaceInstUsesWith(I, ConstantInt::getTrue());
- if (Max.ult(RHSVal))
+ if (Max.ule(RHSVal))
return ReplaceInstUsesWith(I, ConstantInt::getFalse());
break;
case ICmpInst::ICMP_SLT:
@@ -4759,7 +4759,7 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {
case ICmpInst::ICMP_SGT:
if (Min.sgt(RHSVal))
return ReplaceInstUsesWith(I, ConstantInt::getTrue());
- if (Max.slt(RHSVal))
+ if (Max.sle(RHSVal))
return ReplaceInstUsesWith(I, ConstantInt::getFalse());
break;
}