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
This commit is contained in:
Benjamin Kramer
2012-11-27 18:16:32 +00:00
parent f365d3984e
commit b2a818f83b
2 changed files with 58 additions and 3 deletions

View File

@@ -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) {