diff options
author | Sven Verdoolaege <skimo@kotnet.org> | 2011-02-19 18:35:24 +0100 |
---|---|---|
committer | Sven Verdoolaege <skimo@kotnet.org> | 2011-02-19 20:25:37 +0100 |
commit | 3fe4714635e4940859d2fdb54a66546be278a1a8 (patch) | |
tree | 7550e509930ddd4e601770f45958b099961110ae | |
parent | b854aa9687e6cc952c415409b96921fa6795b2e9 (diff) | |
download | isl-3fe4714635e4940859d2fdb54a66546be278a1a8.tar.gz isl-3fe4714635e4940859d2fdb54a66546be278a1a8.tar.bz2 isl-3fe4714635e4940859d2fdb54a66546be278a1a8.zip |
isl_map_coalesce: be more relaxed about multiple equalities being adjacent
We try to avoid wrapping in a basic map that has multiple equalities
that are adjacent to inequalities in the other basic map, because that
may lead to more complicated constraints.
The original check would, however, also prevent the extension of
one basic map with an other if they happened to lie in a shared
affine subspace. By moving the test for multiple equalities after
the check for extensions, we allow such extensions, while still
preventing undesired wrapping.
We can probably do better by explicitly detecting and exploiting
the shared affine subspace.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
-rw-r--r-- | isl_coalesce.c | 6 | ||||
-rw-r--r-- | isl_test.c | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/isl_coalesce.c b/isl_coalesce.c index 22524aa7..a07d983a 100644 --- a/isl_coalesce.c +++ b/isl_coalesce.c @@ -916,8 +916,7 @@ static int check_adj_eq(struct isl_map *map, int i, int j, if (any(ineq_i, map->p[i]->n_ineq, STATUS_CUT)) /* ADJ EQ CUT */ return 0; - if (count(eq_j, 2 * map->p[j]->n_eq, STATUS_ADJ_INEQ) != 1 || - count(ineq_i, map->p[i]->n_ineq, STATUS_ADJ_EQ) != 1 || + if (count(ineq_i, map->p[i]->n_ineq, STATUS_ADJ_EQ) != 1 || any(ineq_j, map->p[j]->n_ineq, STATUS_ADJ_EQ) || any(ineq_i, map->p[i]->n_ineq, STATUS_ADJ_INEQ) || any(ineq_j, map->p[j]->n_ineq, STATUS_ADJ_INEQ)) @@ -932,6 +931,9 @@ static int check_adj_eq(struct isl_map *map, int i, int j, if (changed) return changed; + if (count(eq_j, 2 * map->p[j]->n_eq, STATUS_ADJ_INEQ) != 1) + return 0; + changed = can_wrap_in_facet(map, i, j, k, tabs, eq_i, ineq_i, eq_j, ineq_j); return changed; @@ -906,6 +906,8 @@ void test_coalesce(struct isl_ctx *ctx) test_coalesce_set(ctx, "{[x,0,0] : -5 <= x <= 5; [0,y,1] : -5 <= y <= 5 }", 1); test_coalesce_set(ctx, "{ [x, 1 - x] : 0 <= x <= 1; [0,0] }", 1); + test_coalesce_set(ctx, "{ [0,0]; [i,i] : 1 <= i <= 10 }", 1); + test_coalesce_set(ctx, "{ [0,0]; [i,j] : 1 <= i,j <= 10 }", 0); } void test_closure(struct isl_ctx *ctx) |