isl_basic_map_add_constraint: handle constraints obtained from basic maps
authorSven Verdoolaege <skimo@purples.(none)>
Sun, 13 Sep 2009 17:13:13 +0000 (19:13 +0200)
committerSven Verdoolaege <skimo@purples.(none)>
Sun, 13 Sep 2009 17:13:13 +0000 (19:13 +0200)
The bmap field of a constraint may contain a basic map that is bounded
by more than one constraint.  The constraint can therefore not be
added by simply taking the intersection with this bmap.
Instead, first create a basic map that exactly corresponds to the constraint
and then take the intersection with that basic map.

isl_constraint.c

index c1d9584..3e752f9 100644 (file)
@@ -184,8 +184,7 @@ struct isl_basic_map *isl_basic_map_add_constraint(
                isl_dim_equal(bmap->dim, constraint->bmap->dim), goto error);
 
        bmap = isl_basic_map_intersect(bmap,
-                                   isl_basic_map_copy(constraint->bmap));
-       isl_constraint_free(constraint);
+                               isl_basic_map_from_constraint(constraint));
        return bmap;
 error:
        isl_basic_map_free(bmap);