Improve accuracy of Scop::hasFeasibleRuntimeContext

If the AssumptionContext is a subset of the InvalidContext the runtime
  context is not feasible.

llvm-svn: 267285
This commit is contained in:
Johannes Doerfert 2016-04-23 13:00:27 +00:00
parent 1dc12aff8a
commit 94341c996d
1 changed files with 9 additions and 6 deletions

View File

@ -3477,13 +3477,16 @@ __isl_give isl_set *Scop::getAssumedContext() const {
bool Scop::hasFeasibleRuntimeContext() const {
auto *PositiveContext = getAssumedContext();
PositiveContext = addNonEmptyDomainConstraints(PositiveContext);
bool IsFeasible = !isl_set_is_empty(PositiveContext);
isl_set_free(PositiveContext);
if (!IsFeasible)
return false;
auto *NegativeContext = getInvalidContext();
PositiveContext = addNonEmptyDomainConstraints(PositiveContext);
bool IsFeasible = !(isl_set_is_empty(PositiveContext) ||
isl_set_is_subset(PositiveContext, NegativeContext));
isl_set_free(PositiveContext);
if (!IsFeasible) {
isl_set_free(NegativeContext);
return false;
}
auto *DomainContext = isl_union_set_params(getDomains());
IsFeasible = !isl_set_is_subset(DomainContext, NegativeContext);
IsFeasible &= !isl_set_is_subset(Context, NegativeContext);