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