Lines Matching +full:- +full:- +full:user
2 * Copyright 2010-2011 INRIA Saclay
3 * Copyright 2013-2014 Ecole Normale Superieure
5 * Copyright 2016-2017 Sven Verdoolaege
9 * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
12 * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt,
13 * B.P. 105 - 78153 Le Chesnay, France
55 return isl_space_dim(umap->dim, type); in isl_union_map_dim()
79 return isl_space_get_dim_id(umap->dim, type, pos); in isl_union_map_get_dim_id()
91 if (uset->table.n != 1) in isl_union_set_is_params()
118 umap = isl_calloc_type(space->ctx, isl_union_map); in isl_union_map_alloc()
124 umap->ref = 1; in isl_union_map_alloc()
125 umap->dim = space; in isl_union_map_alloc()
126 if (isl_hash_table_init(space->ctx, &umap->table, size) < 0) in isl_union_map_alloc()
172 return umap ? umap->dim->ctx : NULL; in isl_union_map_get_ctx()
177 return uset ? uset->dim->ctx : NULL; in isl_union_set_get_ctx()
184 return umap ? umap->dim : NULL; in isl_union_map_peek_space()
201 * Return -1 if no such dimension can be found.
207 return -1; in isl_union_map_find_dim_by_name()
208 return isl_space_find_dim_by_name(umap->dim, type, name); in isl_union_map_find_dim_by_name()
212 * Return -1 if no such dimension can be found.
228 static isl_stat free_umap_entry(void **entry, void *user) in free_umap_entry() argument
235 static isl_stat add_map(__isl_take isl_map *map, void *user) in add_map() argument
237 isl_union_map **umap = (isl_union_map **)user; in add_map()
251 dup = isl_union_map_empty(isl_space_copy(umap->dim)); in isl_union_map_dup()
265 if (umap->ref == 1) in isl_union_map_cow()
267 umap->ref--; in isl_union_map_cow()
276 static isl_stat align_entry(void **entry, void *user) in align_entry() argument
280 struct isl_union_align *data = user; in align_entry()
282 exp = isl_reordering_extend_space(isl_reordering_copy(data->exp), in align_entry()
285 data->res = isl_union_map_add_map(data->res, in align_entry()
317 umap->table.n); in isl_union_map_align_params()
318 if (isl_hash_table_foreach(isl_union_map_get_ctx(umap), &umap->table, in isl_union_map_align_params()
374 umap->ref++; in isl_union_map_copy()
388 if (--umap->ref > 0) in isl_union_map_free()
391 isl_hash_table_foreach(umap->dim->ctx, &umap->table, in isl_union_map_free()
393 isl_hash_table_clear(&umap->table); in isl_union_map_free()
394 isl_space_free(umap->dim); in isl_union_map_free()
437 * not exist already. Since this modifies the hash table in-place,
452 return isl_hash_table_find(isl_union_map_get_ctx(umap), &umap->table, in isl_union_map_find_entry()
484 aligned = isl_map_space_has_equal_params(map, umap->dim); in isl_union_map_add_map()
499 if (!entry->data) in isl_union_map_add_map()
500 entry->data = map; in isl_union_map_add_map()
502 entry->data = isl_map_union(entry->data, isl_map_copy(map)); in isl_union_map_add_map()
503 if (!entry->data) in isl_union_map_add_map()
572 isl_stat (*fn)(__isl_take isl_map *map, void *user);
573 void *user; member
576 static isl_stat call_on_copy(void **entry, void *user) in call_on_copy() argument
580 data = (struct isl_union_map_foreach_data *)user; in call_on_copy()
582 return data->fn(isl_map_copy(map), data->user); in call_on_copy()
587 return umap ? umap->table.n : isl_size_error; in isl_union_map_n_map()
592 return uset ? uset->table.n : isl_size_error; in isl_union_set_n_set()
596 isl_stat (*fn)(__isl_take isl_map *map, void *user), void *user) in isl_union_map_foreach_map() argument
598 struct isl_union_map_foreach_data data = { fn, user }; in isl_union_map_foreach_map()
603 return isl_hash_table_foreach(umap->dim->ctx, &umap->table, in isl_union_map_foreach_map()
609 * "test" is the user-specified callback function.
610 * "user" is the user-specified callback function argument.
616 isl_bool (*test)(__isl_keep isl_map *map, void *user);
617 void *user; member
621 /* Call data->test on "map".
622 * If this fails, then set data->failed and abort.
624 static isl_stat call_every(void **entry, void *user) in call_every() argument
627 struct isl_union_map_every_data *data = user; in call_every()
630 r = data->test(map, data->user); in call_every()
635 data->failed = 1; in call_every()
642 isl_bool (*test)(__isl_keep isl_map *map, void *user), void *user) in isl_union_map_every_map() argument
644 struct isl_union_map_every_data data = { test, user, 0 }; in isl_union_map_every_map()
650 r = isl_hash_table_foreach(isl_union_map_get_ctx(umap), &umap->table, in isl_union_map_every_map()
661 static isl_stat add_list_map(__isl_take isl_map *map, void *user) in add_list_map() argument
663 isl_map_list **list = user; in add_list_map()
726 static isl_stat copy_map(void **entry, void *user) in copy_map() argument
729 isl_map **map_p = user; in copy_map()
751 isl_hash_table_foreach(ctx, &umap->table, ©_map, &map); in isl_map_from_union_map()
796 return isl_map_copy(entry->data); in isl_union_map_extract_map()
831 isl_stat (*fn)(__isl_take isl_set *set, void *user), void *user) in isl_union_set_foreach_set() argument
834 (isl_stat(*)(__isl_take isl_map *, void*))fn, user); in isl_union_set_foreach_set()
839 * "test" is the user-specified callback function.
840 * "user" is the user-specified callback function argument.
843 isl_bool (*test)(__isl_keep isl_set *set, void *user);
844 void *user; member
847 /* Call data->test on "map", which is part of an isl_union_set and
850 static isl_bool test_set_from_map(__isl_keep isl_map *map, void *user) in test_set_from_map() argument
852 struct isl_test_set_from_map_data *data = user; in test_set_from_map()
854 return data->test(set_from_map(map), data->user); in test_set_from_map()
860 isl_bool (*test)(__isl_keep isl_set *set, void *user), void *user) in isl_union_set_every_set() argument
862 struct isl_test_set_from_map_data data = { test, user }; in isl_union_set_every_set()
869 isl_stat (*fn)(__isl_take isl_point *pnt, void *user);
870 void *user; member
873 static isl_stat foreach_point(__isl_take isl_set *set, void *user) in foreach_point() argument
875 struct isl_union_set_foreach_point_data *data = user; in foreach_point()
878 r = isl_set_foreach_point(set, data->fn, data->user); in foreach_point()
885 isl_stat (*fn)(__isl_take isl_point *pnt, void *user), void *user) in isl_union_set_foreach_point() argument
887 struct isl_union_set_foreach_point_data data = { fn, user }; in isl_union_set_foreach_point()
945 map = data->control->fn_map(isl_map_copy(map1), isl_map_copy(map2)); in bin_add_pair()
963 /* Look for the map in data->umap2 that corresponds to "map", if any.
968 * If not NULL, then data->control->filter specifies whether "map"
970 * data->control->match_space specifies which map in data->umap2
980 if (data->control->filter) { in bin_try_get_match()
981 res.valid = data->control->filter(map); in bin_try_get_match()
988 if (data->control->match_space != &identity) in bin_try_get_match()
989 space = data->control->match_space(space); in bin_try_get_match()
990 entry2 = isl_union_map_find_entry(data->umap2, space, 0); in bin_try_get_match()
995 res.value = entry2->data; in bin_try_get_match()
1001 * Look for the map in data->umap2 that corresponds
1003 * add the result to data->res.
1006 * on data->control->subtract. If it is set, then the current map
1009 static isl_stat gen_bin_entry(void **entry, void *user) in gen_bin_entry() argument
1011 struct isl_union_map_gen_bin_data *data = user; in gen_bin_entry()
1018 if (!m.valid && !data->control->subtract) in gen_bin_entry()
1022 data->res = bin_add_map(data->res, map); in gen_bin_entry()
1024 data->res = bin_add_pair(data->res, map, m.value, data); in gen_bin_entry()
1025 if (!data->res) in gen_bin_entry()
1047 data.res = isl_union_map_alloc(isl_space_copy(umap1->dim), in gen_bin_op()
1048 umap1->table.n); in gen_bin_op()
1049 if (isl_hash_table_foreach(umap1->dim->ctx, &umap1->table, in gen_bin_op()
1086 static isl_stat intersect_params_entry(void **entry, void *user) in intersect_params_entry() argument
1088 struct isl_union_map_gen_bin_set_data *data = user; in intersect_params_entry()
1093 map = isl_map_intersect_params(map, isl_set_copy(data->set)); in intersect_params_entry()
1101 data->res = isl_union_map_add_map(data->res, map); in intersect_params_entry()
1118 data.res = isl_union_map_alloc(isl_space_copy(umap->dim), in gen_bin_set_op()
1119 umap->table.n); in gen_bin_set_op()
1120 if (isl_hash_table_foreach(umap->dim->ctx, &umap->table, in gen_bin_set_op()
1183 static isl_stat match_bin_entry(void **entry, void *user) in match_bin_entry() argument
1185 struct isl_union_map_match_bin_data *data = user; in match_bin_entry()
1192 entry2 = isl_union_map_find_entry(data->umap2, space, 0); in match_bin_entry()
1199 map = data->fn(map, isl_map_copy(entry2->data)); in match_bin_entry()
1211 data->res = isl_union_map_add_map(data->res, map); in match_bin_entry()
1229 data.res = isl_union_map_alloc(isl_space_copy(umap1->dim), in match_bin_op()
1230 umap1->table.n); in match_bin_op()
1231 if (isl_hash_table_foreach(umap1->dim->ctx, &umap1->table, in match_bin_op()
1276 static isl_stat gist_params_entry(void **entry, void *user) in gist_params_entry() argument
1278 struct isl_union_map_gen_bin_set_data *data = user; in gist_params_entry()
1283 map = isl_map_gist_params(map, isl_set_copy(data->set)); in gist_params_entry()
1291 data->res = isl_union_map_add_map(data->res, map); in gist_params_entry()
1512 /* Intersect each map in "umap" in a space [A -> B] -> C
1513 * with the corresponding map in "factor" in the space A -> C and
1528 /* Intersect each map in "umap" in a space [A -> B] -> C
1529 * with the corresponding map in "factor" in the space B -> C and
1544 /* Intersect each map in "umap" in a space A -> [B -> C]
1545 * with the corresponding map in "factor" in the space A -> B and
1560 /* Intersect each map in "umap" in a space A -> [B -> C]
1561 * with the corresponding map in "factor" in the space A -> C and
1580 isl_stat (*fn)(void **entry, void *user);
1583 static isl_stat apply_range_entry(void **entry, void *user) in apply_range_entry() argument
1585 struct isl_union_map_bin_data *data = user; in apply_range_entry()
1589 match = isl_map_tuple_is_equal(data->map, isl_dim_out, in apply_range_entry()
1596 map2 = isl_map_apply_range(isl_map_copy(data->map), isl_map_copy(map2)); in apply_range_entry()
1608 data->res = isl_union_map_add_map(data->res, map2); in apply_range_entry()
1613 static isl_stat bin_entry(void **entry, void *user) in bin_entry() argument
1615 struct isl_union_map_bin_data *data = user; in bin_entry()
1618 data->map = map; in bin_entry()
1619 if (isl_hash_table_foreach(data->umap2->dim->ctx, &data->umap2->table, in bin_entry()
1620 data->fn, data) < 0) in bin_entry()
1628 isl_stat (*fn)(void **entry, void *user)) in bin_op() argument
1639 data.res = isl_union_map_alloc(isl_space_copy(umap1->dim), in bin_op()
1640 umap1->table.n); in bin_op()
1641 if (isl_hash_table_foreach(umap1->dim->ctx, &umap1->table, in bin_op()
1655 /* Intersect each map in "umap" in a space [A -> B] -> C
1672 /* Intersect each map in "umap" in a space A -> [B -> C]
1709 static isl_stat map_lex_lt_entry(void **entry, void *user) in map_lex_lt_entry() argument
1711 struct isl_union_map_bin_data *data = user; in map_lex_lt_entry()
1715 match = isl_map_tuple_is_equal(data->map, isl_dim_out, in map_lex_lt_entry()
1722 map2 = isl_map_lex_lt_map(isl_map_copy(data->map), isl_map_copy(map2)); in map_lex_lt_entry()
1724 data->res = isl_union_map_add_map(data->res, map2); in map_lex_lt_entry()
1735 static isl_stat map_lex_le_entry(void **entry, void *user) in map_lex_le_entry() argument
1737 struct isl_union_map_bin_data *data = user; in map_lex_le_entry()
1741 match = isl_map_tuple_is_equal(data->map, isl_dim_out, in map_lex_le_entry()
1748 map2 = isl_map_lex_le_map(isl_map_copy(data->map), isl_map_copy(map2)); in map_lex_le_entry()
1750 data->res = isl_union_map_add_map(data->res, map2); in map_lex_le_entry()
1761 static isl_stat product_entry(void **entry, void *user) in product_entry() argument
1763 struct isl_union_map_bin_data *data = user; in product_entry()
1766 map2 = isl_map_product(isl_map_copy(data->map), isl_map_copy(map2)); in product_entry()
1768 data->res = isl_union_map_add_map(data->res, map2); in product_entry()
1779 static isl_stat set_product_entry(void **entry, void *user) in set_product_entry() argument
1781 struct isl_union_map_bin_data *data = user; in set_product_entry()
1784 set2 = isl_set_product(isl_set_copy(data->map), isl_set_copy(set2)); in set_product_entry()
1786 data->res = isl_union_set_add_set(data->res, set2); in set_product_entry()
1797 static isl_stat domain_product_entry(void **entry, void *user) in domain_product_entry() argument
1799 struct isl_union_map_bin_data *data = user; in domain_product_entry()
1803 match = isl_map_tuple_is_equal(data->map, isl_dim_out, in domain_product_entry()
1810 map2 = isl_map_domain_product(isl_map_copy(data->map), in domain_product_entry()
1813 data->res = isl_union_map_add_map(data->res, map2); in domain_product_entry()
1818 /* Given two maps A -> B and C -> D, construct a map [A -> C] -> (B * D)
1826 static isl_stat range_product_entry(void **entry, void *user) in range_product_entry() argument
1828 struct isl_union_map_bin_data *data = user; in range_product_entry()
1832 match = isl_map_tuple_is_equal(data->map, isl_dim_in, map2, isl_dim_in); in range_product_entry()
1838 map2 = isl_map_range_product(isl_map_copy(data->map), in range_product_entry()
1841 data->res = isl_union_map_add_map(data->res, map2); in range_product_entry()
1852 /* If data->map A -> B and "map2" C -> D have the same range space,
1853 * then add (A, C) -> (B * D) to data->res.
1855 static isl_stat flat_domain_product_entry(void **entry, void *user) in flat_domain_product_entry() argument
1857 struct isl_union_map_bin_data *data = user; in flat_domain_product_entry()
1861 match = isl_map_tuple_is_equal(data->map, isl_dim_out, in flat_domain_product_entry()
1868 map2 = isl_map_flat_domain_product(isl_map_copy(data->map), in flat_domain_product_entry()
1871 data->res = isl_union_map_add_map(data->res, map2); in flat_domain_product_entry()
1876 /* Given two maps A -> B and C -> D, construct a map (A, C) -> (B * D).
1884 static isl_stat flat_range_product_entry(void **entry, void *user) in flat_range_product_entry() argument
1886 struct isl_union_map_bin_data *data = user; in flat_range_product_entry()
1890 match = isl_map_tuple_is_equal(data->map, isl_dim_in, map2, isl_dim_in); in flat_range_product_entry()
1896 map2 = isl_map_flat_range_product(isl_map_copy(data->map), in flat_range_product_entry()
1899 data->res = isl_union_map_add_map(data->res, map2); in flat_range_product_entry()
1931 isl_bool (*filter)(__isl_keep isl_map *map, void *user);
1934 __isl_give isl_map *(*fn_map2)(__isl_take isl_map *map, void *user);
1947 * Simply call data->filter without the second argument.
1949 static isl_bool un_op_filter_drop_user(__isl_keep isl_map *map, void *user) in un_op_filter_drop_user() argument
1951 struct isl_un_op_drop_user_data *data = user; in un_op_filter_drop_user()
1952 return data->filter(map); in un_op_filter_drop_user()
1967 * If control->filter is set, then check if this map satisfies the filter.
1968 * If so (or if control->filter is not set), modify the map
1969 * by calling control->fn_map or control->fn_map2 (if set) and
1970 * either add the result to data->res or
1971 * replace the original entry by the result (if control->inplace is set).
1973 static isl_stat un_entry(void **entry, void *user) in un_entry() argument
1975 struct isl_union_map_un_data *data = user; in un_entry()
1976 struct isl_un_op_control *control = data->control; in un_entry()
1979 if (control->filter) { in un_entry()
1982 ok = control->filter(map, control->filter_user); in un_entry()
1990 if (control->fn_map2 != NULL) in un_entry()
1991 map = control->fn_map2(map, control->fn_map2_user); in un_entry()
1992 else if (control->fn_map != NULL) in un_entry()
1993 map = control->fn_map(map); in un_entry()
1996 if (control->inplace) { in un_entry()
2000 data->res = isl_union_map_add_map(data->res, map); in un_entry()
2001 if (!data->res) in un_entry()
2009 * If control->inplace is set, then modify the maps in "umap" in-place.
2011 * If control->total is set, then perform an inplace computation
2022 if (!!control->fn_map && !!control->fn_map2) in un_op()
2026 if ((control->inplace || control->total) && control->filter) in un_op()
2031 if (control->total && umap->ref == 1) in un_op()
2032 control->inplace = 1; in un_op()
2033 if (control->inplace) { in un_op()
2039 data.res = isl_union_map_alloc(space, umap->table.n); in un_op()
2042 &umap->table, &un_entry, &data) < 0) in un_op()
2045 if (control->inplace) in un_op()
2181 * or the space, the operation can be performed in-place.
2289 /* Given a union map, take the maps of the form A -> (B -> C) and
2290 * return the union of the corresponding maps A -> (C -> B).
2363 static isl_stat domain_map_upma(__isl_take isl_map *map, void *user) in domain_map_upma() argument
2365 isl_union_pw_multi_aff **res = user; in domain_map_upma()
2402 /* Given a collection of wrapped maps of the form A[B -> C],
2403 * return the collection of maps A[B -> C] -> B.
2419 static isl_bool equal_tuples(__isl_keep isl_map *map, void *user) in equal_tuples() argument
2453 static isl_stat identity_upma(__isl_take isl_set *set, void *user) in identity_upma() argument
2455 isl_union_pw_multi_aff **res = user; in identity_upma()
2483 /* For each map in "umap" of the form [A -> B] -> C,
2484 * construct the map A -> C and collect the results.
2498 /* For each map in "umap" of the form [A -> B] -> C,
2499 * construct the map B -> C and collect the results.
2513 /* For each map in "umap" of the form A -> [B -> C],
2514 * construct the map A -> B and collect the results.
2528 /* For each map in "umap" of the form A -> [B -> C],
2529 * construct the map A -> C and collect the results.
2543 /* For each map in "umap" of the form [A -> B] -> [C -> D],
2544 * construct the map A -> C and collect the results.
2558 /* For each map in "umap" of the form [A -> B] -> [C -> D],
2559 * construct the map B -> D and collect the results.
2597 static isl_stat is_subset_entry(void **entry, void *user) in is_subset_entry() argument
2599 struct isl_union_map_is_subset_data *data = user; in is_subset_entry()
2605 entry2 = isl_union_map_find_entry(data->umap2, space, 0); in is_subset_entry()
2614 data->is_subset = isl_bool_false; in is_subset_entry()
2618 data->is_subset = isl_map_is_subset(map, entry2->data); in is_subset_entry()
2619 if (data->is_subset < 0 || !data->is_subset) in is_subset_entry()
2634 if (isl_hash_table_foreach(umap1->dim->ctx, &umap1->table, in isl_union_map_is_subset()
2698 /* Check if "map" is disjoint from data->umap2 and abort
2701 static isl_stat is_disjoint_entry(void **entry, void *user) in is_disjoint_entry() argument
2703 struct isl_union_map_is_disjoint_data *data = user; in is_disjoint_entry()
2709 entry2 = isl_union_map_find_entry(data->umap2, space, 0); in is_disjoint_entry()
2715 data->is_disjoint = isl_map_is_disjoint(map, entry2->data); in is_disjoint_entry()
2716 if (data->is_disjoint < 0 || !data->is_disjoint) in is_disjoint_entry()
2740 if (isl_hash_table_foreach(umap1->dim->ctx, &umap1->table, in isl_union_map_is_disjoint()
2763 static isl_stat sample_entry(void **entry, void *user) in sample_entry() argument
2765 isl_basic_map **sample = (isl_basic_map **)user; in sample_entry()
2783 if (isl_hash_table_foreach(umap->dim->ctx, &umap->table, in isl_union_map_sample()
2817 static isl_stat forall_entry(void **entry, void *user) in forall_entry() argument
2819 struct isl_forall_data *data = user; in forall_entry()
2822 data->res = data->fn(map); in forall_entry()
2823 if (data->res < 0) in forall_entry()
2826 if (!data->res) in forall_entry()
2840 if (isl_hash_table_foreach(umap->dim->ctx, &umap->table, in union_map_forall()
2849 isl_bool (*fn)(__isl_keep isl_map *map, void *user);
2850 void *user; member
2853 static isl_stat forall_user_entry(void **entry, void *user) in forall_user_entry() argument
2855 struct isl_forall_user_data *data = user; in forall_user_entry()
2858 data->res = data->fn(map, data->user); in forall_user_entry()
2859 if (data->res < 0) in forall_user_entry()
2862 if (!data->res) in forall_user_entry()
2868 /* Check if fn(map, user) returns true for all maps "map" in umap.
2871 isl_bool (*fn)(__isl_keep isl_map *map, void *user), void *user) in union_map_forall_user() argument
2873 struct isl_forall_user_data data = { isl_bool_true, fn, user }; in union_map_forall_user()
2878 if (isl_hash_table_foreach(umap->dim->ctx, &umap->table, in union_map_forall_user()
2931 * if it is single-valued.
2949 * "sv" is set to 1 as long as "umap" may still be single-valued.
2956 /* Check if the data->umap is single-valued on "set".
2958 * If data->umap consists of a single map on "set", then test it
2963 * M \circ M^-1
2966 * store the result in data->sv.
2968 * Terminate as soon as data->umap has been determined not to
2969 * be single-valued.
2971 static isl_stat single_valued_on_domain(__isl_take isl_set *set, void *user) in single_valued_on_domain() argument
2973 struct isl_union_map_is_sv_data *data = user; in single_valued_on_domain()
2977 umap = isl_union_map_copy(data->umap); in single_valued_on_domain()
2983 data->sv = isl_bool_error; in single_valued_on_domain()
2985 data->sv = single_map_is_single_valued(umap); in single_valued_on_domain()
2991 data->sv = union_map_forall(test, &is_subset_of_identity); in single_valued_on_domain()
2996 if (data->sv < 0 || !data->sv) in single_valued_on_domain()
3001 /* Check if the given map is single-valued.
3004 * Otherwise, check if the union map is single-valued on each of its
3052 * if it is is non-empty.
3057 static isl_stat map_plain_is_not_identity(__isl_take isl_map *map, void *user) in map_plain_is_not_identity() argument
3059 isl_bool *non_identity = user; in map_plain_is_not_identity()
3101 static isl_stat map_is_identity(__isl_take isl_map *map, void *user) in map_is_identity() argument
3103 isl_bool *identity = user; in map_is_identity()
3180 return isl_int_cmp(e1->v, e2->v); in qsort_fixed_map_cmp()
3195 static isl_bool fixed_at_pos(__isl_keep isl_map *map, void *user) in fixed_at_pos() argument
3197 struct isl_fixed_dim_data *data = user; in fixed_at_pos()
3199 data->v[data->n].map = map; in fixed_at_pos()
3200 return isl_map_plain_is_fixed(map, isl_dim_out, data->pos, in fixed_at_pos()
3201 &data->v[data->n++].v); in fixed_at_pos()
3239 part = isl_union_map_alloc(isl_space_copy(space), j - i); in separates()
3250 i = j - 1; in separates()
3259 return -1; in separates()
3326 void *user) in plain_injective_on_range_wrap() argument
3329 isl_union_map *umap = user; in plain_injective_on_range_wrap()
3391 /* Given a union map, take the maps of the form A -> (B -> C) and
3392 * return the union of the corresponding maps (A -> B) -> C.
3405 /* Given a union map, take the maps of the form (A -> B) -> C and
3406 * return the union of the corresponding maps A -> (B -> C).
3419 /* Given a union map, take the maps of the form A -> ((B -> C) -> D) and
3420 * return the union of the corresponding maps A -> (B -> (C -> D)).
3442 static isl_stat coefficients_entry(void **entry, void *user) in coefficients_entry() argument
3445 isl_union_set **res = user; in coefficients_entry()
3466 res = isl_union_map_alloc(space, uset->table.n); in isl_union_set_coefficients()
3467 if (isl_hash_table_foreach(uset->dim->ctx, &uset->table, in isl_union_set_coefficients()
3479 static isl_stat solutions_entry(void **entry, void *user) in solutions_entry() argument
3482 isl_union_set **res = user; in solutions_entry()
3505 if (uset->table.n == 0) { in isl_union_set_solutions()
3511 if (isl_hash_table_foreach(uset->dim->ctx, &uset->table, in isl_union_set_solutions()
3564 /* Call data->fn to compute the preimage of the domain or range of *entry
3565 * under the function represented by data->pma, provided the domain/range
3566 * space of *entry matches the target space of data->pma
3567 * (as given by data->match), and add the result to data->res.
3569 static isl_stat preimage_entry(void **entry, void *user) in preimage_entry() argument
3573 struct isl_union_map_preimage_data *data = user; in preimage_entry()
3576 m = data->match(map, data->space); in preimage_entry()
3583 map = data->fn(map, isl_pw_multi_aff_copy(data->pma)); in preimage_entry()
3591 data->res = isl_union_map_add_map(data->res, map); in preimage_entry()
3623 data.res = isl_union_map_alloc(space, umap->table.n); in preimage_pw_multi_aff()
3626 if (isl_hash_table_foreach(ctx, &umap->table, &preimage_entry, in preimage_pw_multi_aff()
3739 /* Call data->fn to compute the preimage of the domain or range of *entry
3740 * under the function represented by data->mpa, provided the domain/range
3741 * space of *entry matches the target space of data->mpa
3742 * (as given by data->match), and add the result to data->res.
3744 static isl_stat preimage_mpa_entry(void **entry, void *user) in preimage_mpa_entry() argument
3748 struct isl_union_map_preimage_mpa_data *data = user; in preimage_mpa_entry()
3751 m = data->match(map, data->space); in preimage_mpa_entry()
3758 map = data->fn(map, isl_multi_pw_aff_copy(data->mpa)); in preimage_mpa_entry()
3766 data->res = isl_union_map_add_map(data->res, map); in preimage_mpa_entry()
3798 data.res = isl_union_map_alloc(space, umap->table.n); in preimage_multi_pw_aff()
3801 if (isl_hash_table_foreach(ctx, &umap->table, &preimage_mpa_entry, in preimage_multi_pw_aff()
3833 * "fn" computes the preimage for a given piecewise multi-affine function.
3842 /* Call data->fn to compute the preimage of the domain or range of data->umap
3843 * under the function represented by pma and add the result to data->res.
3845 static isl_stat preimage_upma(__isl_take isl_pw_multi_aff *pma, void *user) in preimage_upma() argument
3847 struct isl_union_map_preimage_upma_data *data = user; in preimage_upma()
3850 umap = isl_union_map_copy(data->umap); in preimage_upma()
3851 umap = data->fn(umap, pma); in preimage_upma()
3852 data->res = isl_union_map_union(data->res, umap); in preimage_upma()
3854 return data->res ? isl_stat_ok : isl_stat_error; in preimage_upma()
3861 * on a piecewise multi-affine function.
3931 /* Reset the user pointer on all identifiers of parameters and tuples
3940 umap->dim = isl_space_reset_user(umap->dim); in isl_union_map_reset_user()
3941 if (!umap->dim) in isl_union_map_reset_user()
3946 /* Reset the user pointer on all identifiers of parameters and tuples
3956 * from "umap" using Fourier-Motzkin elimination.
3965 * from "uset" using Fourier-Motzkin elimination.
3986 /* Turn the data->n dimensions of type data->type, starting at data->first
3987 * into existentially quantified variables and add the result to data->res.
3989 static isl_stat project_out(__isl_take isl_map *map, void *user) in project_out() argument
3991 struct isl_union_map_project_out_data *data = user; in project_out()
3993 map = isl_map_project_out(map, data->type, data->first, data->n); in project_out()
3994 data->res = isl_union_map_add_map(data->res, map); in project_out()
4065 /* Does "map" _not_ involve the data->n parameters starting at data->first?
4067 static isl_bool map_excludes(__isl_keep isl_map *map, void *user) in map_excludes() argument
4069 struct isl_union_map_involves_dims_data *data = user; in map_excludes()
4073 isl_dim_param, data->first, data->n); in map_excludes()
4109 /* Replace the range space of "map" by the range space of data->range and
4110 * add the result to data->res.
4112 static isl_stat reset_range_space(__isl_take isl_map *map, void *user) in reset_range_space() argument
4114 struct isl_union_map_reset_range_space_data *data = user; in reset_range_space()
4120 isl_space_copy(data->range)); in reset_range_space()
4122 data->res = isl_union_map_add_map(data->res, map); in reset_range_space()
4124 return data->res ? isl_stat_ok : isl_stat_error; in reset_range_space()
4176 /* Replace the parameters of "map" by those of data->space and
4177 * add the result to data->res.
4179 static isl_stat reset_params(__isl_take isl_map *map, void *user) in reset_params() argument
4181 struct isl_union_map_reset_params_data *data = user; in reset_params()
4185 space = isl_space_replace_params(space, data->space); in reset_params()
4187 data->res = isl_union_map_add_map(data->res, map); in reset_params()
4189 return data->res ? isl_stat_ok : isl_stat_error; in reset_params()
4242 /* Intersect "map" with the result of applying data->order to
4243 * the functions in data->mupa that apply to the domain and the range
4244 * of "map" and add the result to data->res.
4246 static isl_stat order_at(__isl_take isl_map *map, void *user) in order_at() argument
4248 struct isl_union_order_at_data *data = user; in order_at()
4254 mpa1 = isl_multi_union_pw_aff_extract_multi_pw_aff(data->mupa, space); in order_at()
4256 mpa2 = isl_multi_union_pw_aff_extract_multi_pw_aff(data->mupa, space); in order_at()
4257 order = data->order(mpa1, mpa2); in order_at()
4259 data->res = isl_union_map_add_map(data->res, map); in order_at()
4261 return data->res ? isl_stat_ok : isl_stat_error; in order_at()
4264 /* If "mupa" has a non-trivial explicit domain, then intersect
4388 static isl_stat add_hash(__isl_take isl_map *map, void *user) in add_hash() argument
4390 uint32_t *hash = user; in add_hash()
4425 static isl_stat add_n(__isl_take isl_set *set, void *user) in add_n() argument
4427 int *n = user; in add_n()
4444 return -1; in isl_union_set_n_basic_set()
4451 static isl_stat add_list(__isl_take isl_set *set, void *user) in add_list() argument
4453 isl_basic_set_list **list = user; in add_list()
4491 * "fn" and "user" are the arguments to isl_union_map_remove_map_if.
4494 isl_bool (*fn)(__isl_keep isl_map *map, void *user);
4495 void *user; member
4498 /* isl_un_op_control filter that negates the result of data->fn
4501 static isl_bool not(__isl_keep isl_map *map, void *user) in not() argument
4503 struct isl_union_map_remove_map_if_data *data = user; in not()
4505 return isl_bool_not(data->fn(map, data->user)); in not()
4524 isl_bool (*fn)(__isl_keep isl_map *map, void *user), void *user) in isl_union_map_remove_map_if() argument
4526 struct isl_union_map_remove_map_if_data data = { fn, user }; in isl_union_map_remove_map_if()
4537 static isl_bool has_domain_space_tuples(__isl_keep isl_map *map, void *user) in has_domain_space_tuples() argument
4539 isl_space *space = user; in has_domain_space_tuples()
4546 static isl_bool has_range_space_tuples(__isl_keep isl_map *map, void *user) in has_range_space_tuples() argument
4548 isl_space *space = user; in has_range_space_tuples()
4555 static __isl_give isl_map *bind_range(__isl_take isl_map *map, void *user) in bind_range() argument
4557 isl_multi_id *tuple = user; in bind_range()