diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-11-27 18:16:32 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-11-27 18:16:32 +0000 |
commit | b2a818f83bebb5d77bf07dec50102a8d84e8b010 (patch) | |
tree | 5dc158dff8c0b8939df9264f938566886cfa46a9 /lib/Analysis/ScalarEvolution.cpp | |
parent | f365d3984e2934b182e866d545348988d3b681d5 (diff) | |
download | external_llvm-b2a818f83bebb5d77bf07dec50102a8d84e8b010.zip external_llvm-b2a818f83bebb5d77bf07dec50102a8d84e8b010.tar.gz external_llvm-b2a818f83bebb5d77bf07dec50102a8d84e8b010.tar.bz2 |
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.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 5f60bd1..e3ec268 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) { |