isl_transitive_closure.c: keep track of domains for Floyd-Warshall
authorSven Verdoolaege <skimo@kotnet.org>
Mon, 2 Aug 2010 09:52:42 +0000 (11:52 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 2 Aug 2010 09:59:59 +0000 (11:59 +0200)
When applying Floyd-Warshall to an isl_map, we don't care about
the domains anymore after we have grouped them.
However, when applying Floyd-Warshall to an isl_union_map, we
use the domains do initialize the grid with maps of the right
dimension.  We therefore need to order the domains according
to the group number so that the calling function has a chance
to find them.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_transitive_closure.c

index 975dbbd..53930fb 100644 (file)
@@ -1609,9 +1609,13 @@ static int *setup_groups(isl_ctx *ctx, __isl_keep isl_basic_map **list, int n,
 
        g = 0;
        for (i = 0; i < 2 * n; ++i)
-               if (group[i] == i)
+               if (group[i] == i) {
+                       if (g != i) {
+                               (*set)[g] = (*set)[i];
+                               (*set)[i] = NULL;
+                       }
                        group[i] = g++;
-               else
+               else
                        group[i] = group[group[i]];
 
        *n_group = g;