From de0457a013a93d6470094194ece1a1bc4eec1bad Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Thu, 21 Jan 2021 22:36:18 -0600 Subject: [PATCH] [Polly] Clean up hasFeasibleRuntimeContext. --- polly/include/polly/ScopInfo.h | 3 --- polly/lib/Analysis/ScopInfo.cpp | 27 +++++++-------------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index cdc70e0..b4b0255 100644 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -1904,9 +1904,6 @@ private: void init(AAResults &AA, AssumptionCache &AC, DominatorTree &DT, LoopInfo &LI); - /// Add parameter constraints to @p C that imply a non-empty domain. - isl::set addNonEmptyDomainConstraints(isl::set C) const; - /// Return the access for the base ptr of @p MA if any. MemoryAccess *lookupBasePtrAccess(MemoryAccess *MA); diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 9d2dca4..0ae91d8 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -1977,28 +1977,15 @@ bool Scop::isProfitable(bool ScalarsAreUnprofitable) const { } bool Scop::hasFeasibleRuntimeContext() const { - auto PositiveContext = getAssumedContext(); - auto NegativeContext = getInvalidContext(); - PositiveContext = addNonEmptyDomainConstraints(PositiveContext); - // addNonEmptyDomainConstraints returns null if ScopStmts have a null domain - if (!PositiveContext) + if (Stmts.empty()) return false; - bool IsFeasible = !(PositiveContext.is_empty() || - PositiveContext.is_subset(NegativeContext)); - if (!IsFeasible) - return false; - - auto DomainContext = getDomains().params(); - IsFeasible = !DomainContext.is_subset(NegativeContext); - IsFeasible &= !getContext().is_subset(NegativeContext); - - return IsFeasible; -} - -isl::set Scop::addNonEmptyDomainConstraints(isl::set C) const { - isl::set DomainContext = getDomains().params(); - return C.intersect_params(DomainContext); + isl::set PositiveContext = getAssumedContext(); + isl::set NegativeContext = getInvalidContext(); + PositiveContext = PositiveContext.intersect_params(Context); + PositiveContext = PositiveContext.intersect_params(getDomains().params()); + return PositiveContext.is_empty().is_false() && + PositiveContext.is_subset(NegativeContext).is_false(); } MemoryAccess *Scop::lookupBasePtrAccess(MemoryAccess *MA) { -- 2.7.4