diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-11-29 19:07:57 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-11-29 19:07:57 +0000 |
commit | 7d4253af167479759fa5a71b7607b40033b96492 (patch) | |
tree | ba939f9409dd2b628037a5153dadb39956def787 /lib/Analysis/ScalarEvolution.cpp | |
parent | b36be80510b9b38a9341623db3a6a9a49f1764fe (diff) | |
download | external_llvm-7d4253af167479759fa5a71b7607b40033b96492.zip external_llvm-7d4253af167479759fa5a71b7607b40033b96492.tar.gz external_llvm-7d4253af167479759fa5a71b7607b40033b96492.tar.bz2 |
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/trunk@168921 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 852eb2b..977f57e 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) { |