[llvm] r249654 - [SCEV] Check `Pred` first in isKnownPredicateViaSplitting
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 7 20:46:00 PDT 2015
Author: sanjoy
Date: Wed Oct 7 22:46:00 2015
New Revision: 249654
URL: http://llvm.org/viewvc/llvm-project?rev=249654&view=rev
Log:
[SCEV] Check `Pred` first in isKnownPredicateViaSplitting
Comparing `Pred` with `ICmpInst::ICMP_ULT` is cheaper that memory access
-- do that check before loading / storing `ProvingSplitPredicate`.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=249654&r1=249653&r2=249654&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Wed Oct 7 22:46:00 2015
@@ -7132,7 +7132,7 @@ ScalarEvolution::isKnownPredicateWithRan
bool ScalarEvolution::isKnownPredicateViaSplitting(ICmpInst::Predicate Pred,
const SCEV *LHS,
const SCEV *RHS) {
- if (ProvingSplitPredicate)
+ if (Pred != ICmpInst::ICMP_ULT || ProvingSplitPredicate)
return false;
// Allowing arbitrary number of activations of isKnownPredicateViaSplitting on
@@ -7146,7 +7146,7 @@ bool ScalarEvolution::isKnownPredicateVi
// expensive; and using isKnownNonNegative(RHS) is sufficient for most of the
// interesting cases seen in practice. We can consider "upgrading" L >= 0 to
// use isKnownPredicate later if needed.
- if (Pred == ICmpInst::ICMP_ULT && isKnownNonNegative(RHS) &&
+ if (isKnownNonNegative(RHS) &&
isKnownPredicate(CmpInst::ICMP_SGE, LHS, getZero(LHS->getType())) &&
isKnownPredicate(CmpInst::ICMP_SLT, LHS, RHS))
return true;
More information about the llvm-commits
mailing list