summaryrefslogtreecommitdiffstats
path: root/polly/lib/External/isl/isl_convex_hull.c
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/External/isl/isl_convex_hull.c')
-rw-r--r--polly/lib/External/isl/isl_convex_hull.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/polly/lib/External/isl/isl_convex_hull.c b/polly/lib/External/isl/isl_convex_hull.c
index 2be7187b93e..c85cee4067c 100644
--- a/polly/lib/External/isl/isl_convex_hull.c
+++ b/polly/lib/External/isl/isl_convex_hull.c
@@ -922,15 +922,15 @@ error:
/* Is the set bounded for each value of the parameters?
*/
-int isl_basic_set_is_bounded(__isl_keep isl_basic_set *bset)
+isl_bool isl_basic_set_is_bounded(__isl_keep isl_basic_set *bset)
{
struct isl_tab *tab;
- int bounded;
+ isl_bool bounded;
if (!bset)
- return -1;
+ return isl_bool_error;
if (isl_basic_set_plain_is_empty(bset))
- return 1;
+ return isl_bool_true;
tab = isl_tab_from_recession_cone(bset, 1);
bounded = isl_tab_cone_is_bounded(tab);
@@ -941,11 +941,11 @@ int isl_basic_set_is_bounded(__isl_keep isl_basic_set *bset)
/* Is the image bounded for each value of the parameters and
* the domain variables?
*/
-int isl_basic_map_image_is_bounded(__isl_keep isl_basic_map *bmap)
+isl_bool isl_basic_map_image_is_bounded(__isl_keep isl_basic_map *bmap)
{
unsigned nparam = isl_basic_map_dim(bmap, isl_dim_param);
unsigned n_in = isl_basic_map_dim(bmap, isl_dim_in);
- int bounded;
+ isl_bool bounded;
bmap = isl_basic_map_copy(bmap);
bmap = isl_basic_map_cow(bmap);
@@ -959,19 +959,19 @@ int isl_basic_map_image_is_bounded(__isl_keep isl_basic_map *bmap)
/* Is the set bounded for each value of the parameters?
*/
-int isl_set_is_bounded(__isl_keep isl_set *set)
+isl_bool isl_set_is_bounded(__isl_keep isl_set *set)
{
int i;
if (!set)
- return -1;
+ return isl_bool_error;
for (i = 0; i < set->n; ++i) {
- int bounded = isl_basic_set_is_bounded(set->p[i]);
+ isl_bool bounded = isl_basic_set_is_bounded(set->p[i]);
if (!bounded || bounded < 0)
return bounded;
}
- return 1;
+ return isl_bool_true;
}
/* Compute the lineality space of the convex hull of bset1 and bset2.
@@ -1837,6 +1837,7 @@ static struct isl_basic_set *uset_convex_hull_wrap(struct isl_set *set)
*/
static struct isl_basic_set *uset_convex_hull(struct isl_set *set)
{
+ isl_bool bounded;
struct isl_basic_set *convex_hull = NULL;
struct isl_basic_set *lin;
@@ -1858,8 +1859,10 @@ static struct isl_basic_set *uset_convex_hull(struct isl_set *set)
if (isl_set_n_dim(set) == 1)
return convex_hull_1d(set);
- if (isl_set_is_bounded(set) &&
- set->ctx->opt->convex == ISL_CONVEX_HULL_WRAP)
+ bounded = isl_set_is_bounded(set);
+ if (bounded < 0)
+ goto error;
+ if (bounded && set->ctx->opt->convex == ISL_CONVEX_HULL_WRAP)
return uset_convex_hull_wrap(set);
lin = uset_combined_lineality_space(isl_set_copy(set));
@@ -3139,5 +3142,6 @@ struct isl_basic_set *isl_set_bounded_simple_hull(struct isl_set *set)
return hull;
error:
isl_set_free(set);
+ isl_basic_set_free(hull);
return NULL;
}
OpenPOWER on IntegriCloud