summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2007-09-06 01:10:22 +0000
committerNick Lewycky <nicholas@mxc.ca>2007-09-06 01:10:22 +0000
commitb0b066eaaa4c77a8f50deca513d094f49922d2a8 (patch)
treecc1e752e117854c86df6185d4e439235b8e6c2d1 /llvm/lib/Transforms
parentd059eed1c14db51c4910d2468a01f84c33f188b1 (diff)
downloadbcm5719-llvm-b0b066eaaa4c77a8f50deca513d094f49922d2a8.tar.gz
bcm5719-llvm-b0b066eaaa4c77a8f50deca513d094f49922d2a8.zip
When the two operands of an icmp are equal, there are five possible predicates
that would make the icmp true. Fixes PR1637. llvm-svn: 41740
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 9db10340a12..58eb3bc2750 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -4563,7 +4563,9 @@ Instruction *InstCombiner::FoldGEPICmp(User *GEPLHS, Value *RHS,
if (NumDifferences == 0) // SAME GEP?
return ReplaceInstUsesWith(I, // No comparison is needed here.
ConstantInt::get(Type::Int1Ty,
- Cond == ICmpInst::ICMP_EQ));
+ Cond == ICmpInst::ICMP_EQ ||
+ Cond == ICmpInst::ICMP_ULE || Cond == ICmpInst::ICMP_UGE ||
+ Cond == ICmpInst::ICMP_SLE || Cond == ICmpInst::ICMP_SGE));
else if (NumDifferences == 1) {
Value *LHSV = GEPLHS->getOperand(DiffOperand);
Value *RHSV = GEPRHS->getOperand(DiffOperand);
OpenPOWER on IntegriCloud