Skip to content

Commit de0457a

Browse files
committed
[Polly] Clean up hasFeasibleRuntimeContext.
1 parent a5b8951 commit de0457a

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed

polly/include/polly/ScopInfo.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,9 +1904,6 @@ class Scop {
19041904
void init(AAResults &AA, AssumptionCache &AC, DominatorTree &DT,
19051905
LoopInfo &LI);
19061906

1907-
/// Add parameter constraints to @p C that imply a non-empty domain.
1908-
isl::set addNonEmptyDomainConstraints(isl::set C) const;
1909-
19101907
/// Return the access for the base ptr of @p MA if any.
19111908
MemoryAccess *lookupBasePtrAccess(MemoryAccess *MA);
19121909

polly/lib/Analysis/ScopInfo.cpp

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,28 +1977,15 @@ bool Scop::isProfitable(bool ScalarsAreUnprofitable) const {
19771977
}
19781978

19791979
bool Scop::hasFeasibleRuntimeContext() const {
1980-
auto PositiveContext = getAssumedContext();
1981-
auto NegativeContext = getInvalidContext();
1982-
PositiveContext = addNonEmptyDomainConstraints(PositiveContext);
1983-
// addNonEmptyDomainConstraints returns null if ScopStmts have a null domain
1984-
if (!PositiveContext)
1980+
if (Stmts.empty())
19851981
return false;
19861982

1987-
bool IsFeasible = !(PositiveContext.is_empty() ||
1988-
PositiveContext.is_subset(NegativeContext));
1989-
if (!IsFeasible)
1990-
return false;
1991-
1992-
auto DomainContext = getDomains().params();
1993-
IsFeasible = !DomainContext.is_subset(NegativeContext);
1994-
IsFeasible &= !getContext().is_subset(NegativeContext);
1995-
1996-
return IsFeasible;
1997-
}
1998-
1999-
isl::set Scop::addNonEmptyDomainConstraints(isl::set C) const {
2000-
isl::set DomainContext = getDomains().params();
2001-
return C.intersect_params(DomainContext);
1983+
isl::set PositiveContext = getAssumedContext();
1984+
isl::set NegativeContext = getInvalidContext();
1985+
PositiveContext = PositiveContext.intersect_params(Context);
1986+
PositiveContext = PositiveContext.intersect_params(getDomains().params());
1987+
return PositiveContext.is_empty().is_false() &&
1988+
PositiveContext.is_subset(NegativeContext).is_false();
20021989
}
20031990

20041991
MemoryAccess *Scop::lookupBasePtrAccess(MemoryAccess *MA) {

0 commit comments

Comments
 (0)