Lines Matching full:domain
69 /* Generate an AST for a single domain based on
72 * We extend the schedule with the iteration domain
86 * to be executed from the current schedule domain.
136 * domain element "map" and put a guard around it based its (simplified)
137 * domain. "executed" is the original inverse schedule from which "map"
139 * or it is the result of gisting "executed" with respect to the build domain.
183 /* Generate an AST for a single domain based on
186 * If there is more than one domain element associated to the current
191 * domain specified by the user. We therefore first introduce
192 * some of the constraints of data->build->domain. In particular,
199 * of the domain as the resulting map is the one from which the call
221 isl_set *domain; in generate_domain() local
225 domain = isl_ast_build_get_domain(data->build); in generate_domain()
226 domain = isl_set_from_basic_set(isl_set_simple_hull(domain)); in generate_domain()
227 executed = isl_map_intersect_domain(executed, domain); in generate_domain()
317 * domain in generate_domain.
383 * in the domain of "executed". In principle, we only need to plug
470 * of "domain" as a piecewise affine expression.
481 static __isl_give isl_pw_aff *exact_bound(__isl_keep isl_set *domain, in exact_bound() argument
489 domain = isl_set_copy(domain); in exact_bound()
492 domain = isl_set_intersect(domain, stride); in exact_bound()
494 it_map = isl_ast_build_map_to_iterator(build, domain); in exact_bound()
517 * with respect to the other bounds in "list" and the domain of "build".
524 * one domain element for which it is larger than all other lower bounds.
525 * For each lower bound we therefore intersect the domain with
534 isl_set *domain; in remove_redundant_lower_bounds() local
544 domain = isl_ast_build_get_domain(build); in remove_redundant_lower_bounds()
551 domain_i = isl_set_copy(domain); in remove_redundant_lower_bounds()
579 isl_set_free(domain); in remove_redundant_lower_bounds()
583 isl_set_free(domain); in remove_redundant_lower_bounds()
590 * from "domain" instead.
600 __isl_keep isl_set *domain, __isl_keep isl_ast_build *build) in lower_bounds() argument
615 pa = exact_bound(domain, build, 0); in lower_bounds()
641 * from "domain" instead.
645 __isl_keep isl_set *domain, __isl_keep isl_ast_build *build) in upper_bounds() argument
657 pa = exact_bound(domain, build, 1); in upper_bounds()
943 /* Does "pa" have a negative constant term over its entire domain?
1085 * that "domain" simply doesn't have an upper bound or that we didn't
1089 * a single upper bound from "domain" and so we use the list form.
1095 __isl_keep isl_set *domain, int depth) in use_upper_bound_list() argument
1100 return isl_set_dim_has_upper_bound(domain, isl_dim_set, depth); in use_upper_bound_list()
1136 /* Update "graft" based on "bounds" and "domain" for the generic,
1141 * "domain" is the subset of the intersection of the constraints
1147 * In that case, we use "domain" to derive lower and/or upper bounds.
1171 __isl_keep isl_set *domain, __isl_keep isl_ast_build *build) in refine_generic_bounds() argument
1192 use_list = use_upper_bound_list(ctx, n_upper, domain, depth); in refine_generic_bounds()
1194 lower = lower_bounds(c_lower, depth, domain, build); in refine_generic_bounds()
1197 upper_list = upper_bounds(c_upper, depth, domain, build); in refine_generic_bounds()
1201 upper_set = isl_set_universe(isl_set_get_space(domain)); in refine_generic_bounds()
1258 /* Update "graft" based on "bounds" and "domain" for the generic,
1265 * "domain" is the subset of the intersection of the constraints
1276 __isl_keep isl_set *domain, __isl_keep isl_ast_build *build) in refine_generic_split() argument
1306 return refine_generic_bounds(graft, lower, upper, domain, build); in refine_generic_split()
1309 /* Update "graft" based on "bounds" and "domain" for the generic,
1314 * "domain" is the subset of "bounds" for which some code is executed.
1322 __isl_keep isl_basic_set *bounds, __isl_keep isl_set *domain, in refine_generic() argument
1332 graft = refine_generic_split(graft, list, domain, build); in refine_generic()
1398 * the schedule domain "bounds" and return the node encapsulated
1403 * "domain" is the domain of "executed", with inner dimensions projected out.
1407 * "domain" may satisfy additional equalities that result
1424 * reflected in the build->domain.
1425 * We first add this information and the "bounds" to the sub_build->domain.
1441 * of the domain based on information available in the inverse schedule
1442 * and the build domain, that then this information is also reflected
1471 __isl_take isl_basic_set *bounds, __isl_take isl_set *domain, in create_node_scaled() argument
1487 domain = isl_ast_build_eliminate_divs(build, domain); in create_node_scaled()
1488 domain = isl_set_detect_equalities(domain); in create_node_scaled()
1489 hull = isl_set_unshifted_simple_hull(isl_set_copy(domain)); in create_node_scaled()
1548 domain, for_build); in create_node_scaled()
1559 isl_set_free(domain); in create_node_scaled()
1652 * the schedule domain "bounds" and return the node encapsulated
1657 * "domain" is the domain of "executed", with inner dimensions projected out.
1692 __isl_take isl_basic_set *bounds, __isl_take isl_set *domain, in create_node() argument
1703 return create_node_scaled(executed, bounds, domain, build); in create_node()
1710 return create_node_scaled(executed, bounds, domain, build); in create_node()
1751 domain = isl_set_preimage_multi_aff(domain, in create_node()
1763 return create_node_scaled(executed, bounds, domain, build); in create_node()
1802 /* Generate code for the schedule domain "bounds"
1806 * conflict with the current build domain
1813 * We therefore need to compute that part of the schedule domain that
1821 isl_set *domain = NULL; in add_node() local
1834 domain = isl_set_from_union_set(uset); in add_node()
1835 domain = isl_ast_build_specialize(build, domain); in add_node()
1837 domain = isl_set_compute_divs(domain); in add_node()
1838 domain = isl_ast_build_eliminate_inner(build, domain); in add_node()
1839 disjoint = isl_set_is_disjoint(domain, build->domain); in add_node()
1845 build = isl_ast_build_detect_strides(build, isl_set_copy(domain)); in add_node()
1847 graft = create_node(executed, bounds, domain, in add_node()
1855 isl_set_free(domain); in add_node()
1976 * This may happen in particular in case of unrolling since the domain
2226 * "domain" collects the separated domains.
2231 isl_set *domain; member
2236 * The domain of "map" may involve inner dimensions, so we
2242 isl_set *domain; in implicit_bounds() local
2244 domain = isl_map_domain(map); in implicit_bounds()
2245 domain = isl_ast_build_eliminate(build, domain); in implicit_bounds()
2247 return domain; in implicit_bounds()
2261 isl_set *domain; in explicit_bounds() local
2271 domain = isl_map_domain(map); in explicit_bounds()
2272 dim = isl_set_dim(domain, isl_dim_set); in explicit_bounds()
2273 domain = isl_set_detect_equalities(domain); in explicit_bounds()
2274 domain = isl_set_drop_constraints_involving_dims(domain, in explicit_bounds()
2276 domain = isl_set_remove_divs_involving_dims(domain, in explicit_bounds()
2278 domain = isl_set_remove_unknown_divs(domain); in explicit_bounds()
2280 return domain; in explicit_bounds()
2283 /* Split data->domain into pieces that intersect with the range of "map"
2286 * with data->domain.
2291 isl_set *domain; in separate_domain() local
2295 domain = explicit_bounds(map, data->build); in separate_domain()
2297 domain = implicit_bounds(map, data->build); in separate_domain()
2299 domain = isl_set_coalesce(domain); in separate_domain()
2300 domain = isl_set_make_disjoint(domain); in separate_domain()
2301 d1 = isl_set_subtract(isl_set_copy(domain), isl_set_copy(data->domain)); in separate_domain()
2302 d2 = isl_set_subtract(isl_set_copy(data->domain), isl_set_copy(domain)); in separate_domain()
2303 data->domain = isl_set_intersect(data->domain, domain); in separate_domain()
2304 data->domain = isl_set_union(data->domain, d1); in separate_domain()
2305 data->domain = isl_set_union(data->domain, d2); in separate_domain()
2312 * That is, break up the domain of "executed" into basic sets,
2314 * the same domain spaces.
2316 * "space" is the (single) domain space of "executed".
2328 data.domain = isl_set_empty(space); in separate_schedule_domains()
2330 data.domain = isl_set_free(data.domain); in separate_schedule_domains()
2333 return data.domain; in separate_schedule_domains()
2339 * "domain" is the original set for which to find a lower bound
2341 * "expansion" is the expansion that needs to be applied to "domain"
2354 isl_set *domain; member
2412 set = isl_set_copy(data->domain); in get_expanded_n_div()
2488 * over the domain. If there is such a value "n", then we know
2517 max = isl_set_max_val(data->domain, aff); in update_unrolling_lower_bound()
2551 * and a size n such that "domain" is a subset of
2559 * "expansion" is the expansion that needs to be applied to "domain"
2562 * Inner dimensions have been eliminated from "domain" by the caller.
2575 __isl_keep isl_ast_build *build, __isl_keep isl_set *domain, in find_unroll_lower_bound() argument
2579 { build, domain, depth, expansion, NULL, n, -1 }; in find_unroll_lower_bound()
2582 hull = isl_set_simple_hull(isl_set_copy(domain)); in find_unroll_lower_bound()
2591 isl_die(isl_set_get_ctx(domain), isl_error_invalid, in find_unroll_lower_bound()
2600 /* Call "fn" on each iteration of the current dimension of "domain".
2613 * We then look for a lower bound on i' and a size such that the domain
2618 * and then take slices of the domain at values of i'
2633 static int foreach_iteration(__isl_take isl_set *domain, in foreach_iteration() argument
2647 domain = isl_set_free(domain); in foreach_iteration()
2649 domain = isl_ast_build_eliminate_inner(build, domain); in foreach_iteration()
2650 domain = isl_set_intersect(domain, isl_ast_build_get_domain(build)); in foreach_iteration()
2653 isl_set_copy(domain)); in foreach_iteration()
2656 domain = isl_set_preimage_multi_aff(domain, in foreach_iteration()
2658 domain = isl_ast_build_eliminate_divs(stride_build, domain); in foreach_iteration()
2663 empty = isl_set_is_empty(domain); in foreach_iteration()
2669 lower = find_unroll_lower_bound(build, domain, depth, bmap, &n); in foreach_iteration()
2681 set = isl_set_copy(domain); in foreach_iteration()
2692 isl_set_free(domain); in foreach_iteration()
2705 * "schedule_domain" is the domain of "executed".
2733 * "class_domain" is the original class domain passed to do_unroll.
2742 /* Given an iteration of an unrolled domain represented by "bset",
2745 * the class domain again to ensure that each element in the list
2767 * of the current dimension in "domain" and remove the corresponding
2768 * sets from the class domain. Return the updated class domain.
2770 * from this domain.
2775 * used to update the class domain.
2778 __isl_take isl_set *domain, __isl_take isl_set *class_domain) in do_unroll() argument
2782 if (!domain) in do_unroll()
2785 return isl_set_free(domain); in do_unroll()
2789 data.unroll_domain = isl_set_empty(isl_set_get_space(domain)); in do_unroll()
2791 if (foreach_iteration(domain, domains->build, NULL, in do_unroll()
2801 * dimension, for that part of the schedule domain that lies in the
2802 * intersection of the option domain and the class domain.
2803 * Remove the corresponding sets from the class domain and
2804 * return the updated class domain.
2806 * We first break up the unroll option domain into individual pieces
2807 * and then handle each of them separately. The unroll option domain
2811 * schedule domain that have the same value at the current dimension.
2812 * We therefore need to break up the unroll option domain before
2813 * intersecting with class and schedule domain, hoping that the
2814 * unroll option domain specified by the user is relatively simple.
2862 * the schedule domain, the atomic option domain and the class domain.
2864 * from class_domain. Return the updated class domain.
2866 * We construct a single domain rather than trying to combine
2871 * of the class domain so that it would not intersect with any other
2873 * domain in case separation classes are being used.
2875 * "domain" is the intersection of the schedule domain and the class domain,
2883 isl_set *domain, *atomic_domain; in compute_atomic_domain() local
2886 domain = isl_set_copy(domains->option[isl_ast_loop_atomic]); in compute_atomic_domain()
2887 domain = isl_set_intersect(domain, isl_set_copy(class_domain)); in compute_atomic_domain()
2888 domain = isl_set_intersect(domain, in compute_atomic_domain()
2890 empty = isl_set_is_empty(domain); in compute_atomic_domain()
2894 isl_set_free(domain); in compute_atomic_domain()
2898 domain = isl_ast_build_eliminate(domains->build, domain); in compute_atomic_domain()
2899 domain = isl_set_coalesce_preserve(domain); in compute_atomic_domain()
2900 bset = isl_set_unshifted_simple_hull(domain); in compute_atomic_domain()
2901 domain = isl_set_from_basic_set(bset); in compute_atomic_domain()
2902 atomic_domain = isl_set_copy(domain); in compute_atomic_domain()
2903 domain = isl_set_intersect(domain, isl_set_copy(class_domain)); in compute_atomic_domain()
2905 domain = isl_set_make_disjoint(domain); in compute_atomic_domain()
2906 list = isl_basic_set_list_from_set(domain); in compute_atomic_domain()
2912 /* Split up the schedule domain into uniform basic sets,
2915 * Do this for that part of the schedule domain that lies in the
2916 * intersection of "class_domain" and the separate option domain.
2919 * of the schedule domain, but this does not make a difference
2920 * since we are going to intersect it with the domain of the inverse schedule.
2921 * If it includes schedule domain constraints, then they may involve
2928 isl_set *domain; in compute_separate_domain() local
2933 domain = isl_set_copy(domains->option[isl_ast_loop_separate]); in compute_separate_domain()
2934 domain = isl_set_intersect(domain, isl_set_copy(class_domain)); in compute_separate_domain()
2937 isl_union_set_from_set(domain)); in compute_separate_domain()
2945 domain = separate_schedule_domains(space, executed, domains->build); in compute_separate_domain()
2947 list = isl_basic_set_list_from_set(domain); in compute_separate_domain()
2953 /* Split up the domain at the current depth into disjoint
2955 * for the given separation class domain.
2958 * is the domain of the current class and does not refer to inner dimensions.
2959 * Otherwise, "class_domain" is the universe domain.
2961 * We first make sure that the class domain is disjoint from
2967 * from the schedule domain.
2969 * For unrolling, the actual schedule domain is needed (with divs that
2979 * The domain that has been made atomic may be larger than specified
2981 * This possibly larger domain is removed from class_domain by
2982 * compute_atomic_domain. It is computed first so that the extended domain
2994 isl_set *domain; in compute_partial_domains() local
3004 domain = isl_set_copy(class_domain); in compute_partial_domains()
3006 if (compute_separate_domain(domains, domain) < 0) in compute_partial_domains()
3008 domain = isl_set_subtract(domain, in compute_partial_domains()
3011 domain = isl_set_intersect(domain, in compute_partial_domains()
3014 domain = isl_ast_build_eliminate(domains->build, domain); in compute_partial_domains()
3015 domain = isl_set_intersect(domain, isl_set_copy(class_domain)); in compute_partial_domains()
3017 domain = isl_set_coalesce_preserve(domain); in compute_partial_domains()
3018 domain = isl_set_make_disjoint(domain); in compute_partial_domains()
3020 list = isl_basic_set_list_from_set(domain); in compute_partial_domains()
3027 isl_set_free(domain); in compute_partial_domains()
3032 /* Split up the domain at the current depth into disjoint
3036 * We extract the corresponding class domain from domains->sep_class,
3043 isl_set *domain; in compute_class_domains() local
3047 domain = isl_map_domain(isl_map_intersect_range( in compute_class_domains()
3049 domain = isl_ast_build_compute_gist(domains->build, domain); in compute_class_domains()
3050 domain = isl_ast_build_eliminate(domains->build, domain); in compute_class_domains()
3052 disjoint = isl_set_plain_is_disjoint(domain, domains->schedule_domain); in compute_class_domains()
3056 isl_set_free(domain); in compute_class_domains()
3060 return compute_partial_domains(domains, domain); in compute_class_domains()
3089 /* Split up the domain at the current depth into disjoint
3095 * - the "schedule domain" is the domain of "executed"
3096 * - the "class domain" is the domain corresponding to the currrent
3098 * - the "option domain" is the domain corresponding to one of the options
3102 * and split up the domain for each of them separately.
3115 isl_set *domain; in compute_domains() local
3130 domain = isl_set_from_union_set(schedule_domain); in compute_domains()
3141 space = isl_set_get_space(domain); in compute_domains()
3143 domains.schedule_domain = isl_set_copy(domain); in compute_domains()
3154 domain = isl_set_free(domain); in compute_domains()
3156 isl_set_free(domain); in compute_domains()
3157 domain = isl_set_universe(isl_set_get_space(domains.done)); in compute_domains()
3159 domain = isl_ast_build_eliminate(build, domain); in compute_domains()
3161 if (compute_partial_domains(&domains, domain) < 0) in compute_domains()
3176 * We first split up the domain at the current depth into disjoint
3200 * We perform separation on the domain of "executed" and then generate
3207 isl_set *domain; in generate_shifted_component_tree_separate() local
3212 domain = separate_schedule_domains(space, in generate_shifted_component_tree_separate()
3214 domain_list = isl_basic_set_list_from_set(domain); in generate_shifted_component_tree_separate()
3249 /* Given an iteration of an unrolled domain represented by "bset",
3270 __isl_take isl_union_map *executed, __isl_take isl_set *domain, in generate_shifted_component_tree_unroll() argument
3275 if (foreach_iteration(domain, build, &init_unroll_tree, in generate_shifted_component_tree_unroll()
3285 /* Does "domain" involve a disjunction that is purely based on
3292 static isl_bool has_pure_outer_disjunction(__isl_keep isl_set *domain, in has_pure_outer_disjunction() argument
3302 n = isl_set_n_basic_set(domain); in has_pure_outer_disjunction()
3307 dim = isl_set_dim(domain, isl_dim_set); in has_pure_outer_disjunction()
3312 inner = isl_set_copy(domain); in has_pure_outer_disjunction()
3330 * The schedule domain is broken up or combined into basic sets
3334 * split the schedule domain into disjoint basic sets.
3338 * In the other cases, we need the global schedule domain.
3341 * schedule domain (with divs that may refer to the current dimension)
3350 * If the schedule domain involves a disjunction that is purely based on
3362 isl_set *domain; in generate_shifted_component_tree_base() local
3376 domain = isl_set_from_union_set(schedule_domain); in generate_shifted_component_tree_base()
3379 return generate_shifted_component_tree_unroll(executed, domain, in generate_shifted_component_tree_base()
3382 domain = isl_ast_build_eliminate(build, domain); in generate_shifted_component_tree_base()
3383 domain = isl_set_coalesce_preserve(domain); in generate_shifted_component_tree_base()
3385 outer_disjunction = has_pure_outer_disjunction(domain, build); in generate_shifted_component_tree_base()
3387 domain = isl_set_free(domain); in generate_shifted_component_tree_base()
3391 hull = isl_set_unshifted_simple_hull(domain); in generate_shifted_component_tree_base()
3394 domain = isl_set_make_disjoint(domain); in generate_shifted_component_tree_base()
3395 domain_list = isl_basic_set_list_from_set(domain); in generate_shifted_component_tree_base()
3411 /* Extract out the disjunction imposed by "domain" on the outer
3414 * In particular, remove all inner dimensions from "domain" (including
3418 static __isl_give isl_set *extract_disjunction(__isl_take isl_set *domain, in extract_disjunction() argument
3425 domain = isl_ast_build_specialize(build, domain); in extract_disjunction()
3427 dim = isl_set_dim(domain, isl_dim_set); in extract_disjunction()
3429 return isl_set_free(domain); in extract_disjunction()
3430 domain = isl_set_eliminate(domain, isl_dim_set, depth, dim - depth); in extract_disjunction()
3431 domain = isl_set_remove_unknown_divs(domain); in extract_disjunction()
3432 hull = isl_set_copy(domain); in extract_disjunction()
3434 domain = isl_set_gist(domain, hull); in extract_disjunction()
3436 return domain; in extract_disjunction()
3441 * in its generated domain.
3471 * In particular, do so for the specified subset of the schedule domain.
3473 * If we are outside of the isolated part, then "domain" may include
3479 __isl_keep isl_union_map *executed, __isl_take isl_set *domain, in generate_shifted_component_tree_part() argument
3487 uset = isl_union_set_from_set(isl_set_copy(domain)); in generate_shifted_component_tree_part()
3496 isl_set_free(domain); in generate_shifted_component_tree_part()
3503 domain = extract_disjunction(domain, build); in generate_shifted_component_tree_part()
3505 isl_set_copy(domain)); in generate_shifted_component_tree_part()
3510 list = list_add_guard(list, domain, build, sub_build); in generate_shifted_component_tree_part()
3512 isl_set_free(domain); in generate_shifted_component_tree_part()
3516 isl_set_free(domain); in generate_shifted_component_tree_part()
3523 * of the schedule domain, "before", "isolated", "after" and "other",
3590 * We first check if the user has specified an isolated schedule domain
3591 * and that we are not already outside of this isolated schedule domain.
3592 * If so, we break up the schedule domain into iterations that
3593 * precede the isolated domain, the isolated domain itself,
3594 * the iterations that follow the isolated domain and
3596 * to the isolated domain).
3599 * If the isolated domain is not convex, then it is replaced
3603 * to the isolated domain.
3606 * domain that does not belong to the isolated domain needs
3607 * to be scheduled after this isolated domain, but none of those
3608 * elements need to be scheduled before, break up the schedule domain
3609 * in only two parts, the isolated domain, and a part that will be
3610 * scheduled after the isolated domain.
3623 isl_set *domain; in generate_shifted_component_tree() local
3637 domain = isl_set_from_union_set(schedule_domain); in generate_shifted_component_tree()
3640 isolated = isl_set_intersect(isolated, isl_set_copy(domain)); in generate_shifted_component_tree()
3648 isl_set_free(domain); in generate_shifted_component_tree()
3668 domain = isl_set_subtract(domain, isl_set_copy(isolated)); in generate_shifted_component_tree()
3669 pure = only_intersects_first(domain, after, before); in generate_shifted_component_tree()
3674 domain, build, before, after); in generate_shifted_component_tree()
3675 domain = isl_set_subtract(domain, isl_set_copy(before)); in generate_shifted_component_tree()
3676 domain = isl_set_subtract(domain, isl_set_copy(after)); in generate_shifted_component_tree()
3682 after, domain, build); in generate_shifted_component_tree()
3684 isl_set_free(domain); in generate_shifted_component_tree()
3711 /* Given an array "domain" of isl_set_map_pairs and an array "order"
3712 * of indices into the "domain" array,
3717 struct isl_set_map_pair *domain, int *order, int n) in construct_component_executed() argument
3723 map = isl_map_copy(domain[order[0]].map); in construct_component_executed()
3726 map = isl_map_copy(domain[order[i]].map); in construct_component_executed()
3737 * of the elements of "domain" indexed by the first "n" elements of "order".
3740 struct isl_set_map_pair *domain, int *order, int n, in generate_shifted_component_from_list() argument
3745 executed = construct_component_executed(domain, order, n); in generate_shifted_component_from_list()
3765 /* Given an array "domain" of isl_set_map_pairs and an array "order"
3766 * of indices into the "domain" array,
3771 static int at_most_one_non_fixed(struct isl_set_map_pair *domain, in at_most_one_non_fixed() argument
3780 f = dim_is_fixed(domain[order[i]].set, depth); in at_most_one_non_fixed()
3793 /* Given an array "domain" of isl_set_map_pairs and an array "order"
3794 * of indices into the "domain" array,
3802 static int eliminate_non_fixed(struct isl_set_map_pair *domain, in eliminate_non_fixed() argument
3810 f = dim_is_fixed(domain[order[i]].set, depth); in eliminate_non_fixed()
3815 domain[order[i]].set = isl_ast_build_eliminate_inner(build, in eliminate_non_fixed()
3816 domain[order[i]].set); in eliminate_non_fixed()
3823 /* Given an array "domain" of isl_set_map_pairs and an array "order"
3824 * of indices into the "domain" array,
3825 * find the element of "domain" (amongst those indexed by the first "n"
3829 * Note that the domain with the smallest value may depend on the parameters
3832 * domain, one that should work in case a single domain provides the smallest
3836 * In particular, we compute the smallest value of the first domain
3837 * and replace it by that of any later domain if that later domain
3841 static int first_offset(struct isl_set_map_pair *domain, int *order, int n, in first_offset() argument
3849 isl_set_copy(domain[order[0]].set)); in first_offset()
3857 isl_set_copy(domain[order[i]].set)); in first_offset()
3884 * of the elements of "domain" indexed by the first "n" elements of "order".
3887 * between the values of the current dimension of domain "i"
3888 * and the values of the current dimension for some reference domain are
3895 * For each domain, we create a map
3900 * unchanged, and apply this map to the original schedule domain.
3906 * and assuming the offset is 0 for the A domain and 1 for the B domain,
3911 * to the schedule of the "A" domain and the mapping
3915 * to the schedule of the "B" domain.
3925 * If the value of the current iterator is j1 in one domain and j2 in another,
3960 struct isl_set_map_pair *domain, int *order, int n, in construct_shifted_executed() argument
4000 map_i = isl_map_apply_domain(isl_map_copy(domain[order[i]].map), in construct_shifted_executed()
4015 * given that the schedule domain is "shifted strided".
4018 * of the elements of "domain" indexed by the first "n" elements of "order".
4020 * The schedule domain being "shifted strided" means that the differences
4021 * between the values of the current dimension of domain "i"
4022 * and the values of the current dimension for some reference domain are
4027 * We first look for the domain with the "smallest" value for the current
4029 * domain is equal to zero. The other offsets are reduced modulo stride.
4037 * in a mapping that represents the new schedule domain in terms of the
4038 * old schedule domain.
4041 struct isl_set_map_pair *domain, int *order, int n, in generate_shift_component() argument
4056 first = first_offset(domain, order, n, build); in generate_shift_component()
4066 executed = construct_shifted_executed(domain, order, n, stride, mv, in generate_shift_component()
4106 * of the elements of "domain" indexed by the first "n" elements of "order".
4108 * This function may modify the "set" fields of "domain".
4129 * If there is only a single domain in the component, then there is
4137 * in terms of the new schedule domain, but that would introduce constraints
4153 * this analysis on individual domains as the lower bound in each domain
4157 * In particular, we compare the first domain that does not have an
4168 * domain should get split in pieces with a (non-shifted) stride.
4174 struct isl_set_map_pair *domain, int *order, int n, in generate_component() argument
4195 skip = at_most_one_non_fixed(domain, order, n, depth); in generate_component()
4205 return generate_shifted_component_from_list(domain, in generate_component()
4208 base = eliminate_non_fixed(domain, order, n, depth, build); in generate_component()
4221 isl_set_copy(domain[order[base]].set), in generate_component()
4222 isl_set_copy(domain[order[i]].set)); in generate_component()
4242 res = dim_is_fixed(domain[order[i]].set, depth); in generate_component()
4263 list = generate_shifted_component_from_list(domain, in generate_component()
4266 list = generate_shift_component(domain, order, n, gcd, mv, in generate_component()
4279 /* Store both "map" itself and its domain in the
4296 /* Is any domain element of "umap" scheduled after any of
4313 /* Is any domain element of "umap" scheduled after any of
4317 * We first check if any domain element is scheduled after any
4330 isl_union_set *domain, *range; in after_in_band() local
4359 domain = isl_union_map_domain(isl_union_map_copy(universe)); in after_in_band()
4362 umap1 = isl_union_map_intersect_domain(umap1, domain); in after_in_band()
4371 /* Is any domain element of "umap" scheduled after any of
4375 * The context constraints apply to the schedule domain,
4378 * to the range of the prefix schedule for both domain and
4385 isl_union_set *domain, *range; in after_in_context() local
4393 domain = isl_union_map_domain(isl_union_map_copy(universe)); in after_in_context()
4396 umap1 = isl_union_map_intersect_domain(umap1, domain); in after_in_context()
4410 /* Is any domain element of "umap" scheduled after any of
4414 * We apply the expansion to domain and range of "umap" and
4435 /* Is any domain element of "umap" scheduled after any of
4449 /* Is any domain element of "umap" scheduled after any of
4453 * We intersect domain and range of "umap" with the filter and
4474 /* Is any domain element of "umap" scheduled after any of
4480 * In particular, if the domain and the range of "umap"
4523 /* Is any domain element of "umap" scheduled after any of
4527 * This happens in particular if any domain element is
4591 /* Is any domain element of "umap" scheduled after any of
4621 "unexpected internal domain node", in after_in_tree()
4643 /* Is any domain element of "map1" scheduled after any domain
4651 * Otherwise, we construct a relation between domain elements
4652 * of "map1" and domain elements of "map2" that are scheduled
4686 * "domain" is an array of set-map pairs corresponding to the different
4687 * iteration domains. The set is the schedule domain, i.e., the domain
4694 struct isl_set_map_pair *domain; member
4697 /* Is any element of domain "i" scheduled after any element of domain "j"
4700 * data->domain[i].set contains the domain of the inverse schedule
4701 * for domain "i", i.e., elements in the schedule domain.
4714 isl_size dim = isl_set_dim(data->domain[i].set, isl_dim_set); in any_scheduled_after()
4723 follows = isl_set_follows_at(data->domain[i].set, in any_scheduled_after()
4724 data->domain[j].set, pos); in any_scheduled_after()
4737 after = after_in_subtree(data->build, data->domain[i].map, in any_scheduled_after()
4738 data->domain[j].map); in any_scheduled_after()
4751 * of one domain are scheduled before (or together with) all the elements
4752 * of the other domain. We therefore consider the graph with as nodes
4762 * Since the test is performed on the domain of the inverse schedules of
4764 * them in data.domain.
4779 data.domain = NULL; in generate_components()
4782 data.domain = isl_calloc_array(ctx, struct isl_set_map_pair, n); in generate_components()
4783 if (!data.domain) in generate_components()
4787 next = data.domain; in generate_components()
4816 list_c = generate_component(data.domain, in generate_components()
4828 isl_map_free(data.domain[i].map); in generate_components()
4829 isl_set_free(data.domain[i].set); in generate_components()
4831 free(data.domain); in generate_components()
4847 * generated for a single domain, then there can only be a single
4906 * reformulate the inverse schedule in terms of the internal schedule domain,
4938 * in the relative order specified by the corresponding domain element(s)
4939 * for those domain elements that belong to "set".
4942 * The caller ensures that "set" is a universe domain.
4944 * It is equal to the space of "set" if build->domain is parametric.
4950 * the (inverse) schedule refers to the external build domain and needs to
4951 * be transformed to refer to the internal build domain.
4964 * domain.
4986 embed = !isl_set_is_params(data->build->domain); in generate_code_in_space()
4990 isl_set *domain; in generate_code_in_space() local
4991 domain = isl_ast_build_get_domain(data->build); in generate_code_in_space()
4992 domain = isl_set_from_basic_set(isl_set_simple_hull(domain)); in generate_code_in_space()
4993 executed = isl_union_map_intersect_params(executed, domain); in generate_code_in_space()
5009 * in the relative order specified by the corresponding domain element(s)
5010 * for those domain elements that belong to "set".
5013 * The caller ensures that "set" is a universe domain.
5016 * need to be a wrapped relation with S as domain. That is, it needs
5033 if (isl_set_is_params(data->build->domain)) in generate_code_set()
5056 * in the relative order specified by the corresponding domain element(s).
5064 * If the space S is not parametric, then the domain space(s) of "executed"
5065 * need to be wrapped relations with S as domain.
5067 * If the domain of "executed" consists of several spaces, then an AST
5071 * If "internal" is set, then the domain "S" above refers to the internal
5072 * schedule domain representation. Otherwise, it refers to the external
5075 * We essentially run over all the spaces in the domain of "executed"
5124 /* Generate an AST that visits the elements in the domain of "schedule"
5134 * need to be wrapped relations with S as domain.
5146 * the schedule domain in the domain and the elements to be executed
5178 /* Generate an AST that visits the elements in the domain of "executed"
5182 * to the domain elements executed by those iterations.
5217 isl_union_set *domain, *instances; in check_band_schedule_total_on_instances() local
5221 domain = isl_multi_union_pw_aff_domain(partial); in check_band_schedule_total_on_instances()
5222 subset = isl_union_set_is_subset(instances, domain); in check_band_schedule_total_on_instances()
5223 isl_union_set_free(domain); in check_band_schedule_total_on_instances()
5235 /* Generate an AST that visits the elements in the domain of "executed"
5239 * to the domain elements executed by those iterations.
5346 /* Generate an AST that visits the elements in the domain of "executed"
5351 * to the domain elements executed by those iterations.
5358 * to the domain of "executed". Since the context constraints
5360 * to map them to the internal schedule domain.
5368 * the schedule tree (apart from the root domain node), we generate
5426 /* Generate an AST that visits the elements in the domain of "executed"
5431 * to the domain elements executed by those iterations.
5433 * We expand the domain elements by the expansion and
5465 /* Generate an AST that visits the elements in the domain of "executed"
5470 * to the domain elements executed by those iterations.
5501 /* Generate an AST that visits the elements in the domain of "executed"
5506 * to the domain elements executed by those iterations.
5508 * We simply intersect the iteration domain (i.e., the range of "executed")
5573 /* Generate an AST that visits the elements in the domain of "executed"
5578 * to the domain elements executed by those iterations.
5676 /* Generate an AST that visits the elements in the domain of "executed"
5681 * to the domain elements executed by those iterations.
5727 /* Generate an AST that visits the elements in the domain of "executed"
5732 * to the domain elements executed by those iterations.
5768 /* Generate an AST that visits the elements in the domain of "executed"
5772 * to the domain elements executed by those iterations.
5798 "unexpected internal domain node", goto error); in build_ast_from_schedule_node()
5824 /* Generate an AST that visits the elements in the domain of "executed"
5829 * to the domain elements executed by those iterations.
5842 /* Generate an AST that visits the elements in the domain of the domain
5846 * schedule space to the node domain.
5847 * The input "build" is assumed to have a parametric domain and
5850 * We also add some of the parameter constraints in the build domain
5861 isl_union_set *domain, *schedule_domain; in build_ast_from_domain() local
5882 domain = isl_schedule_node_domain_get_domain(node); in build_ast_from_domain()
5883 domain = isl_union_set_coalesce(domain); in build_ast_from_domain()
5885 space = isl_union_set_get_space(domain); in build_ast_from_domain()
5893 executed = isl_union_map_from_domain_and_range(schedule_domain, domain); in build_ast_from_domain()
5905 /* Generate an AST that visits the elements in the domain of "schedule"
5913 * which is assumed to be a domain node.
5935 "expecting root domain node", in isl_ast_build_node_from_schedule()