summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPawel Wodnicki <pawel@32bitmicro.com>2012-11-30 03:35:46 +0000
committerPawel Wodnicki <pawel@32bitmicro.com>2012-11-30 03:35:46 +0000
commit73c484255b149cc5392b6dfcc1ef29ed6547cbe4 (patch)
treeeed9510ea12c5e335f52df69435a43bef1510df2 /lib
parentf56817cfb593cb32d2fb84129fc31013bd9ac7f3 (diff)
downloadllvm-73c484255b149cc5392b6dfcc1ef29ed6547cbe4.tar.gz
llvm-73c484255b149cc5392b6dfcc1ef29ed6547cbe4.tar.bz2
llvm-73c484255b149cc5392b6dfcc1ef29ed6547cbe4.tar.xz
Merging r168711: into the 3.2 release branch.
SCEV: Even if the latch terminator is foldable we can't deduce the result of an unrelated condition with it. Fixes PR14432. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168973 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 5f60bd1674..e3ec2685cc 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -6149,9 +6149,10 @@ bool ScalarEvolution::isImpliedCond(ICmpInst::Predicate Pred,
if (SimplifyICmpOperands(Pred, LHS, RHS))
if (LHS == RHS)
return CmpInst::isTrueWhenEqual(Pred);
- if (SimplifyICmpOperands(FoundPred, FoundLHS, FoundRHS))
- if (FoundLHS == FoundRHS)
- return CmpInst::isFalseWhenEqual(Pred);
+
+ // Canonicalize the found cond too. We can't conclude a result from the
+ // simplified values.
+ SimplifyICmpOperands(FoundPred, FoundLHS, FoundRHS);
// Check to see if we can make the LHS or RHS match.
if (LHS == FoundRHS || RHS == FoundLHS) {