summaryrefslogtreecommitdiff
path: root/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-11-27 18:16:32 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-11-27 18:16:32 +0000
commitb2a818f83bebb5d77bf07dec50102a8d84e8b010 (patch)
tree5dc158dff8c0b8939df9264f938566886cfa46a9 /lib/Analysis/ScalarEvolution.cpp
parentf365d3984e2934b182e866d545348988d3b681d5 (diff)
downloadllvm-b2a818f83bebb5d77bf07dec50102a8d84e8b010.tar.gz
llvm-b2a818f83bebb5d77bf07dec50102a8d84e8b010.tar.bz2
llvm-b2a818f83bebb5d77bf07dec50102a8d84e8b010.tar.xz
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/trunk@168711 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-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) {