[polly] r297449 - Update to isl-0.18-356-g0b05d01
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 10 01:17:56 PST 2017
Author: grosser
Date: Fri Mar 10 03:17:55 2017
New Revision: 297449
URL: http://llvm.org/viewvc/llvm-project?rev=297449&view=rev
Log:
Update to isl-0.18-356-g0b05d01
This is a regular maintenance update.
Modified:
polly/trunk/lib/External/isl/GIT_HEAD_ID
polly/trunk/lib/External/isl/include/isl/space.h
polly/trunk/lib/External/isl/isl_ilp.c
polly/trunk/lib/External/isl/isl_lp.c
polly/trunk/lib/External/isl/isl_map.c
polly/trunk/lib/External/isl/isl_map_lexopt_templ.c
polly/trunk/lib/External/isl/isl_map_private.h
polly/trunk/lib/External/isl/isl_map_simplify.c
polly/trunk/lib/External/isl/isl_multi_apply_templ.c
polly/trunk/lib/External/isl/isl_pw_templ.c
polly/trunk/lib/External/isl/isl_space.c
polly/trunk/lib/External/isl/isl_space_private.h
polly/trunk/lib/External/isl/isl_union_map.c
polly/trunk/lib/External/isl/isl_union_map_private.h
Modified: polly/trunk/lib/External/isl/GIT_HEAD_ID
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/GIT_HEAD_ID?rev=297449&r1=297448&r2=297449&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/GIT_HEAD_ID (original)
+++ polly/trunk/lib/External/isl/GIT_HEAD_ID Fri Mar 10 03:17:55 2017
@@ -1 +1 @@
-isl-0.18-336-g1e193d9
+isl-0.18-356-g0b05d01
Modified: polly/trunk/lib/External/isl/include/isl/space.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/space.h?rev=297449&r1=297448&r2=297449&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/include/isl/space.h (original)
+++ polly/trunk/lib/External/isl/include/isl/space.h Fri Mar 10 03:17:55 2017
@@ -80,10 +80,11 @@ __isl_give isl_space *isl_space_set_dim_
__isl_keep const char *isl_space_get_dim_name(__isl_keep isl_space *dim,
enum isl_dim_type type, unsigned pos);
+ISL_DEPRECATED
__isl_give isl_space *isl_space_extend(__isl_take isl_space *dim,
unsigned nparam, unsigned n_in, unsigned n_out);
-__isl_give isl_space *isl_space_add_dims(__isl_take isl_space *dim, enum isl_dim_type type,
- unsigned n);
+__isl_give isl_space *isl_space_add_dims(__isl_take isl_space *space,
+ enum isl_dim_type type, unsigned n);
__isl_give isl_space *isl_space_move_dims(__isl_take isl_space *dim,
enum isl_dim_type dst_type, unsigned dst_pos,
enum isl_dim_type src_type, unsigned src_pos, unsigned n);
Modified: polly/trunk/lib/External/isl/isl_ilp.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_ilp.c?rev=297449&r1=297448&r2=297449&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_ilp.c (original)
+++ polly/trunk/lib/External/isl/isl_ilp.c Fri Mar 10 03:17:55 2017
@@ -483,12 +483,15 @@ enum isl_lp_result isl_set_opt(__isl_kee
__isl_keep isl_aff *obj, isl_int *opt)
{
enum isl_lp_result res;
+ isl_bool aligned;
if (!set || !obj)
return isl_lp_error;
- if (isl_space_match(set->dim, isl_dim_param,
- obj->ls->dim, isl_dim_param))
+ aligned = isl_set_space_has_equal_params(set, obj->ls->dim);
+ if (aligned < 0)
+ return isl_lp_error;
+ if (aligned)
return isl_set_opt_aligned(set, max, obj, opt);
set = isl_set_copy(set);
Modified: polly/trunk/lib/External/isl/isl_lp.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_lp.c?rev=297449&r1=297448&r2=297449&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_lp.c (original)
+++ polly/trunk/lib/External/isl/isl_lp.c Fri Mar 10 03:17:55 2017
@@ -320,13 +320,16 @@ error:
static __isl_give isl_val *isl_basic_set_opt_lp_val(
__isl_keep isl_basic_set *bset, int max, __isl_keep isl_aff *obj)
{
+ isl_bool equal;
isl_val *res;
if (!bset || !obj)
return NULL;
- if (isl_space_match(bset->dim, isl_dim_param,
- obj->ls->dim, isl_dim_param))
+ equal = isl_basic_set_space_has_equal_params(bset, obj->ls->dim);
+ if (equal < 0)
+ return NULL;
+ if (equal)
return isl_basic_set_opt_lp_val_aligned(bset, max, obj);
bset = isl_basic_set_copy(bset);
Modified: polly/trunk/lib/External/isl/isl_map.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_map.c?rev=297449&r1=297448&r2=297449&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_map.c (original)
+++ polly/trunk/lib/External/isl/isl_map.c Fri Mar 10 03:17:55 2017
@@ -88,6 +88,13 @@ unsigned isl_basic_map_dim(__isl_keep is
}
}
+/* Return the space of "map".
+ */
+__isl_keep isl_space *isl_map_peek_space(__isl_keep const isl_map *map)
+{
+ return map ? map->dim : NULL;
+}
+
unsigned isl_map_dim(__isl_keep isl_map *map, enum isl_dim_type type)
{
return map ? n(map->dim, type) : 0;
@@ -202,13 +209,45 @@ unsigned isl_map_n_param(const struct is
return map ? map->dim->nparam : 0;
}
+/* Do "bmap1" and "bmap2" have the same parameters?
+ */
+static isl_bool isl_basic_map_has_equal_params(__isl_keep isl_basic_map *bmap1,
+ __isl_keep isl_basic_map *bmap2)
+{
+ isl_space *space1, *space2;
+
+ space1 = isl_basic_map_peek_space(bmap1);
+ space2 = isl_basic_map_peek_space(bmap2);
+ return isl_space_match(space1, isl_dim_param, space2, isl_dim_param);
+}
+
+/* Do "map1" and "map2" have the same parameters?
+ */
+isl_bool isl_map_has_equal_params(__isl_keep isl_map *map1,
+ __isl_keep isl_map *map2)
+{
+ isl_space *space1, *space2;
+
+ space1 = isl_map_peek_space(map1);
+ space2 = isl_map_peek_space(map2);
+ return isl_space_match(space1, isl_dim_param, space2, isl_dim_param);
+}
+
+/* Do "map" and "set" have the same parameters?
+ */
+static isl_bool isl_map_set_has_equal_params(__isl_keep isl_map *map,
+ __isl_keep isl_set *set)
+{
+ return isl_map_has_equal_params(map, set_to_map(set));
+}
+
isl_bool isl_map_compatible_domain(__isl_keep isl_map *map,
__isl_keep isl_set *set)
{
isl_bool m;
if (!map || !set)
return isl_bool_error;
- m = isl_space_match(map->dim, isl_dim_param, set->dim, isl_dim_param);
+ m = isl_map_has_equal_params(map, set_to_map(set));
if (m < 0 || !m)
return m;
return isl_space_tuple_is_equal(map->dim, isl_dim_in,
@@ -221,7 +260,7 @@ isl_bool isl_basic_map_compatible_domain
isl_bool m;
if (!bmap || !bset)
return isl_bool_error;
- m = isl_space_match(bmap->dim, isl_dim_param, bset->dim, isl_dim_param);
+ m = isl_basic_map_has_equal_params(bmap, bset_to_bmap(bset));
if (m < 0 || !m)
return m;
return isl_space_tuple_is_equal(bmap->dim, isl_dim_in,
@@ -234,7 +273,7 @@ isl_bool isl_map_compatible_range(__isl_
isl_bool m;
if (!map || !set)
return isl_bool_error;
- m = isl_space_match(map->dim, isl_dim_param, set->dim, isl_dim_param);
+ m = isl_map_has_equal_params(map, set_to_map(set));
if (m < 0 || !m)
return m;
return isl_space_tuple_is_equal(map->dim, isl_dim_out,
@@ -247,7 +286,7 @@ isl_bool isl_basic_map_compatible_range(
isl_bool m;
if (!bmap || !bset)
return isl_bool_error;
- m = isl_space_match(bmap->dim, isl_dim_param, bset->dim, isl_dim_param);
+ m = isl_basic_map_has_equal_params(bmap, bset_to_bmap(bset));
if (m < 0 || !m)
return m;
return isl_space_tuple_is_equal(bmap->dim, isl_dim_out,
@@ -274,18 +313,29 @@ isl_ctx *isl_set_get_ctx(__isl_keep isl_
return set ? set->ctx : NULL;
}
+/* Return the space of "bmap".
+ */
+__isl_keep isl_space *isl_basic_map_peek_space(
+ __isl_keep const isl_basic_map *bmap)
+{
+ return bmap ? bmap->dim : NULL;
+}
+
+/* Return the space of "bset".
+ */
+__isl_keep isl_space *isl_basic_set_peek_space(__isl_keep isl_basic_set *bset)
+{
+ return isl_basic_map_peek_space(bset_to_bmap(bset));
+}
+
__isl_give isl_space *isl_basic_map_get_space(__isl_keep isl_basic_map *bmap)
{
- if (!bmap)
- return NULL;
- return isl_space_copy(bmap->dim);
+ return isl_space_copy(isl_basic_map_peek_space(bmap));
}
__isl_give isl_space *isl_basic_set_get_space(__isl_keep isl_basic_set *bset)
{
- if (!bset)
- return NULL;
- return isl_space_copy(bset->dim);
+ return isl_basic_map_get_space(bset_to_bmap(bset));
}
/* Extract the divs in "bmap" as a matrix.
@@ -409,9 +459,7 @@ __isl_give isl_basic_set *isl_basic_set_
__isl_give isl_space *isl_map_get_space(__isl_keep isl_map *map)
{
- if (!map)
- return NULL;
- return isl_space_copy(map->dim);
+ return isl_space_copy(isl_map_peek_space(map));
}
__isl_give isl_space *isl_set_get_space(__isl_keep isl_set *set)
@@ -1211,6 +1259,31 @@ static int room_for_con(struct isl_basic
return bmap->n_eq + bmap->n_ineq + n <= bmap->c_size;
}
+/* Check that "map" has only named parameters, reporting an error
+ * if it does not.
+ */
+isl_stat isl_map_check_named_params(__isl_keep isl_map *map)
+{
+ return isl_space_check_named_params(isl_map_peek_space(map));
+}
+
+/* Check that "bmap1" and "bmap2" have the same parameters,
+ * reporting an error if they do not.
+ */
+static isl_stat isl_basic_map_check_equal_params(
+ __isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2)
+{
+ isl_bool match;
+
+ match = isl_basic_map_has_equal_params(bmap1, bmap2);
+ if (match < 0)
+ return isl_stat_error;
+ if (!match)
+ isl_die(isl_basic_map_get_ctx(bmap1), isl_error_invalid,
+ "parameters don't match", return isl_stat_error);
+ return isl_stat_ok;
+}
+
__isl_give isl_map *isl_map_align_params_map_map_and(
__isl_take isl_map *map1, __isl_take isl_map *map2,
__isl_give isl_map *(*fn)(__isl_take isl_map *map1,
@@ -1218,12 +1291,12 @@ __isl_give isl_map *isl_map_align_params
{
if (!map1 || !map2)
goto error;
- if (isl_space_match(map1->dim, isl_dim_param, map2->dim, isl_dim_param))
+ if (isl_map_has_equal_params(map1, map2))
return fn(map1, map2);
- if (!isl_space_has_named_params(map1->dim) ||
- !isl_space_has_named_params(map2->dim))
- isl_die(map1->ctx, isl_error_invalid,
- "unaligned unnamed parameters", goto error);
+ if (isl_map_check_named_params(map1) < 0)
+ goto error;
+ if (isl_map_check_named_params(map2) < 0)
+ goto error;
map1 = isl_map_align_params(map1, isl_map_get_space(map2));
map2 = isl_map_align_params(map2, isl_map_get_space(map1));
return fn(map1, map2);
@@ -1241,12 +1314,12 @@ isl_bool isl_map_align_params_map_map_an
if (!map1 || !map2)
return isl_bool_error;
- if (isl_space_match(map1->dim, isl_dim_param, map2->dim, isl_dim_param))
+ if (isl_map_has_equal_params(map1, map2))
return fn(map1, map2);
- if (!isl_space_has_named_params(map1->dim) ||
- !isl_space_has_named_params(map2->dim))
- isl_die(map1->ctx, isl_error_invalid,
- "unaligned unnamed parameters", return isl_bool_error);
+ if (isl_map_check_named_params(map1) < 0)
+ return isl_bool_error;
+ if (isl_map_check_named_params(map2) < 0)
+ return isl_bool_error;
map1 = isl_map_copy(map1);
map2 = isl_map_copy(map2);
map1 = isl_map_align_params(map1, isl_map_get_space(map2));
@@ -3035,12 +3108,9 @@ struct isl_basic_map *isl_basic_map_inte
{
struct isl_basic_map *bmap_domain;
- if (!bmap || !bset)
+ if (isl_basic_map_check_equal_params(bmap, bset_to_bmap(bset)) < 0)
goto error;
- isl_assert(bset->ctx, isl_space_match(bmap->dim, isl_dim_param,
- bset->dim, isl_dim_param), goto error);
-
if (isl_space_dim(bset->dim, isl_dim_set) != 0)
isl_assert(bset->ctx,
isl_basic_map_compatible_domain(bmap, bset), goto error);
@@ -3083,12 +3153,9 @@ struct isl_basic_map *isl_basic_map_inte
{
struct isl_basic_map *bmap_range;
- if (!bmap || !bset)
+ if (isl_basic_map_check_equal_params(bmap, bset_to_bmap(bset)) < 0)
goto error;
- isl_assert(bset->ctx, isl_space_match(bmap->dim, isl_dim_param,
- bset->dim, isl_dim_param), goto error);
-
if (isl_space_dim(bset->dim, isl_dim_set) != 0 &&
isl_basic_map_check_compatible_range(bmap, bset) < 0)
goto error;
@@ -3162,11 +3229,8 @@ struct isl_basic_map *isl_basic_map_inte
{
struct isl_vec *sample = NULL;
- if (!bmap1 || !bmap2)
+ if (isl_basic_map_check_equal_params(bmap1, bmap2) < 0)
goto error;
-
- isl_assert(bmap1->ctx, isl_space_match(bmap1->dim, isl_dim_param,
- bmap2->dim, isl_dim_param), goto error);
if (isl_space_dim(bmap1->dim, isl_dim_all) ==
isl_space_dim(bmap1->dim, isl_dim_param) &&
isl_space_dim(bmap2->dim, isl_dim_all) !=
@@ -4020,12 +4084,8 @@ struct isl_basic_map *isl_basic_map_appl
unsigned n_in, n_out, n, nparam, total, pos;
struct isl_dim_map *dim_map1, *dim_map2;
- if (!bmap1 || !bmap2)
+ if (isl_basic_map_check_equal_params(bmap1, bmap2) < 0)
goto error;
- if (!isl_space_match(bmap1->dim, isl_dim_param,
- bmap2->dim, isl_dim_param))
- isl_die(isl_basic_map_get_ctx(bmap1), isl_error_invalid,
- "parameters don't match", goto error);
if (!isl_space_tuple_is_equal(bmap1->dim, isl_dim_out,
bmap2->dim, isl_dim_in))
isl_die(isl_basic_map_get_ctx(bmap1), isl_error_invalid,
@@ -4087,13 +4147,8 @@ error:
struct isl_basic_map *isl_basic_map_apply_domain(
struct isl_basic_map *bmap1, struct isl_basic_map *bmap2)
{
- if (!bmap1 || !bmap2)
+ if (isl_basic_map_check_equal_params(bmap1, bmap2) < 0)
goto error;
-
- if (!isl_space_match(bmap1->dim, isl_dim_param,
- bmap2->dim, isl_dim_param))
- isl_die(isl_basic_map_get_ctx(bmap1), isl_error_invalid,
- "parameters don't match", goto error);
if (!isl_space_tuple_is_equal(bmap1->dim, isl_dim_in,
bmap2->dim, isl_dim_in))
isl_die(isl_basic_map_get_ctx(bmap1), isl_error_invalid,
@@ -5045,15 +5100,15 @@ __isl_give isl_basic_map *isl_basic_map_
__isl_take isl_basic_map *bmap, __isl_take isl_space *space)
{
isl_bool equal;
+ isl_space *bmap_space;
- if (!bmap)
- goto error;
- equal = isl_space_is_equal(bmap->dim, space);
+ bmap_space = isl_basic_map_peek_space(bmap);
+ equal = isl_space_is_equal(bmap_space, space);
if (equal >= 0 && equal)
- equal = isl_space_match(bmap->dim, isl_dim_in,
+ equal = isl_space_match(bmap_space, isl_dim_in,
space, isl_dim_in);
if (equal >= 0 && equal)
- equal = isl_space_match(bmap->dim, isl_dim_out,
+ equal = isl_space_match(bmap_space, isl_dim_out,
space, isl_dim_out);
if (equal < 0)
goto error;
@@ -9355,11 +9410,8 @@ struct isl_basic_map *isl_basic_map_prod
unsigned in1, in2, out1, out2, nparam, total, pos;
struct isl_dim_map *dim_map1, *dim_map2;
- if (!bmap1 || !bmap2)
+ if (isl_basic_map_check_equal_params(bmap1, bmap2) < 0)
goto error;
-
- isl_assert(bmap1->ctx, isl_space_match(bmap1->dim, isl_dim_param,
- bmap2->dim, isl_dim_param), goto error);
dim_result = isl_space_product(isl_space_copy(bmap1->dim),
isl_space_copy(bmap2->dim));
@@ -9471,10 +9523,8 @@ __isl_give isl_basic_map *isl_basic_map_
if (!bmap1 || !bmap2 || rational < 0)
goto error;
- if (!isl_space_match(bmap1->dim, isl_dim_param,
- bmap2->dim, isl_dim_param))
- isl_die(isl_basic_map_get_ctx(bmap1), isl_error_invalid,
- "parameters don't match", goto error);
+ if (isl_basic_map_check_equal_params(bmap1, bmap2) < 0)
+ goto error;
dim_result = isl_space_range_product(isl_space_copy(bmap1->dim),
isl_space_copy(bmap2->dim));
@@ -9542,12 +9592,14 @@ static __isl_give isl_map *map_product(_
unsigned flags = 0;
struct isl_map *result;
int i, j;
+ isl_bool m;
- if (!map1 || !map2)
+ m = isl_map_has_equal_params(map1, map2);
+ if (m < 0)
goto error;
-
- isl_assert(map1->ctx, isl_space_match(map1->dim, isl_dim_param,
- map2->dim, isl_dim_param), goto error);
+ if (!m)
+ isl_die(isl_map_get_ctx(map1), isl_error_invalid,
+ "parameters don't match", goto error);
if (ISL_F_ISSET(map1, ISL_MAP_DISJOINT) &&
ISL_F_ISSET(map2, ISL_MAP_DISJOINT))
@@ -11134,6 +11186,7 @@ __isl_give isl_map *isl_map_align_params
__isl_take isl_space *model)
{
isl_ctx *ctx;
+ isl_bool aligned;
if (!map || !model)
goto error;
@@ -11142,10 +11195,12 @@ __isl_give isl_map *isl_map_align_params
if (!isl_space_has_named_params(model))
isl_die(ctx, isl_error_invalid,
"model has unnamed parameters", goto error);
- if (!isl_space_has_named_params(map->dim))
- isl_die(ctx, isl_error_invalid,
- "relation has unnamed parameters", goto error);
- if (!isl_space_match(map->dim, isl_dim_param, model, isl_dim_param)) {
+ if (isl_map_check_named_params(map) < 0)
+ goto error;
+ aligned = isl_map_space_has_equal_params(map, model);
+ if (aligned < 0)
+ goto error;
+ if (!aligned) {
isl_reordering *exp;
model = isl_space_drop_dims(model, isl_dim_in,
@@ -11216,6 +11271,36 @@ error:
return NULL;
}
+/* Do "bset" and "space" have the same parameters?
+ */
+isl_bool isl_basic_set_space_has_equal_params(__isl_keep isl_basic_set *bset,
+ __isl_keep isl_space *space)
+{
+ isl_space *bset_space;
+
+ bset_space = isl_basic_set_peek_space(bset);
+ return isl_space_match(bset_space, isl_dim_param, space, isl_dim_param);
+}
+
+/* Do "map" and "space" have the same parameters?
+ */
+isl_bool isl_map_space_has_equal_params(__isl_keep isl_map *map,
+ __isl_keep isl_space *space)
+{
+ isl_space *map_space;
+
+ map_space = isl_map_peek_space(map);
+ return isl_space_match(map_space, isl_dim_param, space, isl_dim_param);
+}
+
+/* Do "set" and "space" have the same parameters?
+ */
+isl_bool isl_set_space_has_equal_params(__isl_keep isl_set *set,
+ __isl_keep isl_space *space)
+{
+ return isl_map_space_has_equal_params(set_to_map(set), space);
+}
+
/* Align the parameters of "bset" to those of "model", introducing
* additional parameters if needed.
*/
@@ -12623,14 +12708,20 @@ error:
__isl_give isl_map *isl_map_preimage_multi_aff(__isl_take isl_map *map,
enum isl_dim_type type, __isl_take isl_multi_aff *ma)
{
+ isl_bool aligned;
+
if (!map || !ma)
goto error;
- if (isl_space_match(map->dim, isl_dim_param, ma->space, isl_dim_param))
+ aligned = isl_map_space_has_equal_params(map, ma->space);
+ if (aligned < 0)
+ goto error;
+ if (aligned)
return map_preimage_multi_aff(map, type, ma);
- if (!isl_space_has_named_params(map->dim) ||
- !isl_space_has_named_params(ma->space))
+ if (isl_map_check_named_params(map) < 0)
+ goto error;
+ if (!isl_space_has_named_params(ma->space))
isl_die(map->ctx, isl_error_invalid,
"unaligned unnamed parameters", goto error);
map = isl_map_align_params(map, isl_multi_aff_get_space(ma));
@@ -12742,14 +12833,20 @@ error:
__isl_give isl_map *isl_map_preimage_pw_multi_aff(__isl_take isl_map *map,
enum isl_dim_type type, __isl_take isl_pw_multi_aff *pma)
{
+ isl_bool aligned;
+
if (!map || !pma)
goto error;
- if (isl_space_match(map->dim, isl_dim_param, pma->dim, isl_dim_param))
+ aligned = isl_map_space_has_equal_params(map, pma->dim);
+ if (aligned < 0)
+ goto error;
+ if (aligned)
return isl_map_preimage_pw_multi_aff_aligned(map, type, pma);
- if (!isl_space_has_named_params(map->dim) ||
- !isl_space_has_named_params(pma->dim))
+ if (isl_map_check_named_params(map) < 0)
+ goto error;
+ if (!isl_space_has_named_params(pma->dim))
isl_die(map->ctx, isl_error_invalid,
"unaligned unnamed parameters", goto error);
map = isl_map_align_params(map, isl_pw_multi_aff_get_space(pma));
Modified: polly/trunk/lib/External/isl/isl_map_lexopt_templ.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_map_lexopt_templ.c?rev=297449&r1=297448&r2=297449&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_map_lexopt_templ.c (original)
+++ polly/trunk/lib/External/isl/isl_map_lexopt_templ.c Fri Mar 10 03:17:55 2017
@@ -173,9 +173,12 @@ static __isl_give TYPE *SF(isl_map_parti
__isl_take isl_map *map, __isl_take isl_set *dom,
__isl_give isl_set **empty, unsigned flags)
{
- if (!map || !dom)
+ isl_bool aligned;
+
+ aligned = isl_map_set_has_equal_params(map, dom);
+ if (aligned < 0)
goto error;
- if (isl_space_match(map->dim, isl_dim_param, dom->dim, isl_dim_param))
+ if (aligned)
return SF(isl_map_partial_lexopt_aligned,SUFFIX)(map, dom,
empty, flags);
if (!isl_space_has_named_params(map->dim) ||
Modified: polly/trunk/lib/External/isl/isl_map_private.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_map_private.h?rev=297449&r1=297448&r2=297449&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_map_private.h (original)
+++ polly/trunk/lib/External/isl/isl_map_private.h Fri Mar 10 03:17:55 2017
@@ -164,6 +164,10 @@ __isl_give isl_set *isl_set_realign(__is
__isl_give isl_map *isl_map_reset(__isl_take isl_map *map,
enum isl_dim_type type);
+__isl_keep isl_space *isl_basic_map_peek_space(
+ __isl_keep const isl_basic_map *bmap);
+__isl_keep isl_space *isl_basic_set_peek_space(__isl_keep isl_basic_set *bset);
+
__isl_give isl_basic_set *isl_basic_set_reset_space(
__isl_take isl_basic_set *bset, __isl_take isl_space *dim);
__isl_give isl_basic_map *isl_basic_map_reset_space(
@@ -430,6 +434,17 @@ __isl_give isl_mat *isl_basic_map_get_di
__isl_give isl_map *isl_map_inline_foreach_basic_map(__isl_take isl_map *map,
__isl_give isl_basic_map *(*fn)(__isl_take isl_basic_map *bmap));
+isl_stat isl_map_check_named_params(__isl_keep isl_map *map);
+
+isl_bool isl_map_has_equal_params(__isl_keep isl_map *map1,
+ __isl_keep isl_map *map2);
+isl_bool isl_basic_set_space_has_equal_params(__isl_keep isl_basic_set *bset,
+ __isl_keep isl_space *space);
+isl_bool isl_set_space_has_equal_params(__isl_keep isl_set *set,
+ __isl_keep isl_space *space);
+isl_bool isl_map_space_has_equal_params(__isl_keep isl_map *map,
+ __isl_keep isl_space *space);
+
__isl_give isl_map *isl_map_align_params_map_map_and(
__isl_take isl_map *map1, __isl_take isl_map *map2,
__isl_give isl_map *(*fn)(__isl_take isl_map *map1,
Modified: polly/trunk/lib/External/isl/isl_map_simplify.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_map_simplify.c?rev=297449&r1=297448&r2=297449&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_map_simplify.c (original)
+++ polly/trunk/lib/External/isl/isl_map_simplify.c Fri Mar 10 03:17:55 2017
@@ -3936,8 +3936,7 @@ isl_bool isl_map_plain_is_disjoint(__isl
if (disjoint < 0 || disjoint)
return disjoint;
- match = isl_space_match(map1->dim, isl_dim_param,
- map2->dim, isl_dim_param);
+ match = isl_map_has_equal_params(map1, map2);
if (match < 0 || !match)
return match < 0 ? isl_bool_error : isl_bool_false;
Modified: polly/trunk/lib/External/isl/isl_multi_apply_templ.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_multi_apply_templ.c?rev=297449&r1=297448&r2=297449&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_multi_apply_templ.c (original)
+++ polly/trunk/lib/External/isl/isl_multi_apply_templ.c Fri Mar 10 03:17:55 2017
@@ -56,13 +56,16 @@ static __isl_give MULTI(BASE) *FN(FN(MUL
__isl_take MULTI(BASE) *multi, __isl_take APPLY_DOM *set,
__isl_give EL *(*fn)(EL *el, __isl_take APPLY_DOM *set))
{
+ isl_bool aligned;
isl_ctx *ctx;
if (!multi || !set)
goto error;
- if (isl_space_match(multi->space, isl_dim_param,
- set->dim, isl_dim_param))
+ aligned = FN(APPLY_DOM,space_has_equal_params)(set, multi->space);
+ if (aligned < 0)
+ goto error;
+ if (aligned)
return FN(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi,
set, fn);
ctx = FN(MULTI(BASE),get_ctx)(multi);
Modified: polly/trunk/lib/External/isl/isl_pw_templ.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_pw_templ.c?rev=297449&r1=297448&r2=297449&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_pw_templ.c (original)
+++ polly/trunk/lib/External/isl/isl_pw_templ.c Fri Mar 10 03:17:55 2017
@@ -330,10 +330,14 @@ static __isl_give PW *FN(PW,align_params
__isl_give PW *(*fn)(__isl_take PW *pw, __isl_take isl_set *set))
{
isl_ctx *ctx;
+ isl_bool aligned;
if (!pw || !set)
goto error;
- if (isl_space_match(pw->dim, isl_dim_param, set->dim, isl_dim_param))
+ aligned = isl_set_space_has_equal_params(set, pw->dim);
+ if (aligned < 0)
+ goto error;
+ if (aligned)
return fn(pw, set);
ctx = FN(PW,get_ctx)(pw);
if (!isl_space_has_named_params(pw->dim) ||
@@ -935,6 +939,7 @@ static __isl_give PW *FN(PW,gist_aligned
{
int i;
int is_universe;
+ isl_bool aligned;
isl_basic_set *hull = NULL;
if (!pw || !context)
@@ -953,8 +958,10 @@ static __isl_give PW *FN(PW,gist_aligned
return pw;
}
- if (!isl_space_match(pw->dim, isl_dim_param,
- context->dim, isl_dim_param)) {
+ aligned = isl_set_space_has_equal_params(context, pw->dim);
+ if (aligned < 0)
+ goto error;
+ if (!aligned) {
pw = FN(PW,align_params)(pw, isl_set_get_space(context));
context = isl_set_align_params(context, FN(PW,get_space)(pw));
}
Modified: polly/trunk/lib/External/isl/isl_space.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_space.c?rev=297449&r1=297448&r2=297449&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_space.c (original)
+++ polly/trunk/lib/External/isl/isl_space.c Fri Mar 10 03:17:55 2017
@@ -869,7 +869,7 @@ static void get_ids(__isl_keep isl_space
ids[i] = get_id(dim, type, first + i);
}
-__isl_give isl_space *isl_space_extend(__isl_take isl_space *space,
+static __isl_give isl_space *space_extend(__isl_take isl_space *space,
unsigned nparam, unsigned n_in, unsigned n_out)
{
isl_id **ids = NULL;
@@ -917,37 +917,43 @@ error:
return NULL;
}
-__isl_give isl_space *isl_space_add_dims(__isl_take isl_space *dim,
+__isl_give isl_space *isl_space_extend(__isl_take isl_space *space,
+ unsigned nparam, unsigned n_in, unsigned n_out)
+{
+ return space_extend(space, nparam, n_in, n_out);
+}
+
+__isl_give isl_space *isl_space_add_dims(__isl_take isl_space *space,
enum isl_dim_type type, unsigned n)
{
- dim = isl_space_reset(dim, type);
- if (!dim)
+ space = isl_space_reset(space, type);
+ if (!space)
return NULL;
switch (type) {
case isl_dim_param:
- dim = isl_space_extend(dim,
- dim->nparam + n, dim->n_in, dim->n_out);
- if (dim && dim->nested[0] &&
- !(dim->nested[0] = isl_space_add_dims(dim->nested[0],
+ space = space_extend(space,
+ space->nparam + n, space->n_in, space->n_out);
+ if (space && space->nested[0] &&
+ !(space->nested[0] = isl_space_add_dims(space->nested[0],
isl_dim_param, n)))
goto error;
- if (dim && dim->nested[1] &&
- !(dim->nested[1] = isl_space_add_dims(dim->nested[1],
+ if (space && space->nested[1] &&
+ !(space->nested[1] = isl_space_add_dims(space->nested[1],
isl_dim_param, n)))
goto error;
- return dim;
+ return space;
case isl_dim_in:
- return isl_space_extend(dim,
- dim->nparam, dim->n_in + n, dim->n_out);
+ return space_extend(space,
+ space->nparam, space->n_in + n, space->n_out);
case isl_dim_out:
- return isl_space_extend(dim,
- dim->nparam, dim->n_in, dim->n_out + n);
+ return space_extend(space,
+ space->nparam, space->n_in, space->n_out + n);
default:
- isl_die(dim->ctx, isl_error_invalid,
+ isl_die(space->ctx, isl_error_invalid,
"cannot add dimensions of specified type", goto error);
}
error:
- isl_space_free(dim);
+ isl_space_free(space);
return NULL;
}
@@ -2359,6 +2365,23 @@ isl_bool isl_space_has_named_params(__is
return isl_bool_true;
}
+/* Check that "space" has only named parameters, reporting an error
+ * if it does not.
+ */
+isl_stat isl_space_check_named_params(__isl_keep isl_space *space)
+{
+ isl_bool named;
+
+ named = isl_space_has_named_params(space);
+ if (named < 0)
+ return isl_stat_error;
+ if (!named)
+ isl_die(isl_space_get_ctx(space), isl_error_invalid,
+ "unaligned unnamed parameters", return isl_stat_error);
+
+ return isl_stat_ok;
+}
+
/* Align the initial parameters of dim1 to match the order in dim2.
*/
__isl_give isl_space *isl_space_align_params(__isl_take isl_space *dim1,
Modified: polly/trunk/lib/External/isl/isl_space_private.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_space_private.h?rev=297449&r1=297448&r2=297449&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_space_private.h (original)
+++ polly/trunk/lib/External/isl/isl_space_private.h Fri Mar 10 03:17:55 2017
@@ -41,6 +41,7 @@ isl_bool isl_space_may_be_set(__isl_keep
isl_bool isl_space_is_named_or_nested(__isl_keep isl_space *space,
enum isl_dim_type type);
isl_bool isl_space_has_named_params(__isl_keep isl_space *space);
+isl_stat isl_space_check_named_params(__isl_keep isl_space *space);
__isl_give isl_space *isl_space_reset(__isl_take isl_space *dim,
enum isl_dim_type type);
__isl_give isl_space *isl_space_flatten(__isl_take isl_space *dim);
Modified: polly/trunk/lib/External/isl/isl_union_map.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_union_map.c?rev=297449&r1=297448&r2=297449&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_union_map.c (original)
+++ polly/trunk/lib/External/isl/isl_union_map.c Fri Mar 10 03:17:55 2017
@@ -130,11 +130,16 @@ isl_ctx *isl_union_set_get_ctx(__isl_kee
return uset ? uset->dim->ctx : NULL;
}
+/* Return the space of "umap".
+ */
+__isl_keep isl_space *isl_union_map_peek_space(__isl_keep isl_union_map *umap)
+{
+ return umap ? umap->dim : NULL;
+}
+
__isl_give isl_space *isl_union_map_get_space(__isl_keep isl_union_map *umap)
{
- if (!umap)
- return NULL;
- return isl_space_copy(umap->dim);
+ return isl_space_copy(isl_union_map_peek_space(umap));
}
/* Return the position of the parameter with the given name
@@ -328,6 +333,17 @@ __isl_null isl_union_set *isl_union_set_
return isl_union_map_free(uset);
}
+/* Do "umap" and "space" have the same parameters?
+ */
+isl_bool isl_union_map_space_has_equal_params(__isl_keep isl_union_map *umap,
+ __isl_keep isl_space *space)
+{
+ isl_space *umap_space;
+
+ umap_space = isl_union_map_peek_space(umap);
+ return isl_space_match(umap_space, isl_dim_param, space, isl_dim_param);
+}
+
static int has_dim(const void *entry, const void *val)
{
isl_map *map = (isl_map *)entry;
@@ -341,6 +357,7 @@ __isl_give isl_union_map *isl_union_map_
{
uint32_t hash;
struct isl_hash_table_entry *entry;
+ isl_bool aligned;
if (!map || !umap)
goto error;
@@ -350,7 +367,10 @@ __isl_give isl_union_map *isl_union_map_
return umap;
}
- if (!isl_space_match(map->dim, isl_dim_param, umap->dim, isl_dim_param)) {
+ aligned = isl_map_space_has_equal_params(map, umap->dim);
+ if (aligned < 0)
+ goto error;
+ if (!aligned) {
umap = isl_union_map_align_params(umap, isl_map_get_space(map));
map = isl_map_align_params(map, isl_union_map_get_space(umap));
}
Modified: polly/trunk/lib/External/isl/isl_union_map_private.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_union_map_private.h?rev=297449&r1=297448&r2=297449&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_union_map_private.h (original)
+++ polly/trunk/lib/External/isl/isl_union_map_private.h Fri Mar 10 03:17:55 2017
@@ -10,5 +10,7 @@ struct isl_union_map {
struct isl_hash_table table;
};
+isl_bool isl_union_map_space_has_equal_params(__isl_keep isl_union_map *umap,
+ __isl_keep isl_space *space);
__isl_give isl_union_map *isl_union_map_reset_range_space(
__isl_take isl_union_map *umap, __isl_take isl_space *space);
More information about the llvm-commits
mailing list