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;
}
return cond_un_op(umap, &zip_entry);
}
+static int curry_entry(void **entry, void *user)
+{
+ isl_map *map = *entry;
+ isl_union_map **res = user;
+
+ if (!isl_map_can_curry(map))
+ return 0;
+
+ *res = isl_union_map_add_map(*res, isl_map_curry(isl_map_copy(map)));
+
+ return 0;
+}
+
+/* Given a union map, take the maps of the form (A -> B) -> C and
+ * return the union of the corresponding maps A -> (B -> C).
+ */
+__isl_give isl_union_map *isl_union_map_curry(__isl_take isl_union_map *umap)
+{
+ return cond_un_op(umap, &curry_entry);
+}
+
static int lift_entry(void **entry, void *user)
{
isl_set *set = *entry;