diff options
-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) |