From 5838a24b6ca93204c2e7422550426d8885558bf2 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sun, 1 Nov 2009 14:49:46 +0100 Subject: [PATCH] isl_tab_basic_map_partial_lexopt: use context constraints when detecting equalities The constraints of the context of the actual map may conspire to form equalities and we generally want to detect as many equalities as possible. Therefore, detect equalities in the intersection of the two and add these equalities to the map. Note that the equalities are now no longer detected in the map itself, so we may have to detect equalities again later if we are ever interested in the equalities of the map itself. --- isl_tab_pip.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/isl_tab_pip.c b/isl_tab_pip.c index 64137dd..4758106 100644 --- a/isl_tab_pip.c +++ b/isl_tab_pip.c @@ -3848,6 +3848,7 @@ struct isl_map *isl_tab_basic_map_partial_lexopt( struct isl_map *result = NULL; struct isl_sol_map *sol_map = NULL; struct isl_context *context; + struct isl_basic_map *eq; if (empty) *empty = NULL; @@ -3857,7 +3858,10 @@ struct isl_map *isl_tab_basic_map_partial_lexopt( isl_assert(bmap->ctx, isl_basic_map_compatible_domain(bmap, dom), goto error); - bmap = isl_basic_map_detect_equalities(bmap); + eq = isl_basic_map_copy(bmap); + eq = isl_basic_map_intersect_domain(eq, isl_basic_set_copy(dom)); + eq = isl_basic_map_affine_hull(eq); + bmap = isl_basic_map_intersect(bmap, eq); if (dom->n_div) { dom = isl_basic_set_order_divs(dom); -- 2.7.4