isl_tab_basic_map_partial_lexopt: use context constraints when detecting equalities
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 1 Nov 2009 13:49:46 +0000 (14:49 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 1 Nov 2009 14:28:08 +0000 (15:28 +0100)
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

index 64137dd..4758106 100644 (file)
@@ -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);