summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPawel Wodnicki <pawel@32bitmicro.com>2012-11-30 03:38:58 +0000
committerPawel Wodnicki <pawel@32bitmicro.com>2012-11-30 03:38:58 +0000
commit24d616e51f503d77fe9dca5904991292831b9132 (patch)
treed62593971f7bf02b388001ba5abee357dfd7842c /lib
parent73c484255b149cc5392b6dfcc1ef29ed6547cbe4 (diff)
downloadllvm-24d616e51f503d77fe9dca5904991292831b9132.tar.gz
llvm-24d616e51f503d77fe9dca5904991292831b9132.tar.bz2
llvm-24d616e51f503d77fe9dca5904991292831b9132.tar.xz
Merging r168921: into the 3.2 release branch.
Follow up to 168711: It's safe to base this analysis on the found compare, just return the value for the right predicate. Thanks to Andy for catching this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168974 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index e3ec2685cc..e3189ecc89 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -6149,10 +6149,9 @@ bool ScalarEvolution::isImpliedCond(ICmpInst::Predicate Pred,
if (SimplifyICmpOperands(Pred, LHS, RHS))
if (LHS == RHS)
return CmpInst::isTrueWhenEqual(Pred);
-
- // Canonicalize the found cond too. We can't conclude a result from the
- // simplified values.
- SimplifyICmpOperands(FoundPred, FoundLHS, FoundRHS);
+ if (SimplifyICmpOperands(FoundPred, FoundLHS, FoundRHS))
+ if (FoundLHS == FoundRHS)
+ return CmpInst::isFalseWhenEqual(FoundPred);
// Check to see if we can make the LHS or RHS match.
if (LHS == FoundRHS || RHS == FoundLHS) {