From: Sven Verdoolaege Date: Sat, 9 Aug 2008 12:14:12 +0000 (+0200) Subject: isl_basic_map_is_empty: special case known empty basic sets X-Git-Tag: isl-0.01~459 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92be44b2a7d8c292c746fb9a06da79c71c85b4c4;p=platform%2Fupstream%2Fisl.git isl_basic_map_is_empty: special case known empty basic sets --- diff --git a/include/isl_map.h b/include/isl_map.h index 0ce4df2..8af220c 100644 --- a/include/isl_map.h +++ b/include/isl_map.h @@ -36,6 +36,7 @@ extern "C" { struct isl_basic_map { int ref; #define ISL_BASIC_MAP_FINAL (1 << 0) +#define ISL_BASIC_MAP_EMPTY (1 << 1) unsigned flags; unsigned nparam; diff --git a/include/isl_set.h b/include/isl_set.h index 2bdc27a..b45a301 100644 --- a/include/isl_set.h +++ b/include/isl_set.h @@ -13,6 +13,7 @@ extern "C" { struct isl_basic_set { int ref; #define ISL_BASIC_SET_FINAL (1 << 0) +#define ISL_BASIC_SET_EMPTY (1 << 1) unsigned flags; unsigned nparam; diff --git a/isl_map.c b/isl_map.c index 97621bd..99045af 100644 --- a/isl_map.c +++ b/isl_map.c @@ -662,6 +662,7 @@ struct isl_basic_map *isl_basic_map_set_to_empty( } isl_int_set_si(bmap->eq[i][0], 1); isl_seq_clr(bmap->eq[i]+1, total); + F_SET(bmap, ISL_BASIC_MAP_EMPTY); return isl_basic_map_finalize(ctx, bmap); error: isl_basic_map_free(ctx, bmap); @@ -2484,6 +2485,9 @@ int isl_basic_map_is_empty(struct isl_ctx *ctx, if (!bmap) return -1; + if (F_ISSET(bmap, ISL_BASIC_MAP_EMPTY)) + return 1; + bset = isl_basic_set_from_basic_map(ctx, isl_basic_map_copy(ctx, bmap)); if (!bset)