X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=isl_pw_templ.c;h=f254b0c32fd8f47a192eca6743f00f26734a71b2;hb=ff92580f1acb24424de00e9e33e3e5317e202e7a;hp=8e5d15f7b381d70647fcb1e11480cad74425fb0b;hpb=b14e553764d306ce2a4782c28cf03b0892fb1955;p=platform%2Fupstream%2Fisl.git diff --git a/isl_pw_templ.c b/isl_pw_templ.c index 8e5d15f..f254b0c 100644 --- a/isl_pw_templ.c +++ b/isl_pw_templ.c @@ -645,8 +645,14 @@ __isl_give isl_set *FN(PW,domain)(__isl_take PW *pw) return dom; } -static __isl_give PW *FN(PW,intersect_domain_aligned)(__isl_take PW *pw, - __isl_take isl_set *set) +/* Restrict the domain of "pw" by combining each cell + * with "set" through a call to "fn", where "fn" may be + * isl_set_intersect or isl_set_intersect_params. + */ +static __isl_give PW *FN(PW,intersect_aligned)(__isl_take PW *pw, + __isl_take isl_set *set, + __isl_give isl_set *(*fn)(__isl_take isl_set *set1, + __isl_take isl_set *set2)) { int i; @@ -664,7 +670,7 @@ static __isl_give PW *FN(PW,intersect_domain_aligned)(__isl_take PW *pw, for (i = pw->n - 1; i >= 0; --i) { isl_basic_set *aff; - pw->p[i].set = isl_set_intersect(pw->p[i].set, isl_set_copy(set)); + pw->p[i].set = fn(pw->p[i].set, isl_set_copy(set)); if (!pw->p[i].set) goto error; aff = isl_set_affine_hull(isl_set_copy(pw->p[i].set)); @@ -689,6 +695,12 @@ error: return NULL; } +static __isl_give PW *FN(PW,intersect_domain_aligned)(__isl_take PW *pw, + __isl_take isl_set *set) +{ + return FN(PW,intersect_aligned)(pw, set, &isl_set_intersect); +} + __isl_give PW *FN(PW,intersect_domain)(__isl_take PW *pw, __isl_take isl_set *context) { @@ -696,6 +708,21 @@ __isl_give PW *FN(PW,intersect_domain)(__isl_take PW *pw, &FN(PW,intersect_domain_aligned)); } +static __isl_give PW *FN(PW,intersect_params_aligned)(__isl_take PW *pw, + __isl_take isl_set *set) +{ + return FN(PW,intersect_aligned)(pw, set, &isl_set_intersect_params); +} + +/* Intersect the domain of "pw" with the parameter domain "context". + */ +__isl_give PW *FN(PW,intersect_params)(__isl_take PW *pw, + __isl_take isl_set *context) +{ + return FN(PW,align_params_pw_set_and)(pw, context, + &FN(PW,intersect_params_aligned)); +} + static __isl_give PW *FN(PW,gist_aligned)(__isl_take PW *pw, __isl_take isl_set *context) {