diff options
author | Tobias Grosser <tobias@grosser.es> | 2015-07-24 13:12:17 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2015-07-24 13:12:17 +0000 |
commit | 566060d76fb2e2f8e74c974d95f76cb1826ce692 (patch) | |
tree | 00220d5752e389cb86b2373eb0bce575c106065a /polly/lib/External/isl/isl_convex_hull.c | |
parent | 3e839decc964e8ba1c5110f507fe9c2b7511f9b8 (diff) | |
download | bcm5719-llvm-566060d76fb2e2f8e74c974d95f76cb1826ce692.tar.gz bcm5719-llvm-566060d76fb2e2f8e74c974d95f76cb1826ce692.zip |
Update isl to isl-0.15-86-g595055e
Besides a couple of cleanups and refactorings in isl, this change set fixes a
couple of bugs in isl, that can cause issues during code generation.
llvm-svn: 243110
Diffstat (limited to 'polly/lib/External/isl/isl_convex_hull.c')
-rw-r--r-- | polly/lib/External/isl/isl_convex_hull.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/polly/lib/External/isl/isl_convex_hull.c b/polly/lib/External/isl/isl_convex_hull.c index b5ca0d9d53e..a61462e62e0 100644 --- a/polly/lib/External/isl/isl_convex_hull.c +++ b/polly/lib/External/isl/isl_convex_hull.c @@ -2326,6 +2326,25 @@ error: /* Compute a superset of the convex hull of map that is described * by only (translates of) the constraints in the constituents of map. + * Handle trivial cases where map is NULL or contains at most one disjunct. + */ +static __isl_give isl_basic_map *map_simple_hull_trivial( + __isl_take isl_map *map) +{ + isl_basic_map *hull; + + if (!map) + return NULL; + if (map->n == 0) + return replace_map_by_empty_basic_map(map); + + hull = isl_basic_map_copy(map->p[0]); + isl_map_free(map); + return hull; +} + +/* Compute a superset of the convex hull of map that is described + * by only (translates of) the constraints in the constituents of map. * Translation is only allowed if "shift" is set. */ static __isl_give isl_basic_map *map_simple_hull(__isl_take isl_map *map, @@ -2337,17 +2356,12 @@ static __isl_give isl_basic_map *map_simple_hull(__isl_take isl_map *map, struct isl_basic_map *affine_hull; struct isl_basic_set *bset = NULL; - if (!map) - return NULL; - 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); - return hull; - } + if (!map || map->n <= 1) + return map_simple_hull_trivial(map); map = isl_map_detect_equalities(map); + if (!map || map->n <= 1) + return map_simple_hull_trivial(map); affine_hull = isl_map_affine_hull(isl_map_copy(map)); map = isl_map_align_divs(map); model = map ? isl_basic_map_copy(map->p[0]) : NULL; |