aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-05-03 18:00:24 +0000
committerDan Gohman <gohman@apple.com>2010-05-03 18:00:24 +0000
commit34c3e36e6317b0ed448ccd2c567d5b088275fd7d (patch)
treed9c7d037cb12f24b2d26a1c6fbc5803adf10391f
parenta189bae771262aa237ce983a89d1289a67682b68 (diff)
Use isTrueWhenEqual and isFalseWhenEqual instead of assuming that
SimplifyICmpOperands will simplify such cases to EQ or NE. This makes the correcntess of the code independent on SimplifyICmpOperands doing certain simplifications. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102927 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/ScalarEvolution.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index f0cb7986bd..30303cbbd1 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -5260,10 +5260,10 @@ bool ScalarEvolution::isImpliedCond(Value *CondValue,
// canonicalized the comparison.
if (SimplifyICmpOperands(Pred, LHS, RHS))
if (LHS == RHS)
- return Pred == ICmpInst::ICMP_EQ;
+ return CmpInst::isTrueWhenEqual(Pred);
if (SimplifyICmpOperands(FoundPred, FoundLHS, FoundRHS))
if (FoundLHS == FoundRHS)
- return Pred == ICmpInst::ICMP_NE;
+ return CmpInst::isFalseWhenEqual(Pred);
// Check to see if we can make the LHS or RHS match.
if (LHS == FoundRHS || RHS == FoundLHS) {