diff options
author | Tobias Grosser <tobias@grosser.es> | 2017-04-28 06:11:17 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2017-04-28 06:11:17 +0000 |
commit | 287942ae8278f81ee81ca248c88f5bf5f70f5147 (patch) | |
tree | c25a626db20acb232745bf9e54613ae2225ff0b5 | |
parent | 0589d9fa0fa27f9f5ffa78329697e8dc0ff34db9 (diff) | |
download | bcm5719-llvm-287942ae8278f81ee81ca248c88f5bf5f70f5147.tar.gz bcm5719-llvm-287942ae8278f81ee81ca248c88f5bf5f70f5147.zip |
Update to isl-0.18-592-gb50ad59
This is just a general maintenance update.
llvm-svn: 301624
28 files changed, 419 insertions, 331 deletions
diff --git a/polly/lib/External/isl/GIT_HEAD_ID b/polly/lib/External/isl/GIT_HEAD_ID index 0a13abe7615..71f27bd1d73 100644 --- a/polly/lib/External/isl/GIT_HEAD_ID +++ b/polly/lib/External/isl/GIT_HEAD_ID @@ -1 +1 @@ -isl-0.18-423-g30331fe +isl-0.18-592-gb50ad59 diff --git a/polly/lib/External/isl/basis_reduction_templ.c b/polly/lib/External/isl/basis_reduction_templ.c index 4ce2d789b54..a5da1e6dbb2 100644 --- a/polly/lib/External/isl/basis_reduction_templ.c +++ b/polly/lib/External/isl/basis_reduction_templ.c @@ -314,7 +314,7 @@ error: * basis with the equalities first. Otherwise, we start off with * the identity matrix. */ -struct isl_mat *isl_basic_set_reduced_basis(struct isl_basic_set *bset) +__isl_give isl_mat *isl_basic_set_reduced_basis(__isl_keep isl_basic_set *bset) { struct isl_mat *basis; struct isl_tab *tab; diff --git a/polly/lib/External/isl/doc/user.pod b/polly/lib/External/isl/doc/user.pod index 31689598fa5..8bd9e1e6f71 100644 --- a/polly/lib/External/isl/doc/user.pod +++ b/polly/lib/External/isl/doc/user.pod @@ -1492,7 +1492,8 @@ using the following functions. isl_bool isl_space_has_tuple_name( __isl_keep isl_space *space, enum isl_dim_type type); - const char *isl_space_get_tuple_name(__isl_keep isl_space *space, + __isl_keep const char *isl_space_get_tuple_name( + __isl_keep isl_space *space, enum isl_dim_type type); #include <isl/local_space.h> diff --git a/polly/lib/External/isl/include/isl/constraint.h b/polly/lib/External/isl/include/isl/constraint.h index 84cadeb1f6e..92fa029911f 100644 --- a/polly/lib/External/isl/include/isl/constraint.h +++ b/polly/lib/External/isl/include/isl/constraint.h @@ -121,8 +121,8 @@ isl_bool isl_constraint_is_upper_bound(__isl_keep isl_constraint *constraint, __isl_give isl_basic_map *isl_basic_map_from_constraint( __isl_take isl_constraint *constraint); -struct isl_basic_set *isl_basic_set_from_constraint( - struct isl_constraint *constraint); +__isl_give isl_basic_set *isl_basic_set_from_constraint( + __isl_take isl_constraint *constraint); __isl_give isl_aff *isl_constraint_get_bound( __isl_keep isl_constraint *constraint, enum isl_dim_type type, int pos); diff --git a/polly/lib/External/isl/include/isl/map.h b/polly/lib/External/isl/include/isl/map.h index 226db26a8c8..1e3e8bd55e8 100644 --- a/polly/lib/External/isl/include/isl/map.h +++ b/polly/lib/External/isl/include/isl/map.h @@ -50,16 +50,16 @@ ISL_DEPRECATED unsigned isl_basic_map_n_param(__isl_keep const isl_basic_map *bmap); ISL_DEPRECATED unsigned isl_basic_map_n_div(__isl_keep const isl_basic_map *bmap); -unsigned isl_basic_map_total_dim(const struct isl_basic_map *bmap); +unsigned isl_basic_map_total_dim(__isl_keep const isl_basic_map *bmap); unsigned isl_basic_map_dim(__isl_keep isl_basic_map *bmap, enum isl_dim_type type); ISL_DEPRECATED -unsigned isl_map_n_in(const struct isl_map *map); +unsigned isl_map_n_in(__isl_keep const isl_map *map); ISL_DEPRECATED -unsigned isl_map_n_out(const struct isl_map *map); +unsigned isl_map_n_out(__isl_keep const isl_map *map); ISL_DEPRECATED -unsigned isl_map_n_param(const struct isl_map *map); +unsigned isl_map_n_param(__isl_keep const isl_map *map); unsigned isl_map_dim(__isl_keep isl_map *map, enum isl_dim_type type); isl_ctx *isl_basic_map_get_ctx(__isl_keep isl_basic_map *bmap); @@ -227,9 +227,9 @@ __isl_give isl_basic_map *isl_basic_map_upper_bound_si( __isl_take isl_basic_map *bmap, enum isl_dim_type type, unsigned pos, int value); -struct isl_basic_map *isl_basic_map_sum( - struct isl_basic_map *bmap1, struct isl_basic_map *bmap2); -struct isl_basic_map *isl_basic_map_neg(struct isl_basic_map *bmap); +__isl_give isl_basic_map *isl_basic_map_sum(__isl_take isl_basic_map *bmap1, + __isl_take isl_basic_map *bmap2); +__isl_give isl_basic_map *isl_basic_map_neg(__isl_take isl_basic_map *bmap); __isl_give isl_map *isl_map_sum(__isl_take isl_map *map1, __isl_take isl_map *map2); diff --git a/polly/lib/External/isl/include/isl/mat.h b/polly/lib/External/isl/include/isl/mat.h index 4a8a6a21482..fc21fd2439f 100644 --- a/polly/lib/External/isl/include/isl/mat.h +++ b/polly/lib/External/isl/include/isl/mat.h @@ -44,25 +44,29 @@ __isl_give isl_mat *isl_mat_set_element_si(__isl_take isl_mat *mat, __isl_give isl_mat *isl_mat_set_element_val(__isl_take isl_mat *mat, int row, int col, __isl_take isl_val *v); -struct isl_mat *isl_mat_swap_cols(struct isl_mat *mat, unsigned i, unsigned j); -struct isl_mat *isl_mat_swap_rows(struct isl_mat *mat, unsigned i, unsigned j); - -struct isl_vec *isl_mat_vec_product(struct isl_mat *mat, struct isl_vec *vec); -struct isl_vec *isl_vec_mat_product(struct isl_vec *vec, struct isl_mat *mat); +__isl_give isl_mat *isl_mat_swap_cols(__isl_take isl_mat *mat, + unsigned i, unsigned j); +__isl_give isl_mat *isl_mat_swap_rows(__isl_take isl_mat *mat, + unsigned i, unsigned j); + +__isl_give isl_vec *isl_mat_vec_product(__isl_take isl_mat *mat, + __isl_take isl_vec *vec); +__isl_give isl_vec *isl_vec_mat_product(__isl_take isl_vec *vec, + __isl_take isl_mat *mat); __isl_give isl_vec *isl_mat_vec_inverse_product(__isl_take isl_mat *mat, __isl_take isl_vec *vec); -struct isl_mat *isl_mat_aff_direct_sum(struct isl_mat *left, - struct isl_mat *right); +__isl_give isl_mat *isl_mat_aff_direct_sum(__isl_take isl_mat *left, + __isl_take isl_mat *right); __isl_give isl_mat *isl_mat_diagonal(__isl_take isl_mat *mat1, __isl_take isl_mat *mat2); -struct isl_mat *isl_mat_left_hermite(struct isl_mat *M, - int neg, struct isl_mat **U, struct isl_mat **Q); -struct isl_mat *isl_mat_lin_to_aff(struct isl_mat *mat); -struct isl_mat *isl_mat_inverse_product(struct isl_mat *left, - struct isl_mat *right); +__isl_give isl_mat *isl_mat_left_hermite(__isl_take isl_mat *M, int neg, + __isl_give isl_mat **U, __isl_give isl_mat **Q); +__isl_give isl_mat *isl_mat_lin_to_aff(__isl_take isl_mat *mat); +__isl_give isl_mat *isl_mat_inverse_product(__isl_take isl_mat *left, + __isl_take isl_mat *right); __isl_give isl_mat *isl_mat_product(__isl_take isl_mat *left, __isl_take isl_mat *right); -struct isl_mat *isl_mat_transpose(struct isl_mat *mat); +__isl_give isl_mat *isl_mat_transpose(__isl_take isl_mat *mat); __isl_give isl_mat *isl_mat_right_inverse(__isl_take isl_mat *mat); __isl_give isl_mat *isl_mat_right_kernel(__isl_take isl_mat *mat); @@ -89,7 +93,7 @@ __isl_give isl_mat *isl_mat_add_zero_rows(__isl_take isl_mat *mat, unsigned n); void isl_mat_col_add(__isl_keep isl_mat *mat, int dst_col, int src_col); -struct isl_mat *isl_mat_unimodular_complete(struct isl_mat *M, int row); +__isl_give isl_mat *isl_mat_unimodular_complete(__isl_take isl_mat *M, int row); __isl_give isl_mat *isl_mat_from_row_vec(__isl_take isl_vec *vec); __isl_give isl_mat *isl_mat_concat(__isl_take isl_mat *top, diff --git a/polly/lib/External/isl/include/isl/set.h b/polly/lib/External/isl/include/isl/set.h index dcf17570ae7..c4e6e9b0be0 100644 --- a/polly/lib/External/isl/include/isl/set.h +++ b/polly/lib/External/isl/include/isl/set.h @@ -25,7 +25,7 @@ extern "C" { unsigned isl_basic_set_n_dim(__isl_keep isl_basic_set *bset); unsigned isl_basic_set_n_param(__isl_keep isl_basic_set *bset); -unsigned isl_basic_set_total_dim(const struct isl_basic_set *bset); +unsigned isl_basic_set_total_dim(__isl_keep const isl_basic_set *bset); unsigned isl_basic_set_dim(__isl_keep isl_basic_set *bset, enum isl_dim_type type); @@ -258,7 +258,7 @@ __isl_give isl_basic_set *isl_set_plain_unshifted_simple_hull( __isl_take isl_set *set); __isl_give isl_basic_set *isl_set_unshifted_simple_hull_from_set_list( __isl_take isl_set *set, __isl_take isl_set_list *list); -struct isl_basic_set *isl_set_bounded_simple_hull(struct isl_set *set); +__isl_give isl_basic_set *isl_set_bounded_simple_hull(__isl_take isl_set *set); struct isl_set *isl_set_union_disjoint( struct isl_set *set1, struct isl_set *set2); diff --git a/polly/lib/External/isl/include/isl/space.h b/polly/lib/External/isl/include/isl/space.h index c9529e4fbb5..ce25ff64d1f 100644 --- a/polly/lib/External/isl/include/isl/space.h +++ b/polly/lib/External/isl/include/isl/space.h @@ -48,7 +48,7 @@ __isl_give isl_space *isl_space_set_tuple_name(__isl_take isl_space *dim, enum isl_dim_type type, const char *s); isl_bool isl_space_has_tuple_name(__isl_keep isl_space *space, enum isl_dim_type type); -const char *isl_space_get_tuple_name(__isl_keep isl_space *dim, +__isl_keep const char *isl_space_get_tuple_name(__isl_keep isl_space *dim, enum isl_dim_type type); __isl_give isl_space *isl_space_set_tuple_id(__isl_take isl_space *dim, enum isl_dim_type type, __isl_take isl_id *id); @@ -108,7 +108,7 @@ __isl_give isl_space *isl_space_range_factor_domain( __isl_take isl_space *space); __isl_give isl_space *isl_space_range_factor_range( __isl_take isl_space *space); -__isl_give isl_space *isl_space_map_from_set(__isl_take isl_space *dim); +__isl_give isl_space *isl_space_map_from_set(__isl_take isl_space *space); __isl_give isl_space *isl_space_map_from_domain_and_range( __isl_take isl_space *domain, __isl_take isl_space *range); __isl_give isl_space *isl_space_reverse(__isl_take isl_space *dim); diff --git a/polly/lib/External/isl/isl_aff.c b/polly/lib/External/isl/isl_aff.c index 399bad9c675..e37c30867ce 100644 --- a/polly/lib/External/isl/isl_aff.c +++ b/polly/lib/External/isl/isl_aff.c @@ -7061,7 +7061,7 @@ __isl_give isl_map *isl_multi_pw_aff_eq_map(__isl_take isl_multi_pw_aff *mpa1, * pairwise equal. */ static __isl_give isl_map *isl_multi_pw_aff_lex_map_on_space( - __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2, + __isl_keep isl_multi_pw_aff *mpa1, __isl_keep isl_multi_pw_aff *mpa2, __isl_give isl_map *(*base)(__isl_take isl_pw_aff *pa1, __isl_take isl_pw_aff *pa2), __isl_take isl_space *space) @@ -7106,7 +7106,7 @@ static __isl_give isl_map *isl_multi_pw_aff_lex_map_on_space( * pairwise equal. */ __isl_give isl_map *isl_multi_pw_aff_lex_lt_map_on_space( - __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2, + __isl_keep isl_multi_pw_aff *mpa1, __isl_keep isl_multi_pw_aff *mpa2, __isl_take isl_space *space) { return isl_multi_pw_aff_lex_map_on_space(mpa1, mpa2, @@ -7134,7 +7134,7 @@ __isl_give isl_map *isl_multi_pw_aff_lex_lt_map( * pairwise equal. */ __isl_give isl_map *isl_multi_pw_aff_lex_gt_map_on_space( - __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2, + __isl_keep isl_multi_pw_aff *mpa1, __isl_keep isl_multi_pw_aff *mpa2, __isl_take isl_space *space) { return isl_multi_pw_aff_lex_map_on_space(mpa1, mpa2, diff --git a/polly/lib/External/isl/isl_affine_hull.c b/polly/lib/External/isl/isl_affine_hull.c index 999f680dcb5..a60a34c1487 100644 --- a/polly/lib/External/isl/isl_affine_hull.c +++ b/polly/lib/External/isl/isl_affine_hull.c @@ -29,8 +29,8 @@ #include <set_to_map.c> #include <set_from_map.c> -struct isl_basic_map *isl_basic_map_implicit_equalities( - struct isl_basic_map *bmap) +__isl_give isl_basic_map *isl_basic_map_implicit_equalities( + __isl_take isl_basic_map *bmap) { struct isl_tab *tab; @@ -297,7 +297,8 @@ error: return NULL; } -struct isl_basic_set *isl_basic_set_recession_cone(struct isl_basic_set *bset) +__isl_give isl_basic_set *isl_basic_set_recession_cone( + __isl_take isl_basic_set *bset) { int i; @@ -871,8 +872,8 @@ error: /* Detect and make explicit all equalities satisfied by the (integer) * points in bmap. */ -struct isl_basic_map *isl_basic_map_detect_equalities( - struct isl_basic_map *bmap) +__isl_give isl_basic_map *isl_basic_map_detect_equalities( + __isl_take isl_basic_map *bmap) { int i, j; struct isl_basic_set *hull = NULL; @@ -960,7 +961,8 @@ __isl_give isl_basic_set *isl_basic_set_plain_affine_hull( * equalities), we compute the additional equalities satisfied by * the integer points (if any) and add the original equalities back in. */ -struct isl_basic_map *isl_basic_map_affine_hull(struct isl_basic_map *bmap) +__isl_give isl_basic_map *isl_basic_map_affine_hull( + __isl_take isl_basic_map *bmap) { bmap = isl_basic_map_detect_equalities(bmap); bmap = isl_basic_map_plain_affine_hull(bmap); diff --git a/polly/lib/External/isl/isl_coalesce.c b/polly/lib/External/isl/isl_coalesce.c index 24b1812353f..c2dc3131f56 100644 --- a/polly/lib/External/isl/isl_coalesce.c +++ b/polly/lib/External/isl/isl_coalesce.c @@ -3746,7 +3746,7 @@ static __isl_give isl_map *update_basic_maps(__isl_take isl_map *map, * For each basic map, we also compute the hash of the apparent affine hull * for use in coalesce. */ -struct isl_map *isl_map_coalesce(struct isl_map *map) +__isl_give isl_map *isl_map_coalesce(__isl_take isl_map *map) { int i; unsigned n; diff --git a/polly/lib/External/isl/isl_constraint.c b/polly/lib/External/isl/isl_constraint.c index 89db4a1fe8c..92a6bb89a3a 100644 --- a/polly/lib/External/isl/isl_constraint.c +++ b/polly/lib/External/isl/isl_constraint.c @@ -762,8 +762,8 @@ error: return NULL; } -struct isl_basic_set *isl_basic_set_from_constraint( - struct isl_constraint *constraint) +__isl_give isl_basic_set *isl_basic_set_from_constraint( + __isl_take isl_constraint *constraint) { if (!constraint) return NULL; diff --git a/polly/lib/External/isl/isl_convex_hull.c b/polly/lib/External/isl/isl_convex_hull.c index 431183f20d3..dadbc697936 100644 --- a/polly/lib/External/isl/isl_convex_hull.c +++ b/polly/lib/External/isl/isl_convex_hull.c @@ -27,7 +27,8 @@ #include <bset_from_bmap.c> #include <set_to_map.c> -static struct isl_basic_set *uset_convex_hull_wrap_bounded(struct isl_set *set); +static __isl_give isl_basic_set *uset_convex_hull_wrap_bounded( + __isl_take isl_set *set); /* Remove redundant * constraints. If the minimal value along the normal of a constraint @@ -112,7 +113,7 @@ __isl_give isl_set *isl_set_remove_redundancies(__isl_take isl_set *set) * constraint c and if so, set the constant term such that the * resulting constraint is a bounding constraint for the set. */ -static int uset_is_bound(struct isl_set *set, isl_int *c, unsigned len) +static int uset_is_bound(__isl_keep isl_set *set, isl_int *c, unsigned len) { int first; int j; @@ -183,7 +184,8 @@ error: return NULL; } -static struct isl_set *isl_set_add_basic_set_equality(struct isl_set *set, isl_int *c) +static __isl_give isl_set *isl_set_add_basic_set_equality( + __isl_take isl_set *set, isl_int *c) { int i; @@ -218,7 +220,7 @@ error: * * \sum_i x_{i,1} = 1 */ -static struct isl_basic_set *wrap_constraints(struct isl_set *set) +static __isl_give isl_basic_set *wrap_constraints(__isl_keep isl_set *set) { struct isl_basic_set *lp; unsigned n_eq; @@ -498,7 +500,8 @@ error: * After computing the facets of the facet in the z' space, * we convert them back to the x space through Q. */ -static struct isl_basic_set *compute_facet(struct isl_set *set, isl_int *c) +static __isl_give isl_basic_set *compute_facet(__isl_keep isl_set *set, + isl_int *c) { struct isl_mat *m, *U, *Q; struct isl_basic_set *facet = NULL; @@ -552,8 +555,8 @@ error: * using the technique in section "3.1 Ridge Generation" of * "Extended Convex Hull" by Fukuda et al. */ -static struct isl_basic_set *extend(struct isl_basic_set *hull, - struct isl_set *set) +static __isl_give isl_basic_set *extend(__isl_take isl_basic_set *hull, + __isl_keep isl_set *set) { int i, j, f; int k; @@ -615,7 +618,7 @@ error: * We simply collect the lower and upper bounds of each basic set * and the biggest of those. */ -static struct isl_basic_set *convex_hull_1d(struct isl_set *set) +static __isl_give isl_basic_set *convex_hull_1d(__isl_take isl_set *set) { struct isl_mat *c = NULL; isl_int *lower = NULL; @@ -735,7 +738,7 @@ error: return NULL; } -static struct isl_basic_set *convex_hull_0d(struct isl_set *set) +static __isl_give isl_basic_set *convex_hull_0d(__isl_take isl_set *set) { struct isl_basic_set *convex_hull; @@ -759,8 +762,8 @@ static struct isl_basic_set *convex_hull_0d(struct isl_set *set) * to the two original basic sets, retaining only those corresponding * to the convex hull. */ -static struct isl_basic_set *convex_hull_pair_elim(struct isl_basic_set *bset1, - struct isl_basic_set *bset2) +static __isl_give isl_basic_set *convex_hull_pair_elim( + __isl_take isl_basic_set *bset1, __isl_take isl_basic_set *bset2) { int i, j, k; struct isl_basic_set *bset[2]; @@ -883,8 +886,8 @@ isl_bool isl_set_is_bounded(__isl_keep isl_set *set) * with the negative of the recession cone of bset2 and then compute * the linear hull of the resulting cone. */ -static struct isl_basic_set *induced_lineality_space( - struct isl_basic_set *bset1, struct isl_basic_set *bset2) +static __isl_give isl_basic_set *induced_lineality_space( + __isl_take isl_basic_set *bset1, __isl_take isl_basic_set *bset2) { int i, k; struct isl_basic_set *lin = NULL; @@ -939,7 +942,7 @@ error: return NULL; } -static struct isl_basic_set *uset_convex_hull(struct isl_set *set); +static __isl_give isl_basic_set *uset_convex_hull(__isl_take isl_set *set); /* Given a set and a linear space "lin" of dimension n > 0, * project the linear space from the set, compute the convex hull @@ -961,8 +964,8 @@ static struct isl_basic_set *uset_convex_hull(struct isl_set *set); * we transform the hull back to the original space as A' Q_1 x >= b', * with Q_1 all but the last n rows of Q. */ -static struct isl_basic_set *modulo_lineality(struct isl_set *set, - struct isl_basic_set *lin) +static __isl_give isl_basic_set *modulo_lineality(__isl_take isl_set *set, + __isl_take isl_basic_set *lin) { unsigned total = isl_basic_set_total_dim(lin); unsigned lin_dim; @@ -1005,8 +1008,8 @@ error: * The next \alpha{ij} correspond to the equalities and come in pairs. * The final \alpha{ij} correspond to the inequalities. */ -static struct isl_basic_set *valid_direction_lp( - struct isl_basic_set *bset1, struct isl_basic_set *bset2) +static __isl_give isl_basic_set *valid_direction_lp( + __isl_take isl_basic_set *bset1, __isl_take isl_basic_set *bset2) { isl_space *dim; struct isl_basic_set *lp; @@ -1086,8 +1089,8 @@ error: * Note that we simply pick any valid direction and make no attempt * to pick a "good" or even the "best" valid direction. */ -static struct isl_vec *valid_direction( - struct isl_basic_set *bset1, struct isl_basic_set *bset2) +static __isl_give isl_vec *valid_direction( + __isl_take isl_basic_set *bset1, __isl_take isl_basic_set *bset2) { struct isl_basic_set *lp; struct isl_tab *tab; @@ -1149,8 +1152,8 @@ error: * In particular, add the "positivity constraint" and then perform * the mapping. */ -static struct isl_basic_set *homogeneous_map(struct isl_basic_set *bset, - struct isl_mat *T) +static __isl_give isl_basic_set *homogeneous_map(__isl_take isl_basic_set *bset, + __isl_take isl_mat *T) { int k; @@ -1229,8 +1232,8 @@ error: * * The polyhedron b + A x >= 0 is then the convex hull of the input polyhedra. */ -static struct isl_basic_set *convex_hull_pair_pointed( - struct isl_basic_set *bset1, struct isl_basic_set *bset2) +static __isl_give isl_basic_set *convex_hull_pair_pointed( + __isl_take isl_basic_set *bset1, __isl_take isl_basic_set *bset2) { struct isl_ctx *ctx = NULL; struct isl_vec *dir = NULL; @@ -1271,9 +1274,9 @@ error: return NULL; } -static struct isl_basic_set *uset_convex_hull_wrap(struct isl_set *set); -static struct isl_basic_set *modulo_affine_hull( - struct isl_set *set, struct isl_basic_set *affine_hull); +static __isl_give isl_basic_set *uset_convex_hull_wrap(__isl_take isl_set *set); +static __isl_give isl_basic_set *modulo_affine_hull( + __isl_take isl_set *set, __isl_take isl_basic_set *affine_hull); /* Compute the convex hull of a pair of basic sets without any parameters or * integer divisions. @@ -1288,8 +1291,8 @@ static struct isl_basic_set *modulo_affine_hull( * If the convex hull of the two basic sets would have a non-trivial * lineality space, we first project out this lineality space. */ -static struct isl_basic_set *convex_hull_pair(struct isl_basic_set *bset1, - struct isl_basic_set *bset2) +static __isl_give isl_basic_set *convex_hull_pair( + __isl_take isl_basic_set *bset1, __isl_take isl_basic_set *bset2) { isl_basic_set *lin, *aff; int bounded1, bounded2; @@ -1347,7 +1350,8 @@ error: * We basically just drop the constants and turn every inequality * into an equality. */ -struct isl_basic_set *isl_basic_set_lineality_space(struct isl_basic_set *bset) +__isl_give isl_basic_set *isl_basic_set_lineality_space( + __isl_take isl_basic_set *bset) { int i, k; struct isl_basic_set *lin = NULL; @@ -1392,7 +1396,8 @@ error: /* Compute the (linear) hull of the lineality spaces of the basic sets in the * "underlying" set "set". */ -static struct isl_basic_set *uset_combined_lineality_space(struct isl_set *set) +static __isl_give isl_basic_set *uset_combined_lineality_space( + __isl_take isl_set *set) { int i; struct isl_set *lin = NULL; @@ -1400,9 +1405,9 @@ static struct isl_basic_set *uset_combined_lineality_space(struct isl_set *set) if (!set) return NULL; if (set->n == 0) { - isl_space *dim = isl_set_get_space(set); + isl_space *space = isl_set_get_space(set); isl_set_free(set); - return isl_basic_set_empty(dim); + return isl_basic_set_empty(space); } lin = isl_set_alloc_space(isl_set_get_space(set), set->n, 0); @@ -1475,8 +1480,8 @@ error: * facet. * This function assumes that the given set is bounded. */ -static struct isl_basic_set *initial_hull(struct isl_basic_set *hull, - struct isl_set *set) +static __isl_give isl_basic_set *initial_hull(__isl_take isl_basic_set *hull, + __isl_keep isl_set *set) { struct isl_mat *bounds = NULL; unsigned dim; @@ -1577,8 +1582,8 @@ static int has_constraint(struct isl_ctx *ctx, struct isl_hash_table *table, * all other basic sets and is therefore the convex hull of set. * In this case we set *is_hull to 1. */ -static struct isl_basic_set *common_constraints(struct isl_basic_set *hull, - struct isl_set *set, int *is_hull) +static __isl_give isl_basic_set *common_constraints( + __isl_take isl_basic_set *hull, __isl_keep isl_set *set, int *is_hull) { int i, j, s, n; int min_constraints; @@ -1698,7 +1703,8 @@ error: * obvious facet constraints, if any. If the result happens to * be the convex hull of "set" then *is_hull is set to 1. */ -static struct isl_basic_set *proto_hull(struct isl_set *set, int *is_hull) +static __isl_give isl_basic_set *proto_hull(__isl_keep isl_set *set, + int *is_hull) { struct isl_basic_set *hull; unsigned n_ineq; @@ -1716,7 +1722,7 @@ static struct isl_basic_set *proto_hull(struct isl_set *set, int *is_hull) return common_constraints(hull, set, is_hull); } -static struct isl_basic_set *uset_convex_hull_wrap(struct isl_set *set) +static __isl_give isl_basic_set *uset_convex_hull_wrap(__isl_take isl_set *set) { struct isl_basic_set *hull; int is_hull; @@ -1738,7 +1744,7 @@ static struct isl_basic_set *uset_convex_hull_wrap(struct isl_set *set) * the Fourier-Motzkin elimination based convex hull. * We also handle a few special cases before checking the boundedness. */ -static struct isl_basic_set *uset_convex_hull(struct isl_set *set) +static __isl_give isl_basic_set *uset_convex_hull(__isl_take isl_set *set) { isl_bool bounded; struct isl_basic_set *convex_hull = NULL; @@ -1788,7 +1794,8 @@ error: * without parameters or divs and where the convex hull of set is * known to be full-dimensional. */ -static struct isl_basic_set *uset_convex_hull_wrap_bounded(struct isl_set *set) +static __isl_give isl_basic_set *uset_convex_hull_wrap_bounded( + __isl_take isl_set *set) { struct isl_basic_set *convex_hull = NULL; @@ -1826,8 +1833,8 @@ error: * convex hull of the transformed set and then add the equalities back * (after performing the inverse transformation. */ -static struct isl_basic_set *modulo_affine_hull( - struct isl_set *set, struct isl_basic_set *affine_hull) +static __isl_give isl_basic_set *modulo_affine_hull( + __isl_take isl_set *set, __isl_take isl_basic_set *affine_hull) { struct isl_mat *T; struct isl_mat *T2; @@ -1867,7 +1874,7 @@ static __isl_give isl_basic_map *replace_map_by_empty_basic_map( * The implementation was inspired by "Extended Convex Hull" by Fukuda et al., * specifically, the wrapping of facets to obtain new facets. */ -struct isl_basic_map *isl_map_convex_hull(struct isl_map *map) +__isl_give isl_basic_map *isl_map_convex_hull(__isl_take isl_map *map) { struct isl_basic_set *bset; struct isl_basic_map *model = NULL; @@ -2001,7 +2008,7 @@ static int hash_ineq(struct isl_ctx *ctx, struct isl_hash_table *table, * The value in the hash table is a pointer to the (in)equality of "bset". */ static int hash_basic_set(struct isl_hash_table *table, - struct isl_basic_set *bset) + __isl_keep isl_basic_set *bset) { int i, j; unsigned dim = isl_basic_set_total_dim(bset); @@ -2020,7 +2027,7 @@ static int hash_basic_set(struct isl_hash_table *table, return 0; } -static struct sh_data *sh_data_alloc(struct isl_set *set, unsigned n_ineq) +static struct sh_data *sh_data_alloc(__isl_keep isl_set *set, unsigned n_ineq) { struct sh_data *data; int i; @@ -2059,7 +2066,7 @@ error: * 0 if "ineq" may attain arbitrarily small values on basic set "j" * -1 if some error occurred */ -static int is_bound(struct sh_data *data, struct isl_set *set, int j, +static int is_bound(struct sh_data *data, __isl_keep isl_set *set, int j, isl_int *ineq, int shift) { enum isl_lp_result res; @@ -2150,8 +2157,8 @@ static void set_max_constant_term(struct sh_data *data, __isl_keep isl_set *set, * translate and the inequality is therefore known to be a bound * of this basic set. */ -static struct isl_basic_set *add_bound(struct isl_basic_set *hull, - struct sh_data *data, struct isl_set *set, int i, isl_int *ineq, +static __isl_give isl_basic_set *add_bound(__isl_take isl_basic_set *hull, + struct sh_data *data, __isl_keep isl_set *set, int i, isl_int *ineq, int shift) { uint32_t c_hash; @@ -2232,8 +2239,8 @@ error: * become a bound on the whole set. If so, add the (relaxed) inequality * to "hull". Relaxation is only allowed if "shift" is set. */ -static struct isl_basic_set *add_bounds(struct isl_basic_set *bset, - struct sh_data *data, struct isl_set *set, int i, int shift) +static __isl_give isl_basic_set *add_bounds(__isl_take isl_basic_set *bset, + struct sh_data *data, __isl_keep isl_set *set, int i, int shift) { int j, k; unsigned dim = isl_basic_set_total_dim(bset); @@ -2981,7 +2988,7 @@ static struct isl_basic_set *set_bounds(struct isl_set *set, int dim) * resulting hull is bounded by a symbolic constant. If not, the * hull is intersected with the corresponding bounds on the whole set. */ -struct isl_basic_set *isl_set_bounded_simple_hull(struct isl_set *set) +__isl_give isl_basic_set *isl_set_bounded_simple_hull(__isl_take isl_set *set) { int i, j; struct isl_basic_set *hull; diff --git a/polly/lib/External/isl/isl_equalities.c b/polly/lib/External/isl/isl_equalities.c index 80c1ff7c9ca..0501cd9faaf 100644 --- a/polly/lib/External/isl/isl_equalities.c +++ b/polly/lib/External/isl/isl_equalities.c @@ -305,8 +305,8 @@ error: * as any y = y_0 + G y' with y' integer is a solution to the original * modulo constraints. */ -struct isl_mat *isl_mat_parameter_compression( - struct isl_mat *B, struct isl_vec *d) +__isl_give isl_mat *isl_mat_parameter_compression(__isl_take isl_mat *B, + __isl_take isl_vec *d) { int i; struct isl_mat *cst = NULL; diff --git a/polly/lib/External/isl/isl_equalities.h b/polly/lib/External/isl/isl_equalities.h index a64d1234810..0de83477b5e 100644 --- a/polly/lib/External/isl/isl_equalities.h +++ b/polly/lib/External/isl/isl_equalities.h @@ -21,8 +21,8 @@ __isl_give isl_mat *isl_mat_final_variable_compression(__isl_take isl_mat *B, int first, __isl_give isl_mat **T2); __isl_give isl_mat *isl_mat_variable_compression(__isl_take isl_mat *B, __isl_give isl_mat **T2); -struct isl_mat *isl_mat_parameter_compression( - struct isl_mat *B, struct isl_vec *d); +__isl_give isl_mat *isl_mat_parameter_compression(__isl_take isl_mat *B, + __isl_take isl_vec *d); __isl_give isl_mat *isl_mat_parameter_compression_ext(__isl_take isl_mat *B, __isl_take isl_mat *A); struct isl_basic_set *isl_basic_set_remove_equalities( diff --git a/polly/lib/External/isl/isl_ilp.c b/polly/lib/External/isl/isl_ilp.c index 68a1161adb6..eee294ea07f 100644 --- a/polly/lib/External/isl/isl_ilp.c +++ b/polly/lib/External/isl/isl_ilp.c @@ -32,7 +32,8 @@ * term. This ensures that if x satisfies the resulting constraints, * then x plus any sum of unit vectors satisfies the original constraints. */ -static struct isl_basic_set *unit_box_base_points(struct isl_basic_set *bset) +static __isl_give isl_basic_set *unit_box_base_points( + __isl_take isl_basic_set *bset) { int i, j, k; struct isl_basic_set *unit_box = NULL; @@ -80,7 +81,8 @@ error: * and round it up to the nearest integer. * If not, we simply pick any integer point in "bset". */ -static struct isl_vec *initial_solution(struct isl_basic_set *bset, isl_int *f) +static __isl_give isl_vec *initial_solution(__isl_keep isl_basic_set *bset, + isl_int *f) { enum isl_lp_result res; struct isl_basic_set *unit_box; @@ -102,7 +104,7 @@ static struct isl_vec *initial_solution(struct isl_basic_set *bset, isl_int *f) /* Restrict "bset" to those points with values for f in the interval [l, u]. */ -static struct isl_basic_set *add_bounds(struct isl_basic_set *bset, +static __isl_give isl_basic_set *add_bounds(__isl_take isl_basic_set *bset, isl_int *f, isl_int l, isl_int u) { int k; @@ -145,8 +147,8 @@ error: * If no point can be found, we update l to the upper bound of the interval * we checked (u or l+floor(u-l-1/2)) plus 1. */ -static struct isl_vec *solve_ilp_search(struct isl_basic_set *bset, - isl_int *f, isl_int *opt, struct isl_vec *sol, isl_int l, isl_int u) +static __isl_give isl_vec *solve_ilp_search(__isl_keep isl_basic_set *bset, + isl_int *f, isl_int *opt, __isl_take isl_vec *sol, isl_int l, isl_int u) { isl_int tmp; int divide = 1; @@ -204,9 +206,8 @@ static struct isl_vec *solve_ilp_search(struct isl_basic_set *bset, * * We then call solve_ilp_search to perform a binary search on the interval. */ -static enum isl_lp_result solve_ilp(struct isl_basic_set *bset, - isl_int *f, isl_int *opt, - struct isl_vec **sol_p) +static enum isl_lp_result solve_ilp(__isl_keep isl_basic_set *bset, + isl_int *f, isl_int *opt, __isl_give isl_vec **sol_p) { enum isl_lp_result res; isl_int l, u; @@ -260,9 +261,8 @@ static enum isl_lp_result solve_ilp(struct isl_basic_set *bset, return res; } -static enum isl_lp_result solve_ilp_with_eq(struct isl_basic_set *bset, int max, - isl_int *f, isl_int *opt, - struct isl_vec **sol_p) +static enum isl_lp_result solve_ilp_with_eq(__isl_keep isl_basic_set *bset, + int max, isl_int *f, isl_int *opt, __isl_give isl_vec **sol_p) { unsigned dim; enum isl_lp_result res; @@ -303,9 +303,8 @@ error: * If there is any equality among the points in "bset", then we first * project it out. Otherwise, we continue with solve_ilp above. */ -enum isl_lp_result isl_basic_set_solve_ilp(struct isl_basic_set *bset, int max, - isl_int *f, isl_int *opt, - struct isl_vec **sol_p) +enum isl_lp_result isl_basic_set_solve_ilp(__isl_keep isl_basic_set *bset, + int max, isl_int *f, isl_int *opt, __isl_give isl_vec **sol_p) { unsigned dim; enum isl_lp_result res; diff --git a/polly/lib/External/isl/isl_lp.c b/polly/lib/External/isl/isl_lp.c index dbd9a59df34..0c2f5ff812b 100644 --- a/polly/lib/External/isl/isl_lp.c +++ b/polly/lib/External/isl/isl_lp.c @@ -22,10 +22,9 @@ #include <bset_to_bmap.c> #include <set_to_map.c> -enum isl_lp_result isl_tab_solve_lp(struct isl_basic_map *bmap, int maximize, - isl_int *f, isl_int denom, isl_int *opt, - isl_int *opt_denom, - struct isl_vec **sol) +enum isl_lp_result isl_tab_solve_lp(__isl_keep isl_basic_map *bmap, + int maximize, isl_int *f, isl_int denom, isl_int *opt, + isl_int *opt_denom, __isl_give isl_vec **sol) { struct isl_tab *tab; enum isl_lp_result res; @@ -62,10 +61,9 @@ enum isl_lp_result isl_tab_solve_lp(struct isl_basic_map *bmap, int maximize, * The return value reflects the nature of the result (empty, unbounded, * minimal or maximal value returned in *opt). */ -enum isl_lp_result isl_basic_map_solve_lp(struct isl_basic_map *bmap, int max, - isl_int *f, isl_int d, isl_int *opt, - isl_int *opt_denom, - struct isl_vec **sol) +enum isl_lp_result isl_basic_map_solve_lp(__isl_keep isl_basic_map *bmap, + int max, isl_int *f, isl_int d, isl_int *opt, isl_int *opt_denom, + __isl_give isl_vec **sol) { if (sol) *sol = NULL; diff --git a/polly/lib/External/isl/isl_map.c b/polly/lib/External/isl/isl_map.c index da506ef46f8..68ecd963816 100644 --- a/polly/lib/External/isl/isl_map.c +++ b/polly/lib/External/isl/isl_map.c @@ -125,13 +125,13 @@ unsigned isl_basic_map_offset(struct isl_basic_map *bmap, } } -unsigned isl_basic_set_offset(struct isl_basic_set *bset, +unsigned isl_basic_set_offset(__isl_keep isl_basic_set *bset, enum isl_dim_type type) { return isl_basic_map_offset(bset, type); } -static unsigned map_offset(struct isl_map *map, enum isl_dim_type type) +static unsigned map_offset(__isl_keep isl_map *map, enum isl_dim_type type) { return pos(map->dim, type); } @@ -152,7 +152,7 @@ unsigned isl_basic_set_n_param(__isl_keep isl_basic_set *bset) return isl_basic_set_dim(bset, isl_dim_param); } -unsigned isl_basic_set_total_dim(const struct isl_basic_set *bset) +unsigned isl_basic_set_total_dim(__isl_keep const isl_basic_set *bset) { if (!bset) return 0; @@ -189,22 +189,22 @@ unsigned isl_basic_map_n_div(__isl_keep const isl_basic_map *bmap) return bmap ? bmap->n_div : 0; } -unsigned isl_basic_map_total_dim(const struct isl_basic_map *bmap) +unsigned isl_basic_map_total_dim(__isl_keep const isl_basic_map *bmap) { return bmap ? isl_space_dim(bmap->dim, isl_dim_all) + bmap->n_div : 0; } -unsigned isl_map_n_in(const struct isl_map *map) +unsigned isl_map_n_in(__isl_keep const isl_map *map) { return map ? map->dim->n_in : 0; } -unsigned isl_map_n_out(const struct isl_map *map) +unsigned isl_map_n_out(__isl_keep const isl_map *map) { return map ? map->dim->n_out : 0; } -unsigned isl_map_n_param(const struct isl_map *map) +unsigned isl_map_n_param(__isl_keep const isl_map *map) { return map ? map->dim->nparam : 0; } @@ -1207,7 +1207,7 @@ static void dup_constraints( ISL_F_SET(dst, ISL_BASIC_SET_FINAL); } -struct isl_basic_map *isl_basic_map_dup(struct isl_basic_map *bmap) +__isl_give isl_basic_map *isl_basic_map_dup(__isl_keep isl_basic_map *bmap) { struct isl_basic_map *dup; @@ -1231,7 +1231,7 @@ struct isl_basic_set *isl_basic_set_dup(struct isl_basic_set *bset) return bset_from_bmap(dup); } -struct isl_basic_set *isl_basic_set_copy(struct isl_basic_set *bset) +__isl_give isl_basic_set *isl_basic_set_copy(__isl_keep isl_basic_set *bset) { if (!bset) return NULL; @@ -1243,7 +1243,7 @@ struct isl_basic_set *isl_basic_set_copy(struct isl_basic_set *bset) return isl_basic_set_dup(bset); } -struct isl_set *isl_set_copy(struct isl_set *set) +__isl_give isl_set *isl_set_copy(__isl_keep isl_set *set) { if (!set) return NULL; @@ -1252,7 +1252,7 @@ struct isl_set *isl_set_copy(struct isl_set *set) return set; } -struct isl_basic_map *isl_basic_map_copy(struct isl_basic_map *bmap) +__isl_give isl_basic_map *isl_basic_map_copy(__isl_keep isl_basic_map *bmap) { if (!bmap) return NULL; @@ -1267,7 +1267,7 @@ struct isl_basic_map *isl_basic_map_copy(struct isl_basic_map *bmap) return bmap; } -struct isl_map *isl_map_copy(struct isl_map *map) +__isl_give isl_map *isl_map_copy(__isl_keep isl_map *map) { if (!map) return NULL; @@ -1475,7 +1475,7 @@ static int room_for_ineq(struct isl_basic_map *bmap, unsigned n) return bmap->n_ineq + n <= bmap->eq - bmap->ineq; } -int isl_basic_map_alloc_inequality(struct isl_basic_map *bmap) +int isl_basic_map_alloc_inequality(__isl_keep isl_basic_map *bmap) { struct isl_ctx *ctx; if (!bmap) @@ -1492,7 +1492,7 @@ int isl_basic_map_alloc_inequality(struct isl_basic_map *bmap) return bmap->n_ineq++; } -int isl_basic_set_alloc_inequality(struct isl_basic_set *bset) +int isl_basic_set_alloc_inequality(__isl_keep isl_basic_set *bset) { return isl_basic_map_alloc_inequality(bset_to_bmap(bset)); } @@ -1712,8 +1712,9 @@ static void copy_div(struct isl_basic_map *dst_map, isl_int *dst, copy_constraint(dst_map, dst+1, src_map, src+1, in_off, out_off, div_off); } -static struct isl_basic_map *add_constraints(struct isl_basic_map *bmap1, - struct isl_basic_map *bmap2, unsigned i_pos, unsigned o_pos) +static __isl_give isl_basic_map *add_constraints( + __isl_take isl_basic_map *bmap1, __isl_take isl_basic_map *bmap2, + unsigned i_pos, unsigned o_pos) { int i; unsigned div_off; @@ -1764,9 +1765,9 @@ struct isl_basic_set *isl_basic_set_add_constraints(struct isl_basic_set *bset1, bset_to_bmap(bset2), 0, pos)); } -struct isl_basic_map *isl_basic_map_extend_space(struct isl_basic_map *base, - __isl_take isl_space *dim, unsigned extra, - unsigned n_eq, unsigned n_ineq) +__isl_give isl_basic_map *isl_basic_map_extend_space( + __isl_take isl_basic_map *base, __isl_take isl_space *dim, + unsigned extra, unsigned n_eq, unsigned n_ineq) { struct isl_basic_map *ext; unsigned flags; @@ -1869,12 +1870,12 @@ struct isl_basic_set *isl_basic_set_extend_constraints( return bset_from_bmap(bmap); } -struct isl_basic_set *isl_basic_set_cow(struct isl_basic_set *bset) +__isl_give isl_basic_set *isl_basic_set_cow(__isl_take isl_basic_set *bset) { return bset_from_bmap(isl_basic_map_cow(bset_to_bmap(bset))); } -struct isl_basic_map *isl_basic_map_cow(struct isl_basic_map *bmap) +__isl_give isl_basic_map *isl_basic_map_cow(__isl_take isl_basic_map *bmap) { if (!bmap) return NULL; @@ -1904,7 +1905,7 @@ static __isl_give isl_map *clear_caches(__isl_take isl_map *map) return map; } -struct isl_set *isl_set_cow(struct isl_set *set) +__isl_give isl_set *isl_set_cow(__isl_take isl_set *set) { return isl_map_cow(set); } @@ -1919,7 +1920,7 @@ struct isl_set *isl_set_cow(struct isl_set *set) * * Otherwise, create a duplicate (without any cached information). */ -struct isl_map *isl_map_cow(struct isl_map *map) +__isl_give isl_map *isl_map_cow(__isl_take isl_map *map) { if (!map) return NULL; @@ -1983,7 +1984,8 @@ error: return NULL; } -struct isl_basic_map *isl_basic_map_set_to_empty(struct isl_basic_map *bmap) +__isl_give isl_basic_map *isl_basic_map_set_to_empty( + __isl_take isl_basic_map *bmap) { int i = 0; unsigned total; @@ -2173,7 +2175,7 @@ error: * the div array too as the number of rows in this array is assumed * to be equal to extra. */ -struct isl_basic_map *isl_basic_map_drop(struct isl_basic_map *bmap, +__isl_give isl_basic_map *isl_basic_map_drop(__isl_take isl_basic_map *bmap, enum isl_dim_type type, unsigned first, unsigned n) { int i; @@ -2231,7 +2233,7 @@ __isl_give isl_basic_set *isl_basic_set_drop(__isl_take isl_basic_set *bset, type, first, n)); } -struct isl_map *isl_map_drop(struct isl_map *map, +__isl_give isl_map *isl_map_drop(__isl_take isl_map *map, enum isl_dim_type type, unsigned first, unsigned n) { int i; @@ -2263,7 +2265,7 @@ error: return NULL; } -struct isl_set *isl_set_drop(struct isl_set *set, +__isl_give isl_set *isl_set_drop(__isl_take isl_set *set, enum isl_dim_type type, unsigned first, unsigned n) { return set_from_map(isl_map_drop(set_to_map(set), type, first, n)); @@ -2420,8 +2422,9 @@ __isl_give isl_set *isl_set_remove_divs(__isl_take isl_set *set) return isl_map_remove_divs(set); } -struct isl_basic_map *isl_basic_map_remove_dims(struct isl_basic_map *bmap, - enum isl_dim_type type, unsigned first, unsigned n) +__isl_give isl_basic_map *isl_basic_map_remove_dims( + __isl_take isl_basic_map *bmap, enum isl_dim_type type, + unsigned first, unsigned n) { if (isl_basic_map_check_range(bmap, type, first, n) < 0) return isl_basic_map_free(bmap); @@ -3094,7 +3097,7 @@ __isl_give isl_basic_set *isl_basic_set_remove_dims( return bset_from_bmap(bmap); } -struct isl_map *isl_map_remove_dims(struct isl_map *map, +__isl_give isl_map *isl_map_remove_dims(__isl_take isl_map *map, enum isl_dim_type type, unsigned first, unsigned n) { int i; @@ -3311,7 +3314,7 @@ error: /* Make sure "map" has room for at least "n" more basic maps. */ -struct isl_map *isl_map_grow(struct isl_map *map, int n) +__isl_give isl_map *isl_map_grow(__isl_take isl_map *map, int n) { int i; struct isl_map *grown = NULL; @@ -3345,12 +3348,12 @@ struct isl_set *isl_set_grow(struct isl_set *set, int n) return set_from_map(isl_map_grow(set_to_map(set), n)); } -struct isl_set *isl_set_from_basic_set(struct isl_basic_set *bset) +__isl_give isl_set *isl_set_from_basic_set(__isl_take isl_basic_set *bset) { return isl_map_from_basic_map(bset); } -struct isl_map *isl_map_from_basic_map(struct isl_basic_map *bmap) +__isl_give isl_map *isl_map_from_basic_map(__isl_take isl_basic_map *bmap) { struct isl_map *map; @@ -3414,8 +3417,8 @@ void isl_map_print_internal(struct isl_map *map, FILE *out, int indent) } } -struct isl_basic_map *isl_basic_map_intersect_domain( - struct isl_basic_map *bmap, struct isl_basic_set *bset) +__isl_give isl_basic_map *isl_basic_map_intersect_domain( + __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *bset) { struct isl_basic_map *bmap_domain; @@ -3459,8 +3462,8 @@ static isl_stat isl_basic_map_check_compatible_range( return isl_stat_ok; } -struct isl_basic_map *isl_basic_map_intersect_range( - struct isl_basic_map *bmap, struct isl_basic_set *bset) +__isl_give isl_basic_map *isl_basic_map_intersect_range( + __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *bset) { struct isl_basic_map *bmap_range; @@ -3535,8 +3538,8 @@ isl_bool isl_basic_set_contains(__isl_keep isl_basic_set *bset, return isl_basic_map_contains(bset_to_bmap(bset), vec); } -struct isl_basic_map *isl_basic_map_intersect( - struct isl_basic_map *bmap1, struct isl_basic_map *bmap2) +__isl_give isl_basic_map *isl_basic_map_intersect( + __isl_take isl_basic_map *bmap1, __isl_take isl_basic_map *bmap2) { struct isl_vec *sample = NULL; @@ -3772,7 +3775,7 @@ __isl_give isl_set *isl_set_intersect_params(__isl_take isl_set *set, return isl_map_intersect_params(set, params); } -struct isl_basic_map *isl_basic_map_reverse(struct isl_basic_map *bmap) +__isl_give isl_basic_map *isl_basic_map_reverse(__isl_take isl_basic_map *bmap) { isl_space *space; unsigned pos, n1, n2; @@ -4491,8 +4494,8 @@ error: /* Given two basic maps A -> f(A) and B -> g(B), construct a basic map * A \cap B -> f(A) + f(B) */ -struct isl_basic_map *isl_basic_map_sum( - struct isl_basic_map *bmap1, struct isl_basic_map *bmap2) +__isl_give isl_basic_map *isl_basic_map_sum(__isl_take isl_basic_map *bmap1, + __isl_take isl_basic_map *bmap2) { unsigned n_in, n_out, nparam, total, pos; struct isl_basic_map *bmap = NULL; @@ -4550,7 +4553,8 @@ error: /* Given two maps A -> f(A) and B -> g(B), construct a map * A \cap B -> f(A) + f(B) */ -struct isl_map *isl_map_sum(struct isl_map *map1, struct isl_map *map2) +__isl_give isl_map *isl_map_sum(__isl_take isl_map *map1, + __isl_take isl_map *map2) { struct isl_map *result; int i, j; @@ -4594,7 +4598,7 @@ __isl_give isl_set *isl_set_sum(__isl_take isl_set *set1, /* Given a basic map A -> f(A), construct A -> -f(A). */ -struct isl_basic_map *isl_basic_map_neg(struct isl_basic_map *bmap) +__isl_give isl_basic_map *isl_basic_map_neg(__isl_take isl_basic_map *bmap) { int i, j; unsigned off, n; @@ -4625,7 +4629,7 @@ __isl_give isl_basic_set *isl_basic_set_neg(__isl_take isl_basic_set *bset) /* Given a map A -> f(A), construct A -> -f(A). */ -struct isl_map *isl_map_neg(struct isl_map *map) +__isl_give isl_map *isl_map_neg(__isl_take isl_map *map) { int i; @@ -4653,7 +4657,7 @@ __isl_give isl_set *isl_set_neg(__isl_take isl_set *set) /* Given a basic map A -> f(A) and an integer d, construct a basic map * A -> floor(f(A)/d). */ -struct isl_basic_map *isl_basic_map_floordiv(struct isl_basic_map *bmap, +__isl_give isl_basic_map *isl_basic_map_floordiv(__isl_take isl_basic_map *bmap, isl_int d) { unsigned n_in, n_out, nparam, total, pos; @@ -4707,7 +4711,7 @@ error: /* Given a map A -> f(A) and an integer d, construct a map * A -> floor(f(A)/d). */ -struct isl_map *isl_map_floordiv(struct isl_map *map, isl_int d) +__isl_give isl_map *isl_map_floordiv(__isl_take isl_map *map, isl_int d) { int i; @@ -4749,7 +4753,8 @@ error: return NULL; } -static struct isl_basic_map *var_equal(struct isl_basic_map *bmap, unsigned pos) +static __isl_give isl_basic_map *var_equal(__isl_take isl_basic_map *bmap, + unsigned pos) { int i; unsigned nparam; @@ -4771,7 +4776,8 @@ error: /* Add a constraint to "bmap" expressing i_pos < o_pos */ -static struct isl_basic_map *var_less(struct isl_basic_map *bmap, unsigned pos) +static __isl_give isl_basic_map *var_less(__isl_take isl_basic_map *bmap, + unsigned pos) { int i; unsigned nparam; @@ -4817,7 +4823,8 @@ error: /* Add a constraint to "bmap" expressing i_pos > o_pos */ -static struct isl_basic_map *var_more(struct isl_basic_map *bmap, unsigned pos) +static __isl_give isl_basic_map *var_more(__isl_take isl_basic_map *bmap, + unsigned pos) { int i; unsigned nparam; @@ -5691,7 +5698,7 @@ isl_bool isl_map_is_set(__isl_keep isl_map *map) return isl_space_is_set(map->dim); } -struct isl_set *isl_map_range(struct isl_map *map) +__isl_give isl_set *isl_map_range(__isl_take isl_map *map) { int i; isl_bool is_set; @@ -6072,7 +6079,7 @@ error: return NULL; } -struct isl_basic_map *isl_basic_map_fix_si(struct isl_basic_map *bmap, +__isl_give isl_basic_map *isl_basic_map_fix_si(__isl_take isl_basic_map *bmap, enum isl_dim_type type, unsigned pos, int value) { if (isl_basic_map_check_range(bmap, type, pos, 1) < 0) @@ -6201,7 +6208,7 @@ error: return NULL; } -struct isl_map *isl_map_fix_si(struct isl_map *map, +__isl_give isl_map *isl_map_fix_si(__isl_take isl_map *map, enum isl_dim_type type, unsigned pos, int value) { int i; @@ -6527,7 +6534,7 @@ error: return NULL; } -struct isl_map *isl_map_reverse(struct isl_map *map) +__isl_give isl_map *isl_map_reverse(__isl_take isl_map *map) { int i; @@ -6916,8 +6923,8 @@ __isl_give isl_pw_aff *isl_set_dim_min(__isl_take isl_set *set, int pos) /* Apply a preimage specified by "mat" on the parameters of "bset". * bset is assumed to have only parameters and divs. */ -static struct isl_basic_set *basic_set_parameter_preimage( - struct isl_basic_set *bset, struct isl_mat *mat) +static __isl_give isl_basic_set *basic_set_parameter_preimage( + __isl_take isl_basic_set *bset, __isl_take isl_mat *mat) { unsigned nparam; @@ -6984,8 +6991,8 @@ error: /* Intersect the basic set "bset" with the affine space specified by the * equalities in "eq". */ -static struct isl_basic_set *basic_set_append_equalities( - struct isl_basic_set *bset, struct isl_mat *eq) +static __isl_give isl_basic_set *basic_set_append_equalities( + __isl_take isl_basic_set *bset, __isl_take isl_mat *eq) { int i, k; unsigned len; @@ -7445,7 +7452,7 @@ isl_bool isl_map_divs_known(__isl_keep isl_map *map) * quite expensive, so first try to remove divs that aren't * strictly needed. */ -struct isl_map *isl_basic_map_compute_divs(struct isl_basic_map *bmap) +__isl_give isl_map *isl_basic_map_compute_divs(__isl_take isl_basic_map *bmap) { int known; struct isl_map *map; @@ -7471,7 +7478,7 @@ error: return NULL; } -struct isl_map *isl_map_compute_divs(struct isl_map *map) +__isl_give isl_map *isl_map_compute_divs(__isl_take isl_map *map) { int i; int known; @@ -7514,7 +7521,7 @@ struct isl_set *isl_set_compute_divs(struct isl_set *set) return set_from_map(isl_map_compute_divs(set_to_map(set))); } -struct isl_set *isl_map_domain(struct isl_map *map) +__isl_give isl_set *isl_map_domain(__isl_take isl_map *map) { int i; struct isl_set *set; @@ -7852,7 +7859,7 @@ __isl_give isl_map *isl_map_apply_range(__isl_take isl_map *map1, /* * returns range - domain */ -struct isl_basic_set *isl_basic_map_deltas(struct isl_basic_map *bmap) +__isl_give isl_basic_set *isl_basic_map_deltas(__isl_take isl_basic_map *bmap) { isl_space *target_space; struct isl_basic_set *bset; @@ -8571,8 +8578,8 @@ isl_bool isl_basic_set_is_empty(__isl_keep isl_basic_set *bset) return isl_basic_map_is_empty(bset_to_bmap(bset)); } -struct isl_map *isl_basic_map_union( - struct isl_basic_map *bmap1, struct isl_basic_map *bmap2) +__isl_give isl_map *isl_basic_map_union(__isl_take isl_basic_map *bmap1, + __isl_take isl_basic_map *bmap2) { struct isl_map *map; if (!bmap1 || !bmap2) @@ -8600,7 +8607,8 @@ struct isl_set *isl_basic_set_union( } /* Order divs such that any div only depends on previous divs */ -struct isl_basic_map *isl_basic_map_order_divs(struct isl_basic_map *bmap) +__isl_give isl_basic_map *isl_basic_map_order_divs( + __isl_take isl_basic_map *bmap) { int i; unsigned off; @@ -8735,8 +8743,8 @@ __isl_give isl_basic_set *isl_basic_set_expand_divs( * Returns -1 if no corresponding div was found and the position * of the corresponding div in dst otherwise. */ -static int find_div(struct isl_basic_map *dst, - struct isl_basic_map *src, unsigned div) +static int find_div(__isl_keep isl_basic_map *dst, + __isl_keep isl_basic_map *src, unsigned div) { int i; @@ -8927,7 +8935,7 @@ __isl_give isl_set *isl_set_apply( __isl_take isl_set *set, /* There is no need to cow as removing empty parts doesn't change * the meaning of the set. */ -struct isl_map *isl_map_remove_empty_parts(struct isl_map *map) +__isl_give isl_map *isl_map_remove_empty_parts(__isl_take isl_map *map) { int i; @@ -9352,7 +9360,8 @@ __isl_give isl_basic_set *isl_basic_set_sort_constraints( return bset_from_bmap(isl_basic_map_sort_constraints(bmap)); } -struct isl_basic_map *isl_basic_map_normalize(struct isl_basic_map *bmap) +__isl_give isl_basic_map *isl_basic_map_normalize( + __isl_take isl_basic_map *bmap) { if (!bmap) return NULL; @@ -9728,8 +9737,8 @@ error: return NULL; } -struct isl_basic_map *isl_basic_map_product( - struct isl_basic_map *bmap1, struct isl_basic_map *bmap2) +__isl_give isl_basic_map *isl_basic_map_product( + __isl_take isl_basic_map *bmap1, __isl_take isl_basic_map *bmap2) { isl_space *dim_result = NULL; struct isl_basic_map *bmap; diff --git a/polly/lib/External/isl/isl_map_private.h b/polly/lib/External/isl/isl_map_private.h index 5bf7356cd31..2b976abcd7b 100644 --- a/polly/lib/External/isl/isl_map_private.h +++ b/polly/lib/External/isl/isl_map_private.h @@ -179,7 +179,7 @@ __isl_give isl_map *isl_map_reset_space(__isl_take isl_map *map, unsigned isl_basic_map_offset(struct isl_basic_map *bmap, enum isl_dim_type type); -unsigned isl_basic_set_offset(struct isl_basic_set *bset, +unsigned isl_basic_set_offset(__isl_keep isl_basic_set *bset, enum isl_dim_type type); isl_bool isl_basic_map_may_be_set(__isl_keep isl_basic_map *bmap); @@ -191,16 +191,16 @@ isl_bool isl_basic_map_compatible_domain(__isl_keep isl_basic_map *bmap, isl_bool isl_basic_map_compatible_range(__isl_keep isl_basic_map *bmap, __isl_keep isl_basic_set *bset); -struct isl_basic_map *isl_basic_map_extend_space(struct isl_basic_map *base, - __isl_take isl_space *dim, unsigned extra, - unsigned n_eq, unsigned n_ineq); +__isl_give isl_basic_map *isl_basic_map_extend_space( + __isl_take isl_basic_map *base, __isl_take isl_space *dim, + unsigned extra, unsigned n_eq, unsigned n_ineq); struct isl_basic_set *isl_basic_set_extend_space(struct isl_basic_set *base, __isl_take isl_space *dim, unsigned extra, unsigned n_eq, unsigned n_ineq); struct isl_basic_set *isl_basic_set_add_constraints(struct isl_basic_set *bset1, struct isl_basic_set *bset2, unsigned pos); -struct isl_map *isl_map_grow(struct isl_map *map, int n); +__isl_give isl_map *isl_map_grow(__isl_take isl_map *map, int n); struct isl_set *isl_set_grow(struct isl_set *set, int n); isl_bool isl_basic_set_contains(__isl_keep isl_basic_set *bset, @@ -222,8 +222,8 @@ int isl_basic_set_alloc_equality(struct isl_basic_set *bset); int isl_basic_set_free_inequality(struct isl_basic_set *bset, unsigned n); int isl_basic_map_free_equality(struct isl_basic_map *bmap, unsigned n); int isl_basic_set_free_equality(struct isl_basic_set *bset, unsigned n); -int isl_basic_set_alloc_inequality(struct isl_basic_set *bset); -int isl_basic_map_alloc_inequality(struct isl_basic_map *bmap); +int isl_basic_set_alloc_inequality(__isl_keep isl_basic_set *bset); +int isl_basic_map_alloc_inequality(__isl_keep isl_basic_map *bmap); int isl_basic_map_free_inequality(struct isl_basic_map *bmap, unsigned n); int isl_basic_map_alloc_div(struct isl_basic_map *bmap); __isl_give isl_basic_map *isl_basic_map_insert_div( @@ -251,22 +251,24 @@ __isl_give isl_basic_set *isl_basic_set_tighten_outward( int isl_inequality_negate(struct isl_basic_map *bmap, unsigned pos); -struct isl_basic_set *isl_basic_set_cow(struct isl_basic_set *bset); -struct isl_basic_map *isl_basic_map_cow(struct isl_basic_map *bmap); -struct isl_set *isl_set_cow(struct isl_set *set); -struct isl_map *isl_map_cow(struct isl_map *map); +__isl_give isl_basic_set *isl_basic_set_cow(__isl_take isl_basic_set *bset); +__isl_give isl_basic_map *isl_basic_map_cow(__isl_take isl_basic_map *bmap); +__isl_give isl_set *isl_set_cow(__isl_take isl_set *set); +__isl_give isl_map *isl_map_cow(__isl_take isl_map *map); uint32_t isl_basic_map_get_hash(__isl_keep isl_basic_map *bmap); __isl_give isl_set *isl_basic_set_list_union( __isl_take isl_basic_set_list *list); -struct isl_basic_map *isl_basic_map_set_to_empty(struct isl_basic_map *bmap); +__isl_give isl_basic_map *isl_basic_map_set_to_empty( + __isl_take isl_basic_map *bmap); struct isl_basic_set *isl_basic_set_set_to_empty(struct isl_basic_set *bset); struct isl_basic_set *isl_basic_set_order_divs(struct isl_basic_set *bset); void isl_basic_map_swap_div(struct isl_basic_map *bmap, int a, int b); void isl_basic_set_swap_div(struct isl_basic_set *bset, int a, int b); -struct isl_basic_map *isl_basic_map_order_divs(struct isl_basic_map *bmap); +__isl_give isl_basic_map *isl_basic_map_order_divs( + __isl_take isl_basic_map *bmap); __isl_give isl_map *isl_map_order_divs(__isl_take isl_map *map); struct isl_basic_map *isl_basic_map_align_divs( struct isl_basic_map *dst, struct isl_basic_map *src); @@ -280,8 +282,8 @@ __isl_give isl_basic_set *isl_basic_set_sort_divs( __isl_give isl_basic_map *isl_basic_map_sort_divs( __isl_take isl_basic_map *bmap); __isl_give isl_map *isl_map_sort_divs(__isl_take isl_map *map); -struct isl_basic_map *isl_basic_map_gauss( - struct isl_basic_map *bmap, int *progress); +__isl_give isl_basic_map *isl_basic_map_gauss(__isl_take isl_basic_map *bmap, + int *progress); struct isl_basic_set *isl_basic_set_gauss( struct isl_basic_set *bset, int *progress); int isl_basic_map_constraint_cmp(__isl_keep isl_basic_map *bmap, @@ -294,12 +296,12 @@ int isl_basic_map_plain_cmp(__isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2); isl_bool isl_basic_map_plain_is_equal(__isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2); -struct isl_basic_map *isl_basic_map_normalize_constraints( - struct isl_basic_map *bmap); +__isl_give isl_basic_map *isl_basic_map_normalize_constraints( + __isl_take isl_basic_map *bmap); struct isl_basic_set *isl_basic_set_normalize_constraints( struct isl_basic_set *bset); -struct isl_basic_map *isl_basic_map_implicit_equalities( - struct isl_basic_map *bmap); +__isl_give isl_basic_map *isl_basic_map_implicit_equalities( + __isl_take isl_basic_map *bmap); struct isl_basic_set *isl_basic_map_underlying_set(struct isl_basic_map *bmap); __isl_give isl_basic_set *isl_basic_set_underlying_set( __isl_take isl_basic_set *bset); @@ -316,13 +318,13 @@ __isl_give isl_basic_set *isl_basic_set_drop_constraints_involving( __isl_take isl_basic_set *bset, unsigned first, unsigned n); __isl_give isl_basic_set *isl_basic_set_drop(__isl_take isl_basic_set *bset, enum isl_dim_type type, unsigned first, unsigned n); -struct isl_basic_map *isl_basic_map_drop(struct isl_basic_map *bmap, +__isl_give isl_basic_map *isl_basic_map_drop(__isl_take isl_basic_map *bmap, enum isl_dim_type type, unsigned first, unsigned n); -struct isl_set *isl_set_drop(struct isl_set *set, +__isl_give isl_set *isl_set_drop(__isl_take isl_set *set, enum isl_dim_type type, unsigned first, unsigned n); struct isl_basic_set *isl_basic_set_drop_dims( struct isl_basic_set *bset, unsigned first, unsigned n); -struct isl_map *isl_map_drop(struct isl_map *map, +__isl_give isl_map *isl_map_drop(__isl_take isl_map *map, enum isl_dim_type type, unsigned first, unsigned n); __isl_give isl_basic_map *isl_basic_map_drop_unrelated_constraints( __isl_take isl_basic_map *bmap, __isl_take int *group); @@ -332,7 +334,7 @@ __isl_give isl_basic_map *isl_basic_map_remove_duplicate_constraints( __isl_give isl_basic_map *isl_basic_map_detect_inequality_pairs( __isl_take isl_basic_map *bmap, int *progress); -struct isl_map *isl_map_remove_empty_parts(struct isl_map *map); +__isl_give isl_map *isl_map_remove_empty_parts(__isl_take isl_map *map); struct isl_set *isl_set_remove_empty_parts(struct isl_set *set); __isl_give isl_map *isl_map_remove_obvious_duplicates(__isl_take isl_map *map); @@ -341,8 +343,8 @@ struct isl_set *isl_set_normalize(struct isl_set *set); struct isl_set *isl_set_drop_vars( struct isl_set *set, unsigned first, unsigned n); -struct isl_basic_map *isl_basic_map_eliminate_vars( - struct isl_basic_map *bmap, unsigned pos, unsigned n); +__isl_give isl_basic_map *isl_basic_map_eliminate_vars( + __isl_take isl_basic_map *bmap, unsigned pos, unsigned n); struct isl_basic_set *isl_basic_set_eliminate_vars( struct isl_basic_set *bset, unsigned pos, unsigned n); @@ -359,8 +361,10 @@ __isl_give isl_basic_map *isl_basic_map_add_known_div_constraints( struct isl_basic_map *isl_basic_map_drop_redundant_divs( struct isl_basic_map *bmap); -struct isl_basic_set *isl_basic_set_recession_cone(struct isl_basic_set *bset); -struct isl_basic_set *isl_basic_set_lineality_space(struct isl_basic_set *bset); +__isl_give isl_basic_set *isl_basic_set_recession_cone( + __isl_take isl_basic_set *bset); +__isl_give isl_basic_set *isl_basic_set_lineality_space( + __isl_take isl_basic_set *bset); __isl_give isl_basic_set *isl_basic_set_set_integral( __isl_take isl_basic_set *bset); diff --git a/polly/lib/External/isl/isl_map_simplify.c b/polly/lib/External/isl/isl_map_simplify.c index e5565a00801..d59ec86bf87 100644 --- a/polly/lib/External/isl/isl_map_simplify.c +++ b/polly/lib/External/isl/isl_map_simplify.c @@ -44,8 +44,8 @@ static void swap_inequality(struct isl_basic_map *bmap, int a, int b) } } -struct isl_basic_map *isl_basic_map_normalize_constraints( - struct isl_basic_map *bmap) +__isl_give isl_basic_map *isl_basic_map_normalize_constraints( + __isl_take isl_basic_map *bmap) { int i; isl_int gcd; @@ -357,7 +357,7 @@ static __isl_give isl_basic_map *eliminate_div(__isl_take isl_basic_map *bmap, /* Check if elimination of div "div" using equality "eq" would not * result in a div depending on a later div. */ -static isl_bool ok_to_eliminate_div(struct isl_basic_map *bmap, isl_int *eq, +static isl_bool ok_to_eliminate_div(__isl_keep isl_basic_map *bmap, isl_int *eq, unsigned div) { int k; @@ -381,8 +381,8 @@ static isl_bool ok_to_eliminate_div(struct isl_basic_map *bmap, isl_int *eq, /* Eliminate divs based on equalities */ -static struct isl_basic_map *eliminate_divs_eq( - struct isl_basic_map *bmap, int *progress) +static __isl_give isl_basic_map *eliminate_divs_eq( + __isl_take isl_basic_map *bmap, int *progress) { int d; int i; @@ -423,8 +423,8 @@ static struct isl_basic_map *eliminate_divs_eq( /* Eliminate divs based on inequalities */ -static struct isl_basic_map *eliminate_divs_ineq( - struct isl_basic_map *bmap, int *progress) +static __isl_give isl_basic_map *eliminate_divs_ineq( + __isl_take isl_basic_map *bmap, int *progress) { int d; int i; @@ -541,8 +541,8 @@ static __isl_give isl_basic_map *set_div_from_eq(__isl_take isl_basic_map *bmap, return bmap; } -struct isl_basic_map *isl_basic_map_gauss( - struct isl_basic_map *bmap, int *progress) +__isl_give isl_basic_map *isl_basic_map_gauss(__isl_take isl_basic_map *bmap, + int *progress) { int k; int done; @@ -689,7 +689,7 @@ static int hash_index(struct isl_constraint_index *ci, } static int set_hash_index(struct isl_constraint_index *ci, - struct isl_basic_set *bset, int k) + __isl_keep isl_basic_set *bset, int k) { return hash_index(ci, bset, k); } @@ -741,8 +741,8 @@ static isl_bool constraint_index_is_redundant(struct isl_constraint_index *ci, * change the position of the other divs that still need to * be removed. */ -static struct isl_basic_map *remove_duplicate_divs( - struct isl_basic_map *bmap, int *progress) +static __isl_give isl_basic_map *remove_duplicate_divs( + __isl_take isl_basic_map *bmap, int *progress) { unsigned int size; int *index; @@ -885,8 +885,8 @@ static int n_pure_div_eq(struct isl_basic_map *bmap) * we have to replace each x'', i.e., the x'_k with (g_kk = 1), * by the corresponding row from C_2. */ -static struct isl_basic_map *normalize_divs( - struct isl_basic_map *bmap, int *progress) +static __isl_give isl_basic_map *normalize_divs(__isl_take isl_basic_map *bmap, + int *progress) { int i, j, k; int total; @@ -1035,8 +1035,8 @@ error: return bmap; } -static struct isl_basic_map *set_div_from_lower_bound( - struct isl_basic_map *bmap, int div, int ineq) +static __isl_give isl_basic_map *set_div_from_lower_bound( + __isl_take isl_basic_map *bmap, int div, int ineq) { unsigned total = 1 + isl_space_dim(bmap->dim, isl_dim_all); @@ -1055,7 +1055,7 @@ static struct isl_basic_map *set_div_from_lower_bound( * any other undefined divs or if any known div is defined in * terms of the unknown div. */ -static isl_bool ok_to_set_div_from_bound(struct isl_basic_map *bmap, +static isl_bool ok_to_set_div_from_bound(__isl_keep isl_basic_map *bmap, int div, int ineq) { int j; @@ -1125,8 +1125,9 @@ static isl_bool better_div_constraint(__isl_keep isl_basic_map *bmap, * any other undefined divs or if any known div is defined in * terms of the unknown div. */ -static struct isl_basic_map *check_for_div_constraints( - struct isl_basic_map *bmap, int k, int l, isl_int sum, int *progress) +static __isl_give isl_basic_map *check_for_div_constraints( + __isl_take isl_basic_map *bmap, int k, int l, isl_int sum, + int *progress) { int i; unsigned total = 1 + isl_space_dim(bmap->dim, isl_dim_all); @@ -1335,7 +1336,7 @@ static __isl_give isl_basic_map *eliminate_unit_divs( return bmap; } -struct isl_basic_map *isl_basic_map_simplify(struct isl_basic_map *bmap) +__isl_give isl_basic_map *isl_basic_map_simplify(__isl_take isl_basic_map *bmap) { int progress = 1; if (!bmap) @@ -1424,7 +1425,7 @@ isl_bool isl_basic_set_is_div_constraint(__isl_keep isl_basic_set *bset, * * then it can safely be removed. */ -static isl_bool div_is_redundant(struct isl_basic_map *bmap, int div) +static isl_bool div_is_redundant(__isl_keep isl_basic_map *bmap, int div) { int i; unsigned pos = 1 + isl_space_dim(bmap->dim, isl_dim_all) + div; @@ -1459,7 +1460,8 @@ static isl_bool div_is_redundant(struct isl_basic_map *bmap, int div) * when the divs of a basic map have been temporarily aligned * with the divs of another basic map. */ -static struct isl_basic_map *remove_redundant_divs(struct isl_basic_map *bmap) +static __isl_give isl_basic_map *remove_redundant_divs( + __isl_take isl_basic_map *bmap) { int i; @@ -1494,7 +1496,7 @@ __isl_give isl_basic_map *isl_basic_map_mark_final( /* Mark "bmap" as final, after removing obviously redundant integer divisions. */ -struct isl_basic_map *isl_basic_map_finalize(struct isl_basic_map *bmap) +__isl_give isl_basic_map *isl_basic_map_finalize(__isl_take isl_basic_map *bmap) { bmap = remove_redundant_divs(bmap); bmap = isl_basic_map_mark_final(bmap); @@ -1510,8 +1512,8 @@ struct isl_basic_set *isl_basic_set_finalize(struct isl_basic_set *bset) * The div itself is not removed. Functions such as * eliminate_divs_ineq depend on the other divs remaining in place. */ -static struct isl_basic_map *remove_dependent_vars(struct isl_basic_map *bmap, - int pos) +static __isl_give isl_basic_map *remove_dependent_vars( + __isl_take isl_basic_map *bmap, int pos) { int i; @@ -1533,8 +1535,8 @@ static struct isl_basic_map *remove_dependent_vars(struct isl_basic_map *bmap, /* Eliminate the specified variables from the constraints using * Fourier-Motzkin. The variables themselves are not removed. */ -struct isl_basic_map *isl_basic_map_eliminate_vars( - struct isl_basic_map *bmap, unsigned pos, unsigned n) +__isl_give isl_basic_map *isl_basic_map_eliminate_vars( + __isl_take isl_basic_map *bmap, unsigned pos, unsigned n) { int d; int i, j, k; @@ -1760,7 +1762,7 @@ __isl_give isl_map *isl_map_drop_constraint_involving_unknown_divs( /* Don't assume equalities are in order, because align_divs * may have changed the order of the divs. */ -static void compute_elimination_index(struct isl_basic_map *bmap, int *elim) +static void compute_elimination_index(__isl_keep isl_basic_map *bmap, int *elim) { int d, i; unsigned total; @@ -1778,13 +1780,14 @@ static void compute_elimination_index(struct isl_basic_map *bmap, int *elim) } } -static void set_compute_elimination_index(struct isl_basic_set *bset, int *elim) +static void set_compute_elimination_index(__isl_keep isl_basic_set *bset, + int *elim) { compute_elimination_index(bset_to_bmap(bset), elim); } static int reduced_using_equalities(isl_int *dst, isl_int *src, - struct isl_basic_map *bmap, int *elim) + __isl_keep isl_basic_map *bmap, int *elim) { int d; int copied = 0; @@ -1806,14 +1809,14 @@ static int reduced_using_equalities(isl_int *dst, isl_int *src, } static int set_reduced_using_equalities(isl_int *dst, isl_int *src, - struct isl_basic_set *bset, int *elim) + __isl_keep isl_basic_set *bset, int *elim) { return reduced_using_equalities(dst, src, bset_to_bmap(bset), elim); } -static struct isl_basic_set *isl_basic_set_reduce_using_equalities( - struct isl_basic_set *bset, struct isl_basic_set *context) +static __isl_give isl_basic_set *isl_basic_set_reduce_using_equalities( + __isl_take isl_basic_set *bset, __isl_take isl_basic_set *context) { int i; int *elim; @@ -1897,8 +1900,8 @@ error: return isl_stat_error; } -static struct isl_basic_set *remove_shifted_constraints( - struct isl_basic_set *bset, struct isl_basic_set *context) +static __isl_give isl_basic_set *remove_shifted_constraints( + __isl_take isl_basic_set *bset, __isl_keep isl_basic_set *context) { struct isl_constraint_index ci; int k; @@ -3027,8 +3030,8 @@ static __isl_give isl_basic_map *gist_strides(__isl_take isl_basic_map *bmap, * also simplified with respecting to the other equality constraints * in "bmap" and with respect to all equality constraints in "context". */ -struct isl_basic_map *isl_basic_map_gist(struct isl_basic_map *bmap, - struct isl_basic_map *context) +__isl_give isl_basic_map *isl_basic_map_gist(__isl_take isl_basic_map *bmap, + __isl_take isl_basic_map *context) { isl_basic_set *bset, *eq; isl_basic_map *eq_bmap; @@ -4085,8 +4088,8 @@ static isl_bool int_between_bounds(__isl_keep isl_basic_map *bmap, int i, * In particular, the value attained by the bound with unit coefficient * can serve as this intermediate value. */ -static struct isl_basic_map *drop_more_redundant_divs( - struct isl_basic_map *bmap, int *pairs, int n) +static __isl_give isl_basic_map *drop_more_redundant_divs( + __isl_take isl_basic_map *bmap, __isl_take int *pairs, int n) { isl_ctx *ctx; struct test_ineq_data data = { NULL, NULL }; @@ -4220,7 +4223,7 @@ error: * to store div2, but otherwise has a different meaning, any possible * explicit representation of the original div2 is removed. */ -static struct isl_basic_map *coalesce_divs(struct isl_basic_map *bmap, +static __isl_give isl_basic_map *coalesce_divs(__isl_take isl_basic_map *bmap, unsigned div1, unsigned div2, unsigned l, unsigned u) { isl_ctx *ctx; @@ -4276,8 +4279,8 @@ static struct isl_basic_map *coalesce_divs(struct isl_basic_map *bmap, * is any other div "c" with which we can coalesce the div * and if so, perform the coalescing. */ -static struct isl_basic_map *coalesce_or_drop_more_redundant_divs( - struct isl_basic_map *bmap, int *pairs, int n) +static __isl_give isl_basic_map *coalesce_or_drop_more_redundant_divs( + __isl_take isl_basic_map *bmap, int *pairs, int n) { int i, l, u; unsigned dim; diff --git a/polly/lib/External/isl/isl_mat.c b/polly/lib/External/isl/isl_mat.c index e5e52bd90b2..d684bb6f944 100644 --- a/polly/lib/External/isl/isl_mat.c +++ b/polly/lib/External/isl/isl_mat.c @@ -194,7 +194,7 @@ void isl_mat_sub_neg(struct isl_ctx *ctx, isl_int **dst, isl_int **src, isl_seq_neg(dst[i]+dst_col, src[i]+src_col, n_col); } -struct isl_mat *isl_mat_copy(struct isl_mat *mat) +__isl_give isl_mat *isl_mat_copy(__isl_keep isl_mat *mat) { if (!mat) return NULL; @@ -420,7 +420,8 @@ int isl_mat_is_scaled_identity(__isl_keep isl_mat *mat) return 1; } -struct isl_vec *isl_mat_vec_product(struct isl_mat *mat, struct isl_vec *vec) +__isl_give isl_vec *isl_mat_vec_product(__isl_take isl_mat *mat, + __isl_take isl_vec *vec) { int i; struct isl_vec *prod; @@ -475,7 +476,8 @@ error: return NULL; } -struct isl_vec *isl_vec_mat_product(struct isl_vec *vec, struct isl_mat *mat) +__isl_give isl_vec *isl_vec_mat_product(__isl_take isl_vec *vec, + __isl_take isl_mat *mat) { int i, j; struct isl_vec *prod; @@ -503,8 +505,8 @@ error: return NULL; } -struct isl_mat *isl_mat_aff_direct_sum(struct isl_mat *left, - struct isl_mat *right) +__isl_give isl_mat *isl_mat_aff_direct_sum(__isl_take isl_mat *left, + __isl_take isl_mat *right) { int i; struct isl_mat *sum; @@ -609,8 +611,8 @@ static void oppose(struct isl_mat *M, struct isl_mat **U, * column. * If U or Q are NULL, then these matrices are not computed. */ -struct isl_mat *isl_mat_left_hermite(struct isl_mat *M, int neg, - struct isl_mat **U, struct isl_mat **Q) +__isl_give isl_mat *isl_mat_left_hermite(__isl_take isl_mat *M, int neg, + __isl_give isl_mat **U, __isl_give isl_mat **Q) { isl_int c; int row, col; @@ -716,7 +718,7 @@ error: return NULL; } -struct isl_mat *isl_mat_lin_to_aff(struct isl_mat *mat) +__isl_give isl_mat *isl_mat_lin_to_aff(__isl_take isl_mat *mat) { int i; struct isl_mat *mat2; @@ -831,8 +833,8 @@ static void inv_subtract(struct isl_mat *left, struct isl_mat *right, /* Compute inv(left)*right */ -struct isl_mat *isl_mat_inverse_product(struct isl_mat *left, - struct isl_mat *right) +__isl_give isl_mat *isl_mat_inverse_product(__isl_take isl_mat *left, + __isl_take isl_mat *right) { int row; isl_int a, b; @@ -947,7 +949,7 @@ void isl_mat_col_combine(struct isl_mat *mat, unsigned dst, isl_int_clear(tmp); } -struct isl_mat *isl_mat_right_inverse(struct isl_mat *mat) +__isl_give isl_mat *isl_mat_right_inverse(__isl_take isl_mat *mat) { struct isl_mat *inv; int row; @@ -1026,7 +1028,7 @@ error: return NULL; } -struct isl_mat *isl_mat_transpose(struct isl_mat *mat) +__isl_give isl_mat *isl_mat_transpose(__isl_take isl_mat *mat) { struct isl_mat *transpose = NULL; int i, j; @@ -1056,7 +1058,8 @@ error: return NULL; } -struct isl_mat *isl_mat_swap_cols(struct isl_mat *mat, unsigned i, unsigned j) +__isl_give isl_mat *isl_mat_swap_cols(__isl_take isl_mat *mat, + unsigned i, unsigned j) { int r; @@ -1074,7 +1077,8 @@ error: return NULL; } -struct isl_mat *isl_mat_swap_rows(struct isl_mat *mat, unsigned i, unsigned j) +__isl_give isl_mat *isl_mat_swap_rows(__isl_take isl_mat *mat, + unsigned i, unsigned j) { isl_int *t; @@ -1541,7 +1545,7 @@ __isl_give isl_mat *isl_mat_col_neg(__isl_take isl_mat *mat, int col) return mat; } -struct isl_mat *isl_mat_unimodular_complete(struct isl_mat *M, int row) +__isl_give isl_mat *isl_mat_unimodular_complete(__isl_take isl_mat *M, int row) { int r; struct isl_mat *H = NULL, *Q = NULL; diff --git a/polly/lib/External/isl/isl_output.c b/polly/lib/External/isl/isl_output.c index 3b695a5b6eb..93442a95201 100644 --- a/polly/lib/External/isl/isl_output.c +++ b/polly/lib/External/isl/isl_output.c @@ -506,7 +506,8 @@ static const char *constraint_op(int sign, int strict, int latex) * "first_constraint" is set if this is the first constraint * in the conjunction. */ -static __isl_give isl_printer *print_half_constraint(struct isl_basic_map *bmap, +static __isl_give isl_printer *print_half_constraint( + __isl_keep isl_basic_map *bmap, __isl_keep isl_space *space, __isl_keep isl_mat *div, __isl_take isl_printer *p, isl_int *c, int last, const char *op, int first_constraint, int latex) @@ -536,7 +537,7 @@ static __isl_give isl_printer *print_half_constraint(struct isl_basic_map *bmap, * "first_constraint" is set if this is the first constraint * in the conjunction. */ -static __isl_give isl_printer *print_constraint(struct isl_basic_map *bmap, +static __isl_give isl_printer *print_constraint(__isl_keep isl_basic_map *bmap, __isl_keep isl_space *space, __isl_keep isl_mat *div, __isl_take isl_printer *p, isl_int *c, int last, const char *op, int first_constraint, int latex) diff --git a/polly/lib/External/isl/isl_sample.c b/polly/lib/External/isl/isl_sample.c index 604438c300e..058d689cef5 100644 --- a/polly/lib/External/isl/isl_sample.c +++ b/polly/lib/External/isl/isl_sample.c @@ -24,7 +24,7 @@ #include <bset_from_bmap.c> #include <set_to_map.c> -static struct isl_vec *empty_sample(struct isl_basic_set *bset) +static __isl_give isl_vec *empty_sample(__isl_take isl_basic_set *bset) { struct isl_vec *vec; @@ -37,7 +37,7 @@ static struct isl_vec *empty_sample(struct isl_basic_set *bset) * As a special case, if bset is zero-dimensional, this * function creates a zero-dimensional sample point. */ -static struct isl_vec *zero_sample(struct isl_basic_set *bset) +static __isl_give isl_vec *zero_sample(__isl_take isl_basic_set *bset) { unsigned dim; struct isl_vec *sample; @@ -52,7 +52,7 @@ static struct isl_vec *zero_sample(struct isl_basic_set *bset) return sample; } -static struct isl_vec *interval_sample(struct isl_basic_set *bset) +static __isl_give isl_vec *interval_sample(__isl_take isl_basic_set *bset) { int i; isl_int t; @@ -119,8 +119,8 @@ error: * in the resulting bset, using the specified recurse function, * and then transform the sample back to the original space. */ -static struct isl_vec *sample_eq(struct isl_basic_set *bset, - struct isl_vec *(*recurse)(struct isl_basic_set *)) +static __isl_give isl_vec *sample_eq(__isl_take isl_basic_set *bset, + __isl_give isl_vec *(*recurse)(__isl_take isl_basic_set *)) { struct isl_mat *T; struct isl_vec *sample; @@ -524,7 +524,7 @@ error: return NULL; } -static struct isl_vec *sample_bounded(struct isl_basic_set *bset); +static __isl_give isl_vec *sample_bounded(__isl_take isl_basic_set *bset); /* Compute a sample point of the given basic set, based on the given, * non-trivial factorization. @@ -601,7 +601,7 @@ error: * and then use isl_tab_sample to find a sample, passing it * the identity matrix as initial basis. */ -static struct isl_vec *sample_bounded(struct isl_basic_set *bset) +static __isl_give isl_vec *sample_bounded(__isl_take isl_basic_set *bset) { unsigned dim; struct isl_vec *sample; @@ -672,8 +672,8 @@ error: * where [1 s] is the sample value and I is the identity matrix of the * appropriate dimension. */ -static struct isl_basic_set *plug_in(struct isl_basic_set *bset, - struct isl_vec *sample) +static __isl_give isl_basic_set *plug_in(__isl_take isl_basic_set *bset, + __isl_take isl_vec *sample) { int i; unsigned total; @@ -708,7 +708,7 @@ error: /* Given a basic set "bset", return any (possibly non-integer) point * in the basic set. */ -static struct isl_vec *rational_sample(struct isl_basic_set *bset) +static __isl_give isl_vec *rational_sample(__isl_take isl_basic_set *bset) { struct isl_tab *tab; struct isl_vec *sample; @@ -758,8 +758,8 @@ static struct isl_vec *rational_sample(struct isl_basic_set *bset) * and we only have to add the smallest negative a_i (if any) * instead of the sum of all negative a_i. */ -static struct isl_basic_set *shift_cone(struct isl_basic_set *cone, - struct isl_vec *vec) +static __isl_give isl_basic_set *shift_cone(__isl_take isl_basic_set *cone, + __isl_take isl_vec *vec) { int i, j, k; unsigned total; @@ -816,8 +816,8 @@ error: * Then we simply round up the coordinates of x and return the * resulting integer point. */ -static struct isl_vec *round_up_in_cone(struct isl_vec *vec, - struct isl_basic_set *cone, struct isl_mat *U) +static __isl_give isl_vec *round_up_in_cone(__isl_take isl_vec *vec, + __isl_take isl_basic_set *cone, __isl_take isl_mat *U) { unsigned total; @@ -851,7 +851,8 @@ error: /* Concatenate two integer vectors, i.e., two vectors with denominator * (stored in element 0) equal to 1. */ -static struct isl_vec *vec_concat(struct isl_vec *vec1, struct isl_vec *vec2) +static __isl_give isl_vec *vec_concat(__isl_take isl_vec *vec1, + __isl_take isl_vec *vec2) { struct isl_vec *vec; @@ -1100,7 +1101,7 @@ int isl_tab_set_initial_basis_with_cone(struct isl_tab *tab, * sample_with_cone. Otherwise, we directly perform generalized basis * reduction. */ -static struct isl_vec *gbr_sample(struct isl_basic_set *bset) +static __isl_give isl_vec *gbr_sample(__isl_take isl_basic_set *bset) { unsigned dim; struct isl_basic_set *cone; @@ -1121,7 +1122,8 @@ error: return NULL; } -static struct isl_vec *basic_set_sample(struct isl_basic_set *bset, int bounded) +static __isl_give isl_vec *basic_set_sample(__isl_take isl_basic_set *bset, + int bounded) { struct isl_ctx *ctx; unsigned dim; @@ -1171,7 +1173,7 @@ __isl_give isl_vec *isl_basic_set_sample_vec(__isl_take isl_basic_set *bset) /* Compute an integer sample in "bset", where the caller guarantees * that "bset" is bounded. */ -struct isl_vec *isl_basic_set_sample_bounded(struct isl_basic_set *bset) +__isl_give isl_vec *isl_basic_set_sample_bounded(__isl_take isl_basic_set *bset) { return basic_set_sample(bset, 1); } diff --git a/polly/lib/External/isl/isl_sample.h b/polly/lib/External/isl/isl_sample.h index 57898b25ce0..1357946b7da 100644 --- a/polly/lib/External/isl/isl_sample.h +++ b/polly/lib/External/isl/isl_sample.h @@ -18,7 +18,8 @@ extern "C" { #endif __isl_give isl_vec *isl_basic_set_sample_vec(__isl_take isl_basic_set *bset); -struct isl_vec *isl_basic_set_sample_bounded(struct isl_basic_set *bset); +__isl_give isl_vec *isl_basic_set_sample_bounded( + __isl_take isl_basic_set *bset); __isl_give isl_vec *isl_basic_set_sample_with_cone( __isl_take isl_basic_set *bset, __isl_take isl_basic_set *cone); diff --git a/polly/lib/External/isl/isl_scheduler.c b/polly/lib/External/isl/isl_scheduler.c index fdc4e13b941..e1d05614cde 100644 --- a/polly/lib/External/isl/isl_scheduler.c +++ b/polly/lib/External/isl/isl_scheduler.c @@ -4333,14 +4333,12 @@ static int has_any_coincidence(struct isl_sched_graph *graph) */ static __isl_give isl_map *final_row(struct isl_sched_node *node) { - isl_local_space *ls; - isl_aff *aff; + isl_multi_aff *ma; int row; row = isl_mat_rows(node->sched) - 1; - ls = isl_local_space_from_space(isl_space_copy(node->space)); - aff = extract_schedule_row(ls, node, row); - return isl_map_from_aff(aff); + ma = node_extract_partial_schedule_multi_aff(node, row, 1); + return isl_map_from_multi_aff(ma); } /* Is the conditional validity dependence in the edge with index "edge_index" diff --git a/polly/lib/External/isl/isl_space.c b/polly/lib/External/isl/isl_space.c index 9bec5599d6e..4af4f1a3c17 100644 --- a/polly/lib/External/isl/isl_space.c +++ b/polly/lib/External/isl/isl_space.c @@ -590,7 +590,7 @@ isl_bool isl_space_has_tuple_name(__isl_keep isl_space *space, return id && id->name; } -const char *isl_space_get_tuple_name(__isl_keep isl_space *dim, +__isl_keep const char *isl_space_get_tuple_name(__isl_keep isl_space *dim, enum isl_dim_type type) { isl_id *id; @@ -1524,41 +1524,43 @@ __isl_give isl_space *isl_space_factor_range(__isl_take isl_space *space) return space; } -__isl_give isl_space *isl_space_map_from_set(__isl_take isl_space *dim) +__isl_give isl_space *isl_space_map_from_set(__isl_take isl_space *space) { isl_ctx *ctx; isl_id **ids = NULL; + int n_id; - if (!dim) + if (!space) return NULL; - ctx = isl_space_get_ctx(dim); - if (!isl_space_is_set(dim)) + ctx = isl_space_get_ctx(space); + if (!isl_space_is_set(space)) isl_die(ctx, isl_error_invalid, "not a set space", goto error); - dim = isl_space_cow(dim); - if (!dim) + space = isl_space_cow(space); + if (!space) return NULL; - if (dim->ids) { - ids = isl_calloc_array(dim->ctx, isl_id *, - dim->nparam + dim->n_out + dim->n_out); + n_id = space->nparam + space->n_out + space->n_out; + if (n_id > 0 && space->ids) { + ids = isl_calloc_array(space->ctx, isl_id *, n_id); if (!ids) goto error; - get_ids(dim, isl_dim_param, 0, dim->nparam, ids); - get_ids(dim, isl_dim_out, 0, dim->n_out, ids + dim->nparam); + get_ids(space, isl_dim_param, 0, space->nparam, ids); + get_ids(space, isl_dim_out, 0, space->n_out, + ids + space->nparam); } - dim->n_in = dim->n_out; + space->n_in = space->n_out; if (ids) { - free(dim->ids); - dim->ids = ids; - dim->n_id = dim->nparam + dim->n_out + dim->n_out; - dim = copy_ids(dim, isl_dim_out, 0, dim, isl_dim_in); + free(space->ids); + space->ids = ids; + space->n_id = n_id; + space = copy_ids(space, isl_dim_out, 0, space, isl_dim_in); } - isl_id_free(dim->tuple_id[0]); - dim->tuple_id[0] = isl_id_copy(dim->tuple_id[1]); - isl_space_free(dim->nested[0]); - dim->nested[0] = isl_space_copy(dim->nested[1]); - return dim; + isl_id_free(space->tuple_id[0]); + space->tuple_id[0] = isl_id_copy(space->tuple_id[1]); + isl_space_free(space->nested[0]); + space->nested[0] = isl_space_copy(space->nested[1]); + return space; error: - isl_space_free(dim); + isl_space_free(space); return NULL; } diff --git a/polly/lib/External/isl/isl_tab_pip.c b/polly/lib/External/isl/isl_tab_pip.c index ebab2cb39bd..24ea34ec5a2 100644 --- a/polly/lib/External/isl/isl_tab_pip.c +++ b/polly/lib/External/isl/isl_tab_pip.c @@ -998,7 +998,8 @@ static struct isl_vec *get_row_split_div(struct isl_tab *tab, int row) * * m d <= e */ -static struct isl_vec *ineq_for_div(struct isl_basic_set *bset, unsigned div) +static __isl_give isl_vec *ineq_for_div(__isl_keep isl_basic_set *bset, + unsigned div) { unsigned total; unsigned div_pos; @@ -2235,8 +2236,8 @@ static int add_parametric_cut(struct isl_tab *tab, int row, * of the variables in all constraints are negated prior to adding them * to the tableau. */ -static struct isl_tab *tab_for_lexmin(struct isl_basic_map *bmap, - struct isl_basic_set *dom, unsigned M, int max) +static __isl_give struct isl_tab *tab_for_lexmin(__isl_keep isl_basic_map *bmap, + __isl_keep isl_basic_set *dom, unsigned M, int max) { int i; struct isl_tab *tab; @@ -2748,7 +2749,7 @@ struct isl_context_op isl_context_lex_op = { context_lex_free, }; -static struct isl_tab *context_tab_for_lexmin(struct isl_basic_set *bset) +static struct isl_tab *context_tab_for_lexmin(__isl_take isl_basic_set *bset) { struct isl_tab *tab; @@ -2885,7 +2886,8 @@ static struct isl_vec *gbr_get_shifted_sample(struct isl_context_gbr *cgbr) return sample; } -static struct isl_basic_set *drop_constant_terms(struct isl_basic_set *bset) +static __isl_give isl_basic_set *drop_constant_terms( + __isl_take isl_basic_set *bset) { int i; @@ -4267,8 +4269,8 @@ static int find_context_div(struct isl_basic_map *bmap, * after any other integer divisions that the map may have. * This function performs the required reordering. */ -static struct isl_basic_map *align_context_divs(struct isl_basic_map *bmap, - struct isl_basic_set *dom) +static __isl_give isl_basic_map *align_context_divs( + __isl_take isl_basic_map *bmap, __isl_keep isl_basic_set *dom) { int i; int common = 0; diff --git a/polly/lib/External/isl/isl_test.c b/polly/lib/External/isl/isl_test.c index d361a73b169..4f5eae982c9 100644 --- a/polly/lib/External/isl/isl_test.c +++ b/polly/lib/External/isl/isl_test.c @@ -3714,6 +3714,55 @@ static int test_special_conditional_schedule_constraints(isl_ctx *ctx) return 0; } +/* Check that the test for violated conditional validity constraints + * is not confused by domain compression. + * In particular, earlier versions of isl would apply + * a schedule on the compressed domains to the original domains, + * resulting in a failure to detect that the default schedule + * violates the conditional validity constraints. + */ +static int test_special_conditional_schedule_constraints_2(isl_ctx *ctx) +{ + const char *str; + isl_bool empty; + isl_union_set *domain; + isl_union_map *validity, *condition; + isl_schedule_constraints *sc; + isl_schedule *schedule; + isl_union_map *umap; + isl_map *map, *ge; + + str = "{ A[0, i] : 0 <= i <= 10; B[1, i] : 0 <= i <= 10 }"; + domain = isl_union_set_read_from_str(ctx, str); + sc = isl_schedule_constraints_on_domain(domain); + str = "{ B[1, i] -> A[0, i + 1] }"; + condition = isl_union_map_read_from_str(ctx, str); + str = "{ A[0, i] -> B[1, i - 1] }"; + validity = isl_union_map_read_from_str(ctx, str); + sc = isl_schedule_constraints_set_conditional_validity(sc, condition, + isl_union_map_copy(validity)); + schedule = isl_schedule_constraints_compute_schedule(sc); + umap = isl_schedule_get_map(schedule); + isl_schedule_free(schedule); + validity = isl_union_map_apply_domain(validity, + isl_union_map_copy(umap)); + validity = isl_union_map_apply_range(validity, umap); + map = isl_map_from_union_map(validity); + ge = isl_map_lex_ge(isl_space_domain(isl_map_get_space(map))); + map = isl_map_intersect(map, ge); + empty = isl_map_is_empty(map); + isl_map_free(map); + + if (empty < 0) + return -1; + if (!empty) + isl_die(ctx, isl_error_unknown, + "conditional validity constraints not satisfied", + return -1); + + return 0; +} + /* Input for testing of schedule construction based on * conditional constraints. * @@ -3818,6 +3867,8 @@ static int test_conditional_schedule_constraints(isl_ctx *ctx) if (test_special_conditional_schedule_constraints(ctx) < 0) return -1; + if (test_special_conditional_schedule_constraints_2(ctx) < 0) + return -1; for (i = 0; i < ARRAY_SIZE(live_range_tests); ++i) { domain = isl_union_set_read_from_str(ctx, |