isl_union_map_is_subset: properly handle non-obviously empty subsets
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 3 Mar 2012 22:52:06 +0000 (23:52 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 6 Mar 2012 13:27:03 +0000 (14:27 +0100)
If the first argument of isl_union_map_is_subset contains an empty
set in some space that is not present in the second argument,
then isl_union_map_is_subset would incorrectly draw the conclusion
that the first is not a subset of the second.

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

index f62a302..d47df15 100644 (file)
@@ -1672,6 +1672,11 @@ static int is_subset_entry(void **entry, void *user)
        entry2 = isl_hash_table_find(data->umap2->dim->ctx, &data->umap2->table,
                                     hash, &has_dim, map->dim, 0);
        if (!entry2) {
+               int empty = isl_map_is_empty(map);
+               if (empty < 0)
+                       return -1;
+               if (empty)
+                       return 0;
                data->is_subset = 0;
                return -1;
        }