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 | ba11a9892ce3e0ae0088c326b423857d1c338ccc (patch) | |
tree | 7ad53ec46833e651e165a3689f7679db088ded9e /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | 1521681b59d9fc0ca6b8daa6d4f78300c472e8da (diff) | |
download | bcm5719-llvm-ba11a9892ce3e0ae0088c326b423857d1c338ccc.tar.gz bcm5719-llvm-ba11a9892ce3e0ae0088c326b423857d1c338ccc.zip |
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.
llvm-svn: 168921
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 852eb2b13d9..977f57ee79c 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/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) { |