From: Sven Verdoolaege Date: Tue, 10 Mar 2009 12:29:41 +0000 (+0100) Subject: isl_basic_map_dup: copy flags of original to duplicate X-Git-Tag: isl-0.01~237 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eeeffd0dded215709027c590c035661f4bbc8a16;hp=1e3b590b41a466a7174eb47c39c6a6a7f9d4b88c;p=platform%2Fupstream%2Fisl.git isl_basic_map_dup: copy flags of original to duplicate Before, the copied flags would get removed by the subsequent dup_constraints. Some other code depended on isl_basic_map_cow clearing all flags and failed to clear some flags. --- diff --git a/include/isl_set.h b/include/isl_set.h index 1f77b1c..6733e63 100644 --- a/include/isl_set.h +++ b/include/isl_set.h @@ -15,7 +15,12 @@ struct isl_basic_set { int ref; #define ISL_BASIC_SET_FINAL (1 << 0) #define ISL_BASIC_SET_EMPTY (1 << 1) +#define ISL_BASIC_SET_NO_IMPLICIT (1 << 2) +#define ISL_BASIC_SET_NO_REDUNDANT (1 << 3) +#define ISL_BASIC_SET_RATIONAL (1 << 4) #define ISL_BASIC_SET_NORMALIZED (1 << 5) +#define ISL_BASIC_SET_NORMALIZED_DIVS (1 << 6) +#define ISL_BASIC_SET_ALL_EQUALITIES (1 << 7) unsigned flags; struct isl_ctx *ctx; diff --git a/isl_map.c b/isl_map.c index a5fdbd1..58544c1 100644 --- a/isl_map.c +++ b/isl_map.c @@ -372,8 +372,8 @@ struct isl_basic_map *isl_basic_map_dup(struct isl_basic_map *bmap) bmap->n_div, bmap->n_eq, bmap->n_ineq); if (!dup) return NULL; - dup->flags = bmap->flags; dup_constraints(dup, bmap); + dup->flags = bmap->flags; dup->sample = isl_vec_copy(bmap->ctx, bmap->sample); return dup; } @@ -465,6 +465,10 @@ int isl_basic_map_alloc_equality(struct isl_basic_map *bmap) isl_assert(ctx, room_for_con(bmap, 1), return -1); isl_assert(ctx, (bmap->eq - bmap->ineq) + bmap->n_eq <= bmap->c_size, return -1); + ISL_F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED); + ISL_F_CLR(bmap, ISL_BASIC_MAP_NO_REDUNDANT); + ISL_F_CLR(bmap, ISL_BASIC_MAP_NO_IMPLICIT); + ISL_F_CLR(bmap, ISL_BASIC_MAP_ALL_EQUALITIES); ISL_F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED_DIVS); if ((bmap->eq - bmap->ineq) + bmap->n_eq == bmap->c_size) { isl_int *t; @@ -532,6 +536,7 @@ void isl_basic_map_inequality_to_equality( bmap->n_eq++; bmap->n_ineq--; bmap->eq--; + ISL_F_CLR(bmap, ISL_BASIC_MAP_NO_REDUNDANT); ISL_F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED); ISL_F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED_DIVS); ISL_F_CLR(bmap, ISL_BASIC_MAP_ALL_EQUALITIES); diff --git a/isl_mat.c b/isl_mat.c index e15967f..00ac607 100644 --- a/isl_mat.c +++ b/isl_mat.c @@ -844,6 +844,12 @@ struct isl_basic_set *isl_basic_set_preimage(struct isl_basic_set *bset, } isl_mat_free(ctx, t); + ISL_F_CLR(bset, ISL_BASIC_SET_NO_IMPLICIT); + ISL_F_CLR(bset, ISL_BASIC_SET_NO_REDUNDANT); + ISL_F_CLR(bset, ISL_BASIC_SET_NORMALIZED); + ISL_F_CLR(bset, ISL_BASIC_SET_NORMALIZED_DIVS); + ISL_F_CLR(bset, ISL_BASIC_SET_ALL_EQUALITIES); + bset = isl_basic_set_simplify(bset); bset = isl_basic_set_finalize(bset);