From: Sven Verdoolaege Date: Tue, 29 Nov 2011 09:17:46 +0000 (+0100) Subject: isl_basic_map_involves_dims: double-check divs X-Git-Tag: isl-0.09~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cdcfca1606132efe02441a3b726a52cfa9841918;p=platform%2Fupstream%2Fisl.git isl_basic_map_involves_dims: double-check divs In principle, the extra test is not needed at this moment, but this may change in future. Signed-off-by: Sven Verdoolaege --- diff --git a/isl_map.c b/isl_map.c index 86b50d2..cbac878 100644 --- a/isl_map.c +++ b/isl_map.c @@ -1753,6 +1753,12 @@ __isl_give isl_set *isl_set_remove_divs_involving_dims(__isl_take isl_set *set, type, first, n); } +/* Does the desciption of "bmap" depend on the specified dimensions? + * We also check whether the dimensions appear in any of the div definitions. + * In principle there is no need for this check. If the dimensions appear + * in a div definition, they also appear in the defining constraints of that + * div. + */ int isl_basic_map_involves_dims(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned first, unsigned n) { @@ -1772,6 +1778,12 @@ int isl_basic_map_involves_dims(__isl_keep isl_basic_map *bmap, for (i = 0; i < bmap->n_ineq; ++i) if (isl_seq_first_non_zero(bmap->ineq[i] + first, n) >= 0) return 1; + for (i = 0; i < bmap->n_div; ++i) { + if (isl_int_is_zero(bmap->div[i][0])) + continue; + if (isl_seq_first_non_zero(bmap->div[i] + 1 + first, n) >= 0) + return 1; + } return 0; }