From 92af46fbb91b669a6d3b3ff9fad321f1e7b880db Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Mon, 10 Oct 2011 08:09:50 -0400 Subject: [PATCH] Run isl_basic_map_finalize after isl_{basic_,}map_eliminate Signed-off-by: Andreas Kloeckner Signed-off-by: Sven Verdoolaege --- isl_map.c | 6 ++---- isl_map_simplify.c | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/isl_map.c b/isl_map.c index d2a518c..7db8369 100644 --- a/isl_map.c +++ b/isl_map.c @@ -1560,11 +1560,9 @@ __isl_give isl_map *isl_map_eliminate(__isl_take isl_map *map, map = isl_map_cow(map); if (!map) return NULL; - isl_assert(map->ctx, first + n <= isl_map_dim(map, type), goto error); - first += pos(map->dim, type) - 1; - + for (i = 0; i < map->n; ++i) { - map->p[i] = isl_basic_map_eliminate_vars(map->p[i], first, n); + map->p[i] = isl_basic_map_eliminate(map->p[i], type, first, n); if (!map->p[i]) goto error; } diff --git a/isl_map_simplify.c b/isl_map_simplify.c index 1998b58..eafbb08 100644 --- a/isl_map_simplify.c +++ b/isl_map_simplify.c @@ -1387,7 +1387,8 @@ __isl_give isl_basic_map *isl_basic_map_eliminate( "index out of bounds", goto error); first += isl_basic_map_offset(bmap, type) - 1; - return isl_basic_map_eliminate_vars(bmap, first, n); + bmap = isl_basic_map_eliminate_vars(bmap, first, n); + return isl_basic_map_finalize(bmap); error: isl_basic_map_free(bmap); return NULL; -- 2.7.4