[polly] r237616 - Update isl to 6be6768e
Tobias Grosser
tobias at grosser.es
Mon May 18 14:29:58 PDT 2015
Author: grosser
Date: Mon May 18 16:29:58 2015
New Revision: 237616
URL: http://llvm.org/viewvc/llvm-project?rev=237616&view=rev
Log:
Update isl to 6be6768e
Besides a couple of interface cleanups, this change also contains a performance
optimization of isl_mat_product that should give us up to almost 6% compiletime
reduction.
Modified:
polly/trunk/lib/External/isl/doc/user.pod
polly/trunk/lib/External/isl/include/isl/map.h
polly/trunk/lib/External/isl/include/isl/polynomial.h
polly/trunk/lib/External/isl/include/isl/set.h
polly/trunk/lib/External/isl/isl_affine_hull.c
polly/trunk/lib/External/isl/isl_ast_codegen.c
polly/trunk/lib/External/isl/isl_convex_hull.c
polly/trunk/lib/External/isl/isl_flow.c
polly/trunk/lib/External/isl/isl_fold.c
polly/trunk/lib/External/isl/isl_ilp.c
polly/trunk/lib/External/isl/isl_input.c
polly/trunk/lib/External/isl/isl_map.c
polly/trunk/lib/External/isl/isl_map_subtract.c
polly/trunk/lib/External/isl/isl_mat.c
polly/trunk/lib/External/isl/isl_polynomial.c
polly/trunk/lib/External/isl/isl_sample.c
polly/trunk/lib/External/isl/isl_union_map.c
Modified: polly/trunk/lib/External/isl/doc/user.pod
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/doc/user.pod?rev=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/doc/user.pod (original)
+++ polly/trunk/lib/External/isl/doc/user.pod Mon May 18 16:29:58 2015
@@ -3606,6 +3606,7 @@ is already known to be empty.
int isl_basic_set_is_universe(__isl_keep isl_basic_set *bset);
int isl_basic_map_is_universe(__isl_keep isl_basic_map *bmap);
int isl_set_plain_is_universe(__isl_keep isl_set *set);
+ int isl_map_plain_is_universe(__isl_keep isl_map *map);
=item * Single-valuedness
@@ -3815,6 +3816,10 @@ Check whether the given expression is a
int isl_aff_is_nan(__isl_keep isl_aff *aff);
int isl_pw_aff_involves_nan(__isl_keep isl_pw_aff *pa);
+ #include <isl/polynomial.h>
+ int isl_qpolynomial_fold_is_nan(
+ __isl_keep isl_qpolynomial_fold *fold);
+
Check whether the given expression is equal to or involves NaN.
#include <isl/aff.h>
@@ -3841,6 +3846,9 @@ return true if the objects are not the s
int isl_basic_set_plain_is_equal(
__isl_keep isl_basic_set *bset1,
__isl_keep isl_basic_set *bset2);
+ int isl_basic_set_is_equal(
+ __isl_keep isl_basic_set *bset1,
+ __isl_keep isl_basic_set *bset2);
int isl_set_plain_is_equal(__isl_keep isl_set *set1,
__isl_keep isl_set *set2);
int isl_set_is_equal(__isl_keep isl_set *set1,
Modified: polly/trunk/lib/External/isl/include/isl/map.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/map.h?rev=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/include/isl/map.h (original)
+++ polly/trunk/lib/External/isl/include/isl/map.h Mon May 18 16:29:58 2015
@@ -119,7 +119,6 @@ struct isl_basic_map *isl_basic_map_allo
unsigned nparam, unsigned in, unsigned out, unsigned extra,
unsigned n_eq, unsigned n_ineq);
__isl_give isl_basic_map *isl_basic_map_identity(__isl_take isl_space *dim);
-struct isl_basic_map *isl_basic_map_identity_like(struct isl_basic_map *model);
struct isl_basic_map *isl_basic_map_finalize(struct isl_basic_map *bmap);
__isl_null isl_basic_map *isl_basic_map_free(__isl_take isl_basic_map *bmap);
__isl_give isl_basic_map *isl_basic_map_copy(__isl_keep isl_basic_map *bmap);
@@ -135,12 +134,8 @@ __isl_give isl_basic_map *isl_basic_map_
__isl_give isl_basic_map *isl_basic_map_more_at(__isl_take isl_space *dim,
unsigned pos);
__isl_give isl_basic_map *isl_basic_map_empty(__isl_take isl_space *dim);
-struct isl_basic_map *isl_basic_map_empty_like(struct isl_basic_map *model);
-struct isl_basic_map *isl_basic_map_empty_like_map(struct isl_map *model);
__isl_give isl_basic_map *isl_basic_map_universe(__isl_take isl_space *dim);
__isl_give isl_basic_map *isl_basic_map_nat_universe(__isl_take isl_space *dim);
-__isl_give isl_basic_map *isl_basic_map_universe_like(
- __isl_keep isl_basic_map *bmap);
__isl_give isl_basic_map *isl_basic_map_remove_redundancies(
__isl_take isl_basic_map *bmap);
__isl_give isl_map *isl_map_remove_redundancies(__isl_take isl_map *map);
@@ -309,14 +304,10 @@ struct isl_map *isl_map_alloc(struct isl
__isl_give isl_map *isl_map_universe(__isl_take isl_space *dim);
__isl_give isl_map *isl_map_nat_universe(__isl_take isl_space *dim);
__isl_give isl_map *isl_map_empty(__isl_take isl_space *dim);
-struct isl_map *isl_map_empty_like(struct isl_map *model);
-struct isl_map *isl_map_empty_like_basic_map(struct isl_basic_map *model);
struct isl_map *isl_map_dup(struct isl_map *map);
__isl_give isl_map *isl_map_add_basic_map(__isl_take isl_map *map,
__isl_take isl_basic_map *bmap);
__isl_give isl_map *isl_map_identity(__isl_take isl_space *dim);
-struct isl_map *isl_map_identity_like(struct isl_map *model);
-struct isl_map *isl_map_identity_like_basic_map(struct isl_basic_map *model);
__isl_give isl_map *isl_map_lex_lt_first(__isl_take isl_space *dim, unsigned n);
__isl_give isl_map *isl_map_lex_le_first(__isl_take isl_space *dim, unsigned n);
__isl_give isl_map *isl_map_lex_lt(__isl_take isl_space *set_dim);
Modified: polly/trunk/lib/External/isl/include/isl/polynomial.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/polynomial.h?rev=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/include/isl/polynomial.h (original)
+++ polly/trunk/lib/External/isl/include/isl/polynomial.h Mon May 18 16:29:58 2015
@@ -279,6 +279,7 @@ __isl_give isl_qpolynomial_fold *isl_qpo
void isl_qpolynomial_fold_free(__isl_take isl_qpolynomial_fold *fold);
int isl_qpolynomial_fold_is_empty(__isl_keep isl_qpolynomial_fold *fold);
+int isl_qpolynomial_fold_is_nan(__isl_keep isl_qpolynomial_fold *fold);
int isl_qpolynomial_fold_plain_is_equal(__isl_keep isl_qpolynomial_fold *fold1,
__isl_keep isl_qpolynomial_fold *fold2);
Modified: polly/trunk/lib/External/isl/include/isl/set.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/set.h?rev=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/include/isl/set.h (original)
+++ polly/trunk/lib/External/isl/include/isl/set.h Mon May 18 16:29:58 2015
@@ -101,12 +101,8 @@ __isl_null isl_basic_set *isl_basic_set_
__isl_give isl_basic_set *isl_basic_set_copy(__isl_keep isl_basic_set *bset);
struct isl_basic_set *isl_basic_set_dup(struct isl_basic_set *bset);
__isl_give isl_basic_set *isl_basic_set_empty(__isl_take isl_space *dim);
-struct isl_basic_set *isl_basic_set_empty_like(struct isl_basic_set *bset);
__isl_give isl_basic_set *isl_basic_set_universe(__isl_take isl_space *dim);
__isl_give isl_basic_set *isl_basic_set_nat_universe(__isl_take isl_space *dim);
-struct isl_basic_set *isl_basic_set_universe_like(struct isl_basic_set *bset);
-__isl_give isl_basic_set *isl_basic_set_universe_like_set(
- __isl_keep isl_set *model);
__isl_give isl_basic_set *isl_basic_set_positive_orthant(
__isl_take isl_space *space);
void isl_basic_set_print_internal(__isl_keep isl_basic_set *bset,
@@ -254,10 +250,8 @@ struct isl_set *isl_set_alloc(struct isl
struct isl_set *isl_set_extend(struct isl_set *base,
unsigned nparam, unsigned dim);
__isl_give isl_set *isl_set_empty(__isl_take isl_space *dim);
-struct isl_set *isl_set_empty_like(struct isl_set *set);
__isl_give isl_set *isl_set_universe(__isl_take isl_space *dim);
__isl_give isl_set *isl_set_nat_universe(__isl_take isl_space *dim);
-__isl_give isl_set *isl_set_universe_like(__isl_keep isl_set *model);
__isl_give isl_set *isl_set_add_basic_set(__isl_take isl_set *set,
__isl_take isl_basic_set *bset);
struct isl_set *isl_set_finalize(struct isl_set *set);
Modified: polly/trunk/lib/External/isl/isl_affine_hull.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_affine_hull.c?rev=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_affine_hull.c (original)
+++ polly/trunk/lib/External/isl/isl_affine_hull.c Mon May 18 16:29:58 2015
@@ -1005,11 +1005,11 @@ static struct isl_basic_set *uset_affine
if (!cone)
goto error;
if (cone->n_eq == 0) {
- struct isl_basic_set *hull;
+ isl_space *space;
+ space = isl_basic_set_get_space(bset);
isl_basic_set_free(cone);
- hull = isl_basic_set_universe_like(bset);
isl_basic_set_free(bset);
- return hull;
+ return isl_basic_set_universe(space);
}
if (cone->n_eq < isl_basic_set_total_dim(cone))
@@ -1346,6 +1346,18 @@ static __isl_give isl_set *isl_set_local
return isl_map_local_affine_hull(set);
}
+/* Return an empty basic map living in the same space as "map".
+ */
+static __isl_give isl_basic_map *replace_map_by_empty_basic_map(
+ __isl_take isl_map *map)
+{
+ isl_space *space;
+
+ space = isl_map_get_space(map);
+ isl_map_free(map);
+ return isl_basic_map_empty(space);
+}
+
/* Compute the affine hull of "map".
*
* We first compute the affine hull of each basic map separately.
@@ -1381,11 +1393,8 @@ __isl_give isl_basic_map *isl_map_affine
if (!map)
return NULL;
- if (map->n == 0) {
- hull = isl_basic_map_empty_like_map(map);
- isl_map_free(map);
- return hull;
- }
+ if (map->n == 0)
+ return replace_map_by_empty_basic_map(map);
model = isl_basic_map_copy(map->p[0]);
set = isl_map_underlying_set(map);
Modified: polly/trunk/lib/External/isl/isl_ast_codegen.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_ast_codegen.c?rev=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_ast_codegen.c (original)
+++ polly/trunk/lib/External/isl/isl_ast_codegen.c Mon May 18 16:29:58 2015
@@ -2576,10 +2576,9 @@ static int foreach_iteration(__isl_take
lower = find_unroll_lower_bound(build, domain, depth, bmap, &n);
if (!lower)
- domain = isl_set_free(domain);
-
- if (init && init(n, user) < 0)
- domain = isl_set_free(domain);
+ n = -1;
+ else if (init && init(n, user) < 0)
+ n = -1;
for (i = 0; i < n; ++i) {
isl_set *set;
isl_basic_set *bset;
@@ -2600,7 +2599,7 @@ static int foreach_iteration(__isl_take
isl_set_free(domain);
isl_basic_map_free(bmap);
- return i < n ? -1 : 0;
+ return n < 0 || i < n ? -1 : 0;
}
/* Data structure for storing the results and the intermediate objects
@@ -3263,7 +3262,7 @@ error:
/* Generate code for a single component, after shifting (if any)
* has been applied, in case the schedule was specified as a schedule tree.
- * In particular, do so for the specified subset of the schedule domsain.
+ * In particular, do so for the specified subset of the schedule domain.
*/
static __isl_give isl_ast_graft_list *generate_shifted_component_tree_part(
__isl_keep isl_union_map *executed, __isl_take isl_set *domain,
@@ -3295,8 +3294,8 @@ error:
/* Generate code for a single component, after shifting (if any)
* has been applied, in case the schedule was specified as a schedule tree.
*
- * We first check if the user has specified a (non-empty) isolated
- * schedule domain.
+ * We first check if the user has specified an isolated schedule domain
+ * and that we are not already outside of this isolated schedule domain.
* If so, we break up the schedule domain into iterations that
* precede the isolated domain, the isolated domain itself,
* the iterations that follow the isolated domain and
@@ -3315,7 +3314,7 @@ static __isl_give isl_ast_graft_list *ge
isl_union_set *schedule_domain;
isl_set *domain;
isl_basic_set *hull;
- isl_set *isolated, *before, *after;
+ isl_set *isolated, *before, *after, *test;
isl_map *gt, *lt;
isl_ast_graft_list *list, *res;
@@ -3331,7 +3330,9 @@ static __isl_give isl_ast_graft_list *ge
isolated = isl_ast_build_get_isolated(build);
isolated = isl_set_intersect(isolated, isl_set_copy(domain));
- empty = isl_set_is_empty(isolated);
+ test = isl_ast_build_specialize(build, isl_set_copy(isolated));
+ empty = isl_set_is_empty(test);
+ isl_set_free(test);
if (empty < 0)
goto error;
if (empty) {
@@ -5225,8 +5226,6 @@ static int before_each_mark(__isl_keep i
/* Call the after_each_mark callback, if requested by the user.
*
- * Return 0 on success and -1 on error.
- *
* The caller is responsible for recording the current inverse schedule
* in "build".
*/
Modified: polly/trunk/lib/External/isl/isl_convex_hull.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_convex_hull.c?rev=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_convex_hull.c (original)
+++ polly/trunk/lib/External/isl/isl_convex_hull.c Mon May 18 16:29:58 2015
@@ -1914,6 +1914,18 @@ error:
return NULL;
}
+/* Return an empty basic map living in the same space as "map".
+ */
+static __isl_give isl_basic_map *replace_map_by_empty_basic_map(
+ __isl_take isl_map *map)
+{
+ isl_space *space;
+
+ space = isl_map_get_space(map);
+ isl_map_free(map);
+ return isl_basic_map_empty(space);
+}
+
/* Compute the convex hull of a map.
*
* The implementation was inspired by "Extended Convex Hull" by Fukuda et al.,
@@ -1932,11 +1944,8 @@ struct isl_basic_map *isl_map_convex_hul
if (!map)
goto error;
- if (map->n == 0) {
- convex_hull = isl_basic_map_empty_like_map(map);
- isl_map_free(map);
- return convex_hull;
- }
+ if (map->n == 0)
+ return replace_map_by_empty_basic_map(map);
model = isl_basic_map_copy(map->p[0]);
set = isl_map_underlying_set(map);
@@ -2330,11 +2339,8 @@ static __isl_give isl_basic_map *map_sim
if (!map)
return NULL;
- if (map->n == 0) {
- hull = isl_basic_map_empty_like_map(map);
- isl_map_free(map);
- return hull;
- }
+ if (map->n == 0)
+ return replace_map_by_empty_basic_map(map);
if (map->n == 1) {
hull = isl_basic_map_copy(map->p[0]);
isl_map_free(map);
Modified: polly/trunk/lib/External/isl/isl_flow.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_flow.c?rev=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_flow.c (original)
+++ polly/trunk/lib/External/isl/isl_flow.c Mon May 18 16:29:58 2015
@@ -935,7 +935,7 @@ static __isl_give isl_flow *compute_val_
depth = 2 * isl_map_dim(acc->sink.map, isl_dim_in) + 1;
mustdo = isl_map_domain(isl_map_copy(acc->sink.map));
- maydo = isl_set_empty_like(mustdo);
+ maydo = isl_set_empty(isl_set_get_space(mustdo));
if (!mustdo || !maydo)
goto error;
if (isl_set_plain_is_empty(mustdo))
@@ -948,7 +948,9 @@ static __isl_give isl_flow *compute_val_
for (level = depth; level >= 1; --level) {
for (j = acc->n_must-1; j >=0; --j) {
- must_rel[j] = isl_map_empty_like(res->dep[2 * j].map);
+ isl_space *space;
+ space = isl_map_get_space(res->dep[2 * j].map);
+ must_rel[j] = isl_map_empty(space);
may_rel[j] = isl_map_copy(must_rel[j]);
}
Modified: polly/trunk/lib/External/isl/isl_fold.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_fold.c?rev=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_fold.c (original)
+++ polly/trunk/lib/External/isl/isl_fold.c Mon May 18 16:29:58 2015
@@ -406,6 +406,14 @@ static int isl_qpolynomial_sign(__isl_ke
return sgn;
}
+/* Combine "fold1" and "fold2" into a single reduction, eliminating
+ * those elements of one reduction that are already covered by the other
+ * reduction on "set".
+ *
+ * If "fold1" or "fold2" is an empty reduction, then return
+ * the other reduction.
+ * If "fold1" or "fold2" is a NaN, then return this NaN.
+ */
__isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_fold_on_domain(
__isl_keep isl_set *set,
__isl_take isl_qpolynomial_fold *fold1,
@@ -425,12 +433,14 @@ __isl_give isl_qpolynomial_fold *isl_qpo
better = fold1->type == isl_fold_max ? -1 : 1;
- if (isl_qpolynomial_fold_is_empty(fold1)) {
+ if (isl_qpolynomial_fold_is_empty(fold1) ||
+ isl_qpolynomial_fold_is_nan(fold2)) {
isl_qpolynomial_fold_free(fold1);
return fold2;
}
- if (isl_qpolynomial_fold_is_empty(fold2)) {
+ if (isl_qpolynomial_fold_is_empty(fold2) ||
+ isl_qpolynomial_fold_is_nan(fold1)) {
isl_qpolynomial_fold_free(fold2);
return fold1;
}
@@ -775,6 +785,17 @@ int isl_qpolynomial_fold_is_empty(__isl_
return fold->n == 0;
}
+/* Does "fold" represent max(NaN) or min(NaN)?
+ */
+int isl_qpolynomial_fold_is_nan(__isl_keep isl_qpolynomial_fold *fold)
+{
+ if (!fold)
+ return -1;
+ if (fold->n != 1)
+ return 0;
+ return isl_qpolynomial_is_nan(fold->qp[0]);
+}
+
__isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_fold(
__isl_take isl_qpolynomial_fold *fold1,
__isl_take isl_qpolynomial_fold *fold2)
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=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_ilp.c (original)
+++ polly/trunk/lib/External/isl/isl_ilp.c Mon May 18 16:29:58 2015
@@ -41,9 +41,9 @@ static struct isl_basic_set *unit_box_ba
goto error;
if (bset->n_eq != 0) {
- unit_box = isl_basic_set_empty_like(bset);
+ isl_space *space = isl_basic_set_get_space(bset);
isl_basic_set_free(bset);
- return unit_box;
+ return isl_basic_set_empty(space);
}
total = isl_basic_set_total_dim(bset);
Modified: polly/trunk/lib/External/isl/isl_input.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_input.c?rev=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_input.c (original)
+++ polly/trunk/lib/External/isl/isl_input.c Mon May 18 16:29:58 2015
@@ -2701,7 +2701,7 @@ static __isl_give isl_basic_map *basic_m
"more than one disjunct", goto error);
if (map->n == 0)
- bmap = isl_basic_map_empty_like_map(map);
+ bmap = isl_basic_map_empty(isl_map_get_space(map));
else
bmap = isl_basic_map_copy(map->p[0]);
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=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_map.c (original)
+++ polly/trunk/lib/External/isl/isl_map.c Mon May 18 16:29:58 2015
@@ -5260,36 +5260,6 @@ __isl_give isl_basic_set *isl_basic_set_
return bset;
}
-struct isl_basic_map *isl_basic_map_empty_like(struct isl_basic_map *model)
-{
- struct isl_basic_map *bmap;
- if (!model)
- return NULL;
- bmap = isl_basic_map_alloc_space(isl_space_copy(model->dim), 0, 1, 0);
- bmap = isl_basic_map_set_to_empty(bmap);
- return bmap;
-}
-
-struct isl_basic_map *isl_basic_map_empty_like_map(struct isl_map *model)
-{
- struct isl_basic_map *bmap;
- if (!model)
- return NULL;
- bmap = isl_basic_map_alloc_space(isl_space_copy(model->dim), 0, 1, 0);
- bmap = isl_basic_map_set_to_empty(bmap);
- return bmap;
-}
-
-struct isl_basic_set *isl_basic_set_empty_like(struct isl_basic_set *model)
-{
- struct isl_basic_set *bset;
- if (!model)
- return NULL;
- bset = isl_basic_set_alloc_space(isl_space_copy(model->dim), 0, 1, 0);
- bset = isl_basic_set_set_to_empty(bset);
- return bset;
-}
-
__isl_give isl_basic_map *isl_basic_map_universe(__isl_take isl_space *dim)
{
struct isl_basic_map *bmap;
@@ -5341,60 +5311,16 @@ __isl_give isl_set *isl_set_nat_universe
return isl_map_nat_universe(dim);
}
-__isl_give isl_basic_map *isl_basic_map_universe_like(
- __isl_keep isl_basic_map *model)
-{
- if (!model)
- return NULL;
- return isl_basic_map_alloc_space(isl_space_copy(model->dim), 0, 0, 0);
-}
-
-struct isl_basic_set *isl_basic_set_universe_like(struct isl_basic_set *model)
-{
- if (!model)
- return NULL;
- return isl_basic_set_alloc_space(isl_space_copy(model->dim), 0, 0, 0);
-}
-
-__isl_give isl_basic_set *isl_basic_set_universe_like_set(
- __isl_keep isl_set *model)
-{
- if (!model)
- return NULL;
- return isl_basic_set_alloc_space(isl_space_copy(model->dim), 0, 0, 0);
-}
-
__isl_give isl_map *isl_map_empty(__isl_take isl_space *dim)
{
return isl_map_alloc_space(dim, 0, ISL_MAP_DISJOINT);
}
-struct isl_map *isl_map_empty_like(struct isl_map *model)
-{
- if (!model)
- return NULL;
- return isl_map_alloc_space(isl_space_copy(model->dim), 0, ISL_MAP_DISJOINT);
-}
-
-struct isl_map *isl_map_empty_like_basic_map(struct isl_basic_map *model)
-{
- if (!model)
- return NULL;
- return isl_map_alloc_space(isl_space_copy(model->dim), 0, ISL_MAP_DISJOINT);
-}
-
__isl_give isl_set *isl_set_empty(__isl_take isl_space *dim)
{
return isl_set_alloc_space(dim, 0, ISL_MAP_DISJOINT);
}
-struct isl_set *isl_set_empty_like(struct isl_set *model)
-{
- if (!model)
- return NULL;
- return isl_set_empty(isl_space_copy(model->dim));
-}
-
__isl_give isl_map *isl_map_universe(__isl_take isl_space *dim)
{
struct isl_map *map;
@@ -5415,13 +5341,6 @@ __isl_give isl_set *isl_set_universe(__i
return set;
}
-__isl_give isl_set *isl_set_universe_like(__isl_keep isl_set *model)
-{
- if (!model)
- return NULL;
- return isl_set_universe(isl_space_copy(model->dim));
-}
-
struct isl_map *isl_map_dup(struct isl_map *map)
{
int i;
@@ -7681,32 +7600,11 @@ error:
return NULL;
}
-struct isl_basic_map *isl_basic_map_identity_like(struct isl_basic_map *model)
-{
- if (!model || !model->dim)
- return NULL;
- return isl_basic_map_identity(isl_space_copy(model->dim));
-}
-
__isl_give isl_map *isl_map_identity(__isl_take isl_space *dim)
{
return isl_map_from_basic_map(isl_basic_map_identity(dim));
}
-struct isl_map *isl_map_identity_like(struct isl_map *model)
-{
- if (!model || !model->dim)
- return NULL;
- return isl_map_identity(isl_space_copy(model->dim));
-}
-
-struct isl_map *isl_map_identity_like_basic_map(struct isl_basic_map *model)
-{
- if (!model || !model->dim)
- return NULL;
- return isl_map_identity(isl_space_copy(model->dim));
-}
-
__isl_give isl_map *isl_set_identity(__isl_take isl_set *set)
{
isl_space *dim = isl_set_get_space(set);
Modified: polly/trunk/lib/External/isl/isl_map_subtract.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_map_subtract.c?rev=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_map_subtract.c (original)
+++ polly/trunk/lib/External/isl/isl_map_subtract.c Mon May 18 16:29:58 2015
@@ -483,7 +483,7 @@ static __isl_give isl_map *basic_map_sub
{
struct isl_subtract_diff_collector sdc;
sdc.dc.add = &basic_map_subtract_add;
- sdc.diff = isl_map_empty_like_basic_map(bmap);
+ sdc.diff = isl_map_empty(isl_basic_map_get_space(bmap));
if (basic_map_collect_diff(bmap, map, &sdc.dc) < 0) {
isl_map_free(sdc.diff);
sdc.diff = NULL;
@@ -546,7 +546,7 @@ static __isl_give isl_map *map_subtract(
map1 = isl_map_remove_empty_parts(map1);
map2 = isl_map_remove_empty_parts(map2);
- diff = isl_map_empty_like(map1);
+ diff = isl_map_empty(isl_map_get_space(map1));
for (i = 0; i < map1->n; ++i) {
struct isl_map *d;
d = basic_map_subtract(isl_basic_map_copy(map1->p[i]),
@@ -775,7 +775,7 @@ error:
return NULL;
}
-/* Return 1 is the singleton map "map1" is a subset of "map2",
+/* Return 1 if the singleton map "map1" is a subset of "map2",
* i.e., if the single element of "map1" is also an element of "map2".
* Assumes "map2" has known divs.
*/
@@ -789,7 +789,8 @@ static int map_is_singleton_subset(__isl
if (!map1 || !map2)
return -1;
if (map1->n != 1)
- return -1;
+ isl_die(isl_map_get_ctx(map1), isl_error_internal,
+ "expecting single-disjunct input", return -1);
point = singleton_extract_point(map1->p[0]);
if (!point)
Modified: polly/trunk/lib/External/isl/isl_mat.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_mat.c?rev=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_mat.c (original)
+++ polly/trunk/lib/External/isl/isl_mat.c Mon May 18 16:29:58 2015
@@ -1035,6 +1035,11 @@ struct isl_mat *isl_mat_swap_rows(struct
return mat;
}
+/* Calculate the product of two matrices.
+ *
+ * This function is optimized for operand matrices that contain many zeros and
+ * skips multiplications where we know one of the operands is zero.
+ */
__isl_give isl_mat *isl_mat_product(__isl_take isl_mat *left,
__isl_take isl_mat *right)
{
@@ -1055,10 +1060,13 @@ __isl_give isl_mat *isl_mat_product(__is
return prod;
}
for (i = 0; i < prod->n_row; ++i) {
- for (j = 0; j < prod->n_col; ++j) {
+ for (j = 0; j < prod->n_col; ++j)
isl_int_mul(prod->row[i][j],
left->row[i][0], right->row[0][j]);
- for (k = 1; k < left->n_col; ++k)
+ for (k = 1; k < left->n_col; ++k) {
+ if (isl_int_is_zero(left->row[i][k]))
+ continue;
+ for (j = 0; j < prod->n_col; ++j)
isl_int_addmul(prod->row[i][j],
left->row[i][k], right->row[k][j]);
}
Modified: polly/trunk/lib/External/isl/isl_polynomial.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_polynomial.c?rev=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_polynomial.c (original)
+++ polly/trunk/lib/External/isl/isl_polynomial.c Mon May 18 16:29:58 2015
@@ -1892,6 +1892,10 @@ error:
return NULL;
}
+/* Is "qp1" obviously equal to "qp2"?
+ *
+ * NaN is not equal to anything, not even to another NaN.
+ */
int isl_qpolynomial_plain_is_equal(__isl_keep isl_qpolynomial *qp1,
__isl_keep isl_qpolynomial *qp2)
{
@@ -1900,6 +1904,9 @@ int isl_qpolynomial_plain_is_equal(__isl
if (!qp1 || !qp2)
return -1;
+ if (isl_qpolynomial_is_nan(qp1) || isl_qpolynomial_is_nan(qp2))
+ return 0;
+
equal = isl_space_is_equal(qp1->dim, qp2->dim);
if (equal < 0 || !equal)
return equal;
Modified: polly/trunk/lib/External/isl/isl_sample.c
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_sample.c?rev=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_sample.c (original)
+++ polly/trunk/lib/External/isl/isl_sample.c Mon May 18 16:29:58 2015
@@ -1211,11 +1211,8 @@ __isl_give isl_basic_map *isl_basic_map_
if (!sample_vec)
goto error;
if (sample_vec->size == 0) {
- struct isl_basic_map *sample;
- sample = isl_basic_map_empty_like(bmap);
isl_vec_free(sample_vec);
- isl_basic_map_free(bmap);
- return sample;
+ return isl_basic_map_set_to_empty(bmap);
}
bset = isl_basic_set_from_vec(sample_vec);
return isl_basic_map_overlying_set(bset, bmap);
@@ -1246,7 +1243,7 @@ __isl_give isl_basic_map *isl_map_sample
isl_basic_map_free(sample);
}
if (i == map->n)
- sample = isl_basic_map_empty_like_map(map);
+ sample = isl_basic_map_empty(isl_map_get_space(map));
isl_map_free(map);
return sample;
error:
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=237616&r1=237615&r2=237616&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/isl_union_map.c (original)
+++ polly/trunk/lib/External/isl/isl_union_map.c Mon May 18 16:29:58 2015
@@ -3577,7 +3577,7 @@ int isl_union_map_involves_dims(__isl_ke
if (type != isl_dim_param)
isl_die(isl_union_map_get_ctx(umap), isl_error_invalid,
- "can only reference parameters", return 0);
+ "can only reference parameters", return -1);
excludes = union_map_forall_user(umap, &map_excludes, &data);
More information about the llvm-commits
mailing list