isl_map_simplify.c: remove_dependent_vars: only remove definitions of divs
authorSven Verdoolaege <skimo@kotnet.org>
Tue, 4 Aug 2009 15:00:43 +0000 (17:00 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 7 Aug 2009 09:22:02 +0000 (11:22 +0200)
Don't remove the dependent divs themselves, because in particular
eliminate_divs_ineq does not expect any other divs to get removed.

isl_map_simplify.c

index 5f06d84..41aeb1e 100644 (file)
@@ -1173,7 +1173,9 @@ error:
 }
 
 
-/* Remove any div that is defined in terms of the given variable.
+/* Remove definition of any div that is defined in terms of the given variable.
+ * The div itself is not removed.  Functions such as
+ * eliminate_divs_ineq depend on the other divs remaining in place.
  */
 static struct isl_basic_map *remove_dependent_vars(struct isl_basic_map *bmap,
                                                                        int pos)
@@ -1186,9 +1188,7 @@ static struct isl_basic_map *remove_dependent_vars(struct isl_basic_map *bmap,
                        continue;
                if (isl_int_is_zero(bmap->div[i][1+1+pos]))
                        continue;
-               bmap = isl_basic_map_eliminate_vars(bmap, dim + i, 1);
-               if (!bmap)
-                       return NULL;
+               isl_int_set_si(bmap->div[i][0], 0);
        }
        return bmap;
 }