/// Test if the given expression is known to satisfy the condition described
/// by Pred and the known constant ranges of LHS and RHS.
///
- bool isKnownPredicateWithRanges(ICmpInst::Predicate Pred,
- const SCEV *LHS, const SCEV *RHS);
+ bool isKnownPredicateViaConstantRanges(ICmpInst::Predicate Pred,
+ const SCEV *LHS, const SCEV *RHS);
/// Try to prove the condition described by "LHS Pred RHS" by ruling out
/// integer overflow.
return true;
// Otherwise see what can be done with known constant ranges.
- return isKnownPredicateWithRanges(Pred, LHS, RHS);
+ return isKnownPredicateViaConstantRanges(Pred, LHS, RHS);
}
bool ScalarEvolution::isMonotonicPredicate(const SCEVAddRecExpr *LHS,
return true;
}
-bool
-ScalarEvolution::isKnownPredicateWithRanges(ICmpInst::Predicate Pred,
- const SCEV *LHS, const SCEV *RHS) {
+bool ScalarEvolution::isKnownPredicateViaConstantRanges(
+ ICmpInst::Predicate Pred, const SCEV *LHS, const SCEV *RHS) {
if (HasSameValue(LHS, RHS))
return ICmpInst::isTrueWhenEqual(Pred);
// (interprocedural conditions notwithstanding).
if (!L) return true;
- if (isKnownPredicateWithRanges(Pred, LHS, RHS)) return true;
+ if (isKnownPredicateViaConstantRanges(Pred, LHS, RHS))
+ return true;
BasicBlock *Latch = L->getLoopLatch();
if (!Latch)
// (interprocedural conditions notwithstanding).
if (!L) return false;
- if (isKnownPredicateWithRanges(Pred, LHS, RHS)) return true;
+ if (isKnownPredicateViaConstantRanges(Pred, LHS, RHS))
+ return true;
// Starting at the loop predecessor, climb up the predecessor chain, as long
// as there are predecessors that can be found that have unique successors
const SCEV *FoundRHS) {
auto IsKnownPredicateFull =
[this](ICmpInst::Predicate Pred, const SCEV *LHS, const SCEV *RHS) {
- return isKnownPredicateWithRanges(Pred, LHS, RHS) ||
+ return isKnownPredicateViaConstantRanges(Pred, LHS, RHS) ||
IsKnownPredicateViaMinOrMax(*this, Pred, LHS, RHS) ||
IsKnownPredicateViaAddRecStart(*this, Pred, LHS, RHS) ||
isKnownPredicateViaNoOverflow(Pred, LHS, RHS);