From dc75acb9b7a1c54e2db701f85915e503c416fde2 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 9 May 2014 15:52:22 +0200 Subject: [PATCH] isl_pw_*_gist: special case universe context Signed-off-by: Sven Verdoolaege --- isl_pw_templ.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/isl_pw_templ.c b/isl_pw_templ.c index 51310a9b..17eef5de 100644 --- a/isl_pw_templ.c +++ b/isl_pw_templ.c @@ -865,6 +865,13 @@ __isl_give PW *FN(PW,intersect_params)(__isl_take PW *pw, &FN(PW,intersect_params_aligned)); } +/* Compute the gist of "pw" with respect to the domain constraints + * of "context". Call "fn_el" to compute the gist of the elements + * and "fn_dom" to compute the gist of the domains. + * + * If the piecewise expression is empty or the context is the universe, + * then nothing can be simplified. + */ static __isl_give PW *FN(PW,gist_aligned)(__isl_take PW *pw, __isl_take isl_set *context, __isl_give EL *(*fn_el)(__isl_take EL *el, @@ -873,6 +880,7 @@ static __isl_give PW *FN(PW,gist_aligned)(__isl_take PW *pw, __isl_take isl_basic_set *bset)) { int i; + int is_universe; isl_basic_set *hull = NULL; if (!pw || !context) @@ -883,6 +891,14 @@ static __isl_give PW *FN(PW,gist_aligned)(__isl_take PW *pw, return pw; } + is_universe = isl_set_plain_is_universe(context); + if (is_universe < 0) + goto error; + if (is_universe) { + isl_set_free(context); + return pw; + } + if (!isl_space_match(pw->dim, isl_dim_param, context->dim, isl_dim_param)) { pw = FN(PW,align_params)(pw, isl_set_get_space(context)); -- 2.11.4.GIT