From 14bd3ff782b5a868fcd9a234f58d241eeeea0543 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 18 Jan 2012 11:27:53 +0100 Subject: [PATCH] pet_scop_restrict: update context Signed-off-by: Sven Verdoolaege --- scop.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scop.c b/scop.c index cd6db10..e9ad878 100644 --- a/scop.c +++ b/scop.c @@ -1205,6 +1205,11 @@ error: } /* Add extra conditions on the parameters to all iteration domains. + * + * A parameter value is valid for the result if it was valid + * for the original scop and satisfies "cond" or if it does + * not satisfy "cond" as in this case the scop is not executed + * and the original constraints on the parameters are irrelevant. */ struct pet_scop *pet_scop_restrict(struct pet_scop *scop, __isl_take isl_set *cond) @@ -1214,6 +1219,13 @@ struct pet_scop *pet_scop_restrict(struct pet_scop *scop, if (!scop) goto error; + scop->context = isl_set_intersect(scop->context, isl_set_copy(cond)); + scop->context = isl_set_union(scop->context, + isl_set_complement(isl_set_copy(cond))); + scop->context = isl_set_coalesce(scop->context); + if (!scop->context) + goto error; + for (i = 0; i < scop->n_stmt; ++i) { scop->stmts[i] = stmt_restrict(scop->stmts[i], isl_set_copy(cond)); -- 2.11.4.GIT