Lines Matching refs:UNION
14 #define TYPE UNION
18 __isl_give UNION *FN(UNION,cow)(__isl_take UNION *u);
20 isl_ctx *FN(UNION,get_ctx)(__isl_keep UNION *u)
27 static __isl_keep isl_space *FN(UNION,peek_space)(__isl_keep UNION *u)
36 __isl_give isl_space *FN(UNION,get_space)(__isl_keep UNION *u)
38 return isl_space_copy(FN(UNION,peek_space)(u));
44 isl_size FN(UNION,dim)(__isl_keep UNION *u, enum isl_dim_type type)
50 isl_die(FN(UNION,get_ctx)(u), isl_error_invalid,
60 int FN(UNION,find_dim_by_name)(__isl_keep UNION *u, enum isl_dim_type type,
70 static __isl_give UNION *FN(UNION,alloc)(__isl_take isl_space *space
73 UNION *u;
79 u = isl_calloc_type(space->ctx, UNION);
87 return FN(UNION,free)(u);
95 /* Create an empty/zero union without specifying any parameters.
97 __isl_give UNION *FN(FN(UNION,ZERO),ctx)(isl_ctx *ctx OPT_TYPE_PARAM)
102 return FN(FN(UNION,ZERO),space)(space OPT_TYPE_ARG(NO_LOC));
105 __isl_give UNION *FN(FN(UNION,ZERO),space)(__isl_take isl_space *space
108 return FN(UNION,alloc)(space OPT_TYPE_ARG(NO_LOC), 16);
113 __isl_give UNION *FN(UNION,ZERO)(__isl_take isl_space *space OPT_TYPE_PARAM)
115 return FN(FN(UNION,ZERO),space)(space OPT_TYPE_ARG(NO_LOC));
118 __isl_give UNION *FN(UNION,copy)(__isl_keep UNION *u)
141 __isl_give PART *FN(FN(UNION,extract),BASE)(__isl_keep UNION *u,
146 entry = FN(UNION,find_part_entry)(u, space, 0);
162 * Otherwise, compute the union sum of "part" and the part in "u"
165 static __isl_give UNION *FN(UNION,add_part_generic)(__isl_take UNION *u,
182 u = FN(UNION,align_params)(u, FN(PART,get_space)(part));
183 part = FN(PART,align_params)(part, FN(UNION,get_space)(u));
185 u = FN(UNION,cow)(u);
190 if (FN(UNION,check_disjoint_domain_other)(u, part) < 0)
192 entry = FN(UNION,find_part_entry)(u, part->dim, 1);
200 FN(UNION,check_disjoint_domain)(entry->data, part) < 0)
208 u = FN(UNION,remove_part_entry)(u, entry);
215 FN(UNION,free)(u);
222 __isl_give UNION *FN(FN(UNION,add),BASE)(__isl_take UNION *u,
225 return FN(UNION,add_part_generic)(u, part, 1);
228 /* Allocate a UNION with the same type (if any) and the same size as "u" and
231 static __isl_give UNION *FN(UNION,alloc_same_size_on_space)(__isl_keep UNION *u,
236 return FN(UNION,alloc)(space OPT_TYPE_ARG(u->), u->table.n);
242 /* Allocate a UNION with the same space, the same type (if any) and
245 static __isl_give UNION *FN(UNION,alloc_same_size)(__isl_keep UNION *u)
247 return FN(UNION,alloc_same_size_on_space)(u, FN(UNION,get_space)(u));
251 * should modify the base expressions in the union expression.
253 * If "inplace" is set, then the base expression in the input union
255 * change the meaning of the union or that the union only
257 * If "space" is not NULL, then a new union is created in this space.
264 S(UNION,transform_control) {
277 S(UNION,transform_data)
279 S(UNION,transform_control) *control;
280 UNION *res;
284 * place it back into the input union if control->inplace is set.
286 static isl_stat FN(UNION,transform_entry)(void **entry, void *user)
288 S(UNION,transform_data) *data = (S(UNION,transform_data) *)user;
289 S(UNION,transform_control) *control = data->control;
309 data->res = FN(FN(UNION,add),BASE)(data->res, part);
316 /* Return a UNION that is obtained by modifying "u" according to "control".
318 static __isl_give UNION *FN(UNION,transform)(__isl_take UNION *u,
319 S(UNION,transform_control) *control)
321 S(UNION,transform_data) data = { control };
330 space = FN(UNION,get_space)(u);
331 data.res = FN(UNION,alloc_same_size_on_space)(u, space);
333 if (FN(UNION,foreach_inplace)(u, &FN(UNION,transform_entry), &data) < 0)
334 data.res = FN(UNION,free)(data.res);
336 FN(UNION,free)(u);
340 /* Return a UNION living in "space" that is otherwise obtained by modifying "u"
343 static __isl_give UNION *FN(UNION,transform_space)(__isl_take UNION *u,
344 __isl_take isl_space *space, S(UNION,transform_control) *control)
347 return FN(UNION,free)(u);
349 u = FN(UNION,transform)(u, control);
359 * Otherwise, create a new UNION from "u" and discard the original.
361 static __isl_give UNION *FN(UNION,transform_inplace)(__isl_take UNION *u,
364 S(UNION,transform_control) control = { .fn = fn, .fn_user = user };
367 single_ref = FN(UNION,has_single_reference)(u);
369 return FN(UNION,free)(u);
372 return FN(UNION,transform)(u, &control);
378 static __isl_give PART *FN(UNION,copy_part)(__isl_take PART *part, void *user)
383 __isl_give UNION *FN(UNION,dup)(__isl_keep UNION *u)
385 S(UNION,transform_control) control = { .fn = &FN(UNION,copy_part) };
387 u = FN(UNION,copy)(u);
388 return FN(UNION,transform)(u, &control);
391 __isl_give UNION *FN(UNION,cow)(__isl_take UNION *u)
399 return FN(UNION,dup)(u);
402 __isl_null UNION *FN(UNION,free)(__isl_take UNION *u)
411 &FN(UNION,free_u_entry), NULL);
418 static __isl_give PART *FN(UNION,align_entry)(__isl_take PART *part, void *user)
429 static __isl_give UNION *FN(UNION,realign_domain)(__isl_take UNION *u,
432 S(UNION,transform_control) control = {
433 .fn = &FN(UNION,align_entry),
442 u = FN(UNION,transform_space)(u, space, &control);
446 FN(UNION,free)(u);
453 __isl_give UNION *FN(UNION,align_params)(__isl_take UNION *u,
460 space = FN(UNION,peek_space)(u);
472 return FN(UNION,realign_domain)(u, r);
475 FN(UNION,free)(u);
479 /* Add "part" to *u, taking the union sum if "u" already has
482 static isl_stat FN(UNION,union_add_part)(__isl_take PART *part, void *user)
484 UNION **u = (UNION **)user;
486 *u = FN(UNION,add_part_generic)(*u, part, 0);
491 /* Compute the sum of "u1" and "u2" on the union of their domains,
501 static __isl_give UNION *FN(UNION,union_add_)(__isl_take UNION *u1,
502 __isl_take UNION *u2)
504 u1 = FN(UNION,align_params)(u1, FN(UNION,get_space)(u2));
505 u2 = FN(UNION,align_params)(u2, FN(UNION,get_space)(u1));
507 u1 = FN(UNION,cow)(u1);
512 if (FN(FN(UNION,foreach),BASE)(u2, &FN(UNION,union_add_part), &u1) < 0)
515 FN(UNION,free)(u2);
519 FN(UNION,free)(u1);
520 FN(UNION,free)(u2);
526 /* Compute the sum of "u1" and "u2" on the union of their domains,
530 __isl_give UNION *FN(UNION,union_add)(__isl_take UNION *u1,
531 __isl_take UNION *u2)
533 return FN(UNION,union_add_)(u1, u2);
538 __isl_give UNION *FN(FN(UNION,from),BASE)(__isl_take PART *part)
541 UNION *u;
551 u = FN(UNION,ZERO)(space OPT_TYPE_ARG(part->));
552 u = FN(FN(UNION,add),BASE)(u, part);
560 __isl_give UNION *FN(FN(PART,to_union),BASE)(__isl_take PART *part)
562 return FN(FN(UNION,from),BASE)(part);
565 S(UNION,match_bin_data) {
566 UNION *u2;
567 UNION *res;
575 static isl_stat FN(UNION,match_bin_entry)(__isl_take PART *part, void *user)
577 S(UNION,match_bin_data) *data = user;
583 entry2 = FN(UNION,find_part_entry)(data->u2, space, 0);
595 isl_die(FN(UNION,get_ctx)(data->u2), isl_error_invalid,
601 data->res = FN(FN(UNION,add),BASE)(data->res, part);
614 static __isl_give UNION *FN(UNION,match_bin_op)(__isl_take UNION *u1,
615 __isl_take UNION *u2,
621 static __isl_give UNION *FN(UNION,match_bin_op)(__isl_take UNION *u1,
622 __isl_take UNION *u2,
625 S(UNION,match_bin_data) data = { NULL, NULL, fn };
627 u1 = FN(UNION,align_params)(u1, FN(UNION,get_space)(u2));
628 u2 = FN(UNION,align_params)(u2, FN(UNION,get_space)(u1));
634 data.res = FN(UNION,alloc_same_size)(u1);
635 if (FN(FN(UNION,foreach),BASE)(u1,
636 &FN(UNION,match_bin_entry), &data) < 0)
639 FN(UNION,free)(u1);
640 FN(UNION,free)(u2);
643 FN(UNION,free)(u1);
644 FN(UNION,free)(u2);
645 FN(UNION,free)(data.res);
652 * is computed on the union of the domains of "u1" and "u2".
655 __isl_give UNION *FN(UNION,add)(__isl_take UNION *u1, __isl_take UNION *u2)
658 return FN(UNION,union_add_)(u1, u2);
660 return FN(UNION,match_bin_op)(u1, u2, &FN(PART,add));
664 S(UNION,any_set_data) {
669 static __isl_give PART *FN(UNION,any_set_entry)(__isl_take PART *part,
672 S(UNION,any_set_data) *data = user;
679 static __isl_give UNION *FN(UNION,any_set_op)(__isl_take UNION *u,
683 S(UNION,any_set_data) data = { NULL, fn };
684 S(UNION,transform_control) control = {
685 .fn = &FN(UNION,any_set_entry),
689 u = FN(UNION,align_params)(u, isl_set_get_space(set));
690 set = isl_set_align_params(set, FN(UNION,get_space)(u));
696 u = FN(UNION,transform)(u, &control);
700 FN(UNION,free)(u);
707 __isl_give UNION *FN(UNION,intersect_params)(__isl_take UNION *u,
710 return FN(UNION,any_set_op)(u, set, &FN(PW,intersect_params));
716 __isl_give UNION *FN(UNION,gist_params)(__isl_take UNION *u,
719 return FN(UNION,any_set_op)(u, set, &FN(PW,gist_params));
727 * "fn" is applied to each part in the union and each corresponding
728 * set in the union set, i.e., such that the set lives in the same space
730 * If "match_space" is not NULL, then the set extracted from the union set
735 S(UNION,match_domain_control) {
741 S(UNION,match_domain_data) {
743 UNION *res;
744 S(UNION,match_domain_control) *control;
751 static isl_stat FN(UNION,match_domain_entry)(__isl_take PART *part, void *user)
753 S(UNION,match_domain_data) *data = user;
777 data->res = FN(FN(UNION,add),BASE)(data->res, part);
787 static __isl_give UNION *FN(UNION,match_domain_op)(__isl_take UNION *u,
788 __isl_take isl_union_set *uset, S(UNION,match_domain_control) *control)
790 S(UNION,match_domain_data) data = { NULL, NULL, control };
796 data.res = FN(UNION,alloc_same_size)(u);
797 if (FN(FN(UNION,foreach),BASE)(u,
798 &FN(UNION,match_domain_entry), &data) < 0)
801 FN(UNION,free)(u);
805 FN(UNION,free)(u);
807 FN(UNION,free)(data.res);
815 __isl_give UNION *FN(UNION,intersect_domain_union_set)(__isl_take UNION *u,
818 S(UNION,match_domain_control) control = {
823 return FN(UNION,intersect_params)(u,
825 return FN(UNION,match_domain_op)(u, uset, &control);
830 __isl_give UNION *FN(UNION,intersect_domain)(__isl_take UNION *u,
833 return FN(UNION,intersect_domain_union_set)(u, uset);
841 static isl_bool FN(UNION,select_entry)(__isl_keep PART *part, void *user)
853 __isl_give UNION *FN(UNION,intersect_domain_space)(__isl_take UNION *u,
856 S(UNION,transform_control) control = {
857 .filter = &FN(UNION,select_entry),
861 u = FN(UNION,transform)(u, &control);
876 __isl_give UNION *FN(UNION,intersect_domain_wrapped_domain)(__isl_take UNION *u,
879 S(UNION,match_domain_control) control = {
885 return FN(UNION,match_domain_op)(u, uset, &control);
891 __isl_give UNION *FN(UNION,intersect_domain_wrapped_range)(__isl_take UNION *u,
894 S(UNION,match_domain_control) control = {
900 return FN(UNION,match_domain_op)(u, uset, &control);
907 static __isl_give PART *FN(UNION,subtract_domain_entry)(__isl_take PART *part,
921 __isl_give UNION *FN(UNION,subtract_domain_union_set)(__isl_take UNION *u,
924 S(UNION,transform_control) control = {
925 .fn = &FN(UNION,subtract_domain_entry),
929 u = FN(UNION,transform)(u, &control);
936 __isl_give UNION *FN(UNION,subtract_domain)(__isl_take UNION *u,
939 return FN(UNION,subtract_domain_union_set)(u, uset);
947 static isl_bool FN(UNION,filter_out_entry)(__isl_keep PART *part, void *user)
959 __isl_give UNION *FN(UNION,subtract_domain_space)(__isl_take UNION *u,
962 S(UNION,transform_control) control = {
963 .filter = &FN(UNION,filter_out_entry),
967 u = FN(UNION,transform)(u, &control);
972 __isl_give UNION *FN(UNION,gist)(__isl_take UNION *u,
975 S(UNION,match_domain_control) control = {
980 return FN(UNION,gist_params)(u, isl_set_from_union_set(uset));
981 return FN(UNION,match_domain_op)(u, uset, &control);
984 /* Coalesce an entry in a UNION. Coalescing is performed in-place.
985 * Since the UNION may have several references, the entry is only
988 static isl_stat FN(UNION,coalesce_entry)(void **entry, void *user)
1003 __isl_give UNION *FN(UNION,coalesce)(__isl_take UNION *u)
1005 if (FN(UNION,foreach_inplace)(u, &FN(UNION,coalesce_entry), NULL) < 0)
1010 FN(UNION,free)(u);
1014 static isl_stat FN(UNION,domain_entry)(__isl_take PART *part, void *user)
1023 __isl_give isl_union_set *FN(UNION,domain)(__isl_take UNION *u)
1027 uset = isl_union_set_empty(FN(UNION,get_space)(u));
1028 if (FN(FN(UNION,foreach),BASE)(u, &FN(UNION,domain_entry), &uset) < 0)
1031 FN(UNION,free)(u);
1036 FN(UNION,free)(u);
1043 static __isl_give UNION *FN(UNION,negate_type)(__isl_take UNION *u)
1045 u = FN(UNION,cow)(u);
1055 static __isl_give UNION *FN(UNION,negate_type)(__isl_take UNION *u)
1063 static __isl_give PART *FN(UNION,scale_val_entry)(__isl_take PART *part,
1073 __isl_give UNION *FN(UNION,scale_val)(__isl_take UNION *u,
1084 UNION *zero;
1085 isl_space *space = FN(UNION,get_space)(u);
1086 zero = FN(UNION,ZERO)(space OPT_TYPE_ARG(u->));
1087 FN(UNION,free)(u);
1096 u = FN(UNION,transform_inplace)(u, &FN(UNION,scale_val_entry), v);
1098 u = FN(UNION,negate_type)(u);
1104 FN(UNION,free)(u);
1110 static __isl_give PART *FN(UNION,scale_down_val_entry)(__isl_take PART *part,
1120 __isl_give UNION *FN(UNION,scale_down_val)(__isl_take UNION *u,
1137 u = FN(UNION,transform_inplace)(u, &FN(UNION,scale_down_val_entry), v);
1139 u = FN(UNION,negate_type)(u);
1145 FN(UNION,free)(u);
1156 S(UNION,every_data) {
1167 static isl_stat FN(UNION,every_entry)(void **entry, void *user)
1169 S(UNION,every_data) *data = user;
1181 isl_bool FN(FN(UNION,every),BASE)(__isl_keep UNION *u,
1184 S(UNION,every_data) data = { test, user };
1187 if (FN(UNION,foreach_inplace)(u, &FN(UNION,every_entry), &data) < 0 &&
1194 S(UNION,plain_is_equal_data)
1196 UNION *u2;
1199 static isl_bool FN(UNION,plain_is_equal_el)(__isl_keep PW *pw, void *user)
1201 S(UNION,plain_is_equal_data) *data = user;
1204 entry = FN(UNION,find_part_entry)(data->u2, pw->dim, 0);
1213 isl_bool FN(UNION,plain_is_equal)(__isl_keep UNION *u1, __isl_keep UNION *u2)
1215 S(UNION,plain_is_equal_data) data;
1225 n1 = FN(FN(UNION,n),BASE)(u1);
1226 n2 = FN(FN(UNION,n),BASE)(u2);
1232 u1 = FN(UNION,copy)(u1);
1233 u2 = FN(UNION,copy)(u2);
1234 u1 = FN(UNION,align_params)(u1, FN(UNION,get_space)(u2));
1235 u2 = FN(UNION,align_params)(u2, FN(UNION,get_space)(u1));
1240 is_equal = FN(FN(UNION,every),BASE)(u1,
1241 &FN(UNION,plain_is_equal_el), &data);
1243 FN(UNION,free)(u1);
1244 FN(UNION,free)(u2);
1248 FN(UNION,free)(u1);
1249 FN(UNION,free)(u2);
1256 static isl_bool FN(UNION,no_nan_el)(__isl_keep PW *pw, void *user)
1263 isl_bool FN(UNION,involves_nan)(__isl_keep UNION *u)
1267 no_nan = FN(FN(UNION,every),BASE)(u, &FN(UNION,no_nan_el), NULL);
1275 S(UNION,drop_dims_data) {
1283 static __isl_give PART *FN(UNION,drop_dims_entry)(__isl_take PART *part,
1286 S(UNION,drop_dims_data) *data = user;
1294 __isl_give UNION *FN(UNION,drop_dims)( __isl_take UNION *u,
1298 S(UNION,drop_dims_data) data = { type, first, n };
1299 S(UNION,transform_control) control = {
1300 .fn = &FN(UNION,drop_dims_entry),
1308 isl_die(FN(UNION,get_ctx)(u), isl_error_invalid,
1310 return FN(UNION,free)(u));
1312 space = FN(UNION,get_space)(u);
1314 return FN(UNION,transform_space)(u, space, &control);
1320 static isl_bool FN(UNION,el_does_not_involve_param_at)(__isl_keep PW *pw,
1334 static isl_bool FN(UNION,involves_dims)(__isl_take UNION *u,
1340 isl_die(FN(UNION,get_ctx)(u), isl_error_invalid,
1344 isl_die(FN(UNION,get_ctx)(u), isl_error_unsupported,
1348 none = FN(FN(UNION,every),BASE)(u,
1349 &FN(UNION,el_does_not_involve_param_at), &first);
1355 #define TYPE UNION
1364 S(UNION,set_dim_name_data) {
1372 static __isl_give PART *FN(UNION,set_dim_name_entry)(__isl_take PART *part,
1375 S(UNION,set_dim_name_data) *data = user;
1383 __isl_give UNION *FN(UNION,set_dim_name)(__isl_take UNION *u,
1386 S(UNION,set_dim_name_data) data = { pos, s };
1387 S(UNION,transform_control) control = {
1388 .fn = &FN(UNION,set_dim_name_entry),
1397 isl_die(FN(UNION,get_ctx)(u), isl_error_invalid,
1399 return FN(UNION,free)(u));
1401 space = FN(UNION,get_space)(u);
1403 return FN(UNION,transform_space)(u, space, &control);
1409 static __isl_give PART *FN(UNION,reset_user_entry)(__isl_take PART *part,
1418 __isl_give UNION *FN(UNION,reset_user)(__isl_take UNION *u)
1420 S(UNION,transform_control) control = {
1421 .fn = &FN(UNION,reset_user_entry),
1425 space = FN(UNION,get_space)(u);
1427 return FN(UNION,transform_space)(u, space, &control);
1432 static isl_stat FN(UNION,add_to_list)(void **entry, void *user)
1449 __isl_give LIST(PART) *FN(FN(UNION,get),LIST(BASE))(__isl_keep UNION *u)
1456 n = FN(FN(UNION,n),BASE)(u);
1459 list = FN(LIST(PART),alloc)(FN(UNION,get_ctx(u)), n);
1460 if (FN(UNION,foreach_inplace)(u, &FN(UNION,add_to_list), &list) < 0)