Lines Matching +full:depth +full:- +full:wise
2 * Copyright 2012-2014 Ecole Normale Superieure
9 * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt,
10 * B.P. 105 - 78153 Le Chesnay, France
77 * S -> D
81 * [S -> D] -> D
95 build = isl_ast_build_copy(data->build); in generate_non_single_valued()
103 data->list = isl_ast_graft_list_concat(data->list, list); in generate_non_single_valued()
116 if (!build->at_each_domain) in at_each_domain()
125 graft->node = build->at_each_domain(graft->node, in at_each_domain()
126 build, build->at_each_domain_user); in at_each_domain()
129 if (!graft->node) in at_each_domain()
161 build = isl_ast_build_copy(data->build); in add_domain()
175 graft = isl_ast_graft_add_guard(graft, guard, data->build); in add_domain()
178 data->list = isl_ast_graft_list_concat(data->list, list); in add_domain()
184 * the inverse schedule "executed" and add it to data->list.
189 * Note that the inverse schedule being single-valued may depend
192 * some of the constraints of data->build->domain. In particular,
193 * we intersect with a single-disjunct approximation of this set.
202 * map is not obviously single-valued.
203 * If the original map is obviously single-valued, then the gist
206 * Because we perform the single-valuedness test on the gisted map,
208 * is single-valued. This becomes problematic if this happens
213 * single-valued.
225 domain = isl_ast_build_get_domain(data->build); in generate_domain()
244 map = isl_ast_build_compute_gist_map_domain(data->build, map); in generate_domain()
250 if (data->build->single_valued) in generate_domain()
263 /* Call build->create_leaf to a create "leaf" node in the AST,
265 * as a 1-element list.
296 node = build->create_leaf(user_build, build->create_leaf_user); in call_create_leaf()
335 if (build->create_leaf) in generate_inner_level()
359 if (!build->before_each_for) in before_each_for()
361 id = build->before_each_for(build, build->before_each_for_user); in before_each_for()
373 if (!build->after_each_for) in after_each_for()
375 graft->node = build->after_each_for(graft->node, build, in after_each_for()
376 build->after_each_for_user); in after_each_for()
377 if (!graft->node) in after_each_for()
408 * resulting in constraints that are independent of "depth"
409 * to be sorted before the lower bounds on "depth", which in
410 * turn are sorted before the upper bounds on "depth".
415 int *depth = user; in cmp_constraint() local
416 int t1 = constraint_type(a, *depth); in cmp_constraint()
417 int t2 = constraint_type(b, *depth); in cmp_constraint()
419 return t1 - t2; in cmp_constraint()
430 * l = ceil(-f(...)/a)
440 * f + s * ceil((l - f)/s)
546 for (i = n - 1; i >= 0; --i) { in remove_redundant_lower_bounds()
576 n--; in remove_redundant_lower_bounds()
738 isl_size depth; in add_implied_guards() local
743 depth = isl_ast_build_get_depth(build); in add_implied_guards()
744 has_stride = isl_ast_build_has_stride(build, depth); in add_implied_guards()
745 if (depth < 0 || has_stride < 0) in add_implied_guards()
756 bounds, isl_dim_set, depth, 1); in add_implied_guards()
766 dom = isl_set_eliminate(dom, isl_dim_set, depth, 1); in add_implied_guards()
775 * "build" is the build in which graft->node was created
794 value = isl_pw_aff_copy(sub_build->value); in refine_degenerate()
797 graft->node = isl_ast_node_for_set_init(graft->node, init); in refine_degenerate()
798 if (!graft->node) in refine_degenerate()
834 * graft->node and add those constraints to graft->enforced,
839 * -a i + f(...) >= 0 or a i <= f(...)
844 * -a l(...) + f(...) >= 0 or a l(...) <= f(...)
905 * graft->node and add those constraints to graft->enforced,
991 /* Set the condition part of the for node graft->node in case
1025 iterator = isl_ast_expr_copy(graft->node->u.f.iterator); in set_for_cond_from_list()
1027 graft->node = isl_ast_node_for_set_cond(graft->node, cond); in set_for_cond_from_list()
1030 if (!graft->node) in set_for_cond_from_list()
1035 /* Set the condition part of the for node graft->node in case
1048 graft->node = isl_ast_node_for_set_cond(graft->node, cond); in set_for_cond_from_set()
1049 if (!graft->node) in set_for_cond_from_set()
1059 isl_size depth; in for_inc() local
1063 depth = isl_ast_build_get_depth(build); in for_inc()
1064 if (depth < 0) in for_inc()
1068 if (!isl_ast_build_has_stride(build, depth)) in for_inc()
1071 v = isl_ast_build_get_stride(build, depth); in for_inc()
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()
1103 /* Fill in the expressions of the for node in graft->node.
1106 * - set the initialization part of the loop to the maximum of the lower bounds
1107 * - extract the increment from the stride of the current dimension
1108 * - construct the for condition either based on a list of upper bounds
1122 graft->node = isl_ast_node_for_set_init(graft->node, init); in set_for_node_expressions()
1123 graft->node = isl_ast_node_for_set_inc(graft->node, for_inc(build)); in set_for_node_expressions()
1125 if (!graft->node) in set_for_node_expressions()
1137 * non-degenerate, case.
1173 isl_size depth; in refine_generic_bounds() local
1181 depth = isl_ast_build_get_depth(build); in refine_generic_bounds()
1182 if (!graft || !c_lower || !c_upper || depth < 0) in refine_generic_bounds()
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()
1208 graft = set_enforced_from_set(graft, lower, depth, upper_set); in refine_generic_bounds()
1238 /* Increment data->n_indep, data->lower or data->upper depending
1239 * on whether "c" is independent of dimensions data->pos,
1246 if (isl_constraint_is_lower_bound(c, isl_dim_set, data->pos)) in count_constraints()
1247 data->n_lower++; in count_constraints()
1248 else if (isl_constraint_is_upper_bound(c, isl_dim_set, data->pos)) in count_constraints()
1249 data->n_upper++; in count_constraints()
1251 data->n_indep++; in count_constraints()
1259 * non-degenerate, case.
1267 * "build" is the build in which graft->node was created.
1279 isl_size depth; in refine_generic_split() local
1283 depth = isl_ast_build_get_depth(build); in refine_generic_split()
1284 if (depth < 0) in refine_generic_split()
1289 data.pos = depth; in refine_generic_split()
1310 * non-degenerate, case.
1315 * "build" is the build in which graft->node was created.
1344 isl_size depth; in create_for() local
1348 depth = isl_ast_build_get_depth(build); in create_for()
1349 if (depth < 0) in create_for()
1352 id = isl_ast_build_get_iterator_id(build, depth); in create_for()
1420 * the depth has not been increased yet.
1424 * reflected in the build->domain.
1425 * We first add this information and the "bounds" to the sub_build->domain.
1431 * In the second, sub-case, the current level is considered "eliminated".
1433 * simply plug in the affine expression. For degenerate, but non-eliminated,
1474 isl_size depth; in create_node_scaled() local
1493 depth = isl_ast_build_get_depth(build); in create_node_scaled()
1494 if (depth < 0) in create_node_scaled()
1502 eliminated = isl_ast_build_has_affine_value(sub_build, depth); in create_node_scaled()
1565 * the input dimension "depth" are such that the other coefficients
1571 int depth; member
1575 /* If constraint "c" involves the input dimension data->depth,
1576 * then make sure that all the other coefficients are multiples of data->m,
1577 * reducing data->m if needed.
1578 * Break out of the iteration if data->m has become equal to "1".
1589 if (!isl_constraint_involves_dims(c, isl_dim_in, data->depth, 1)) { in constraint_check_scaled()
1601 if (t[i] == isl_dim_in && j == data->depth) in constraint_check_scaled()
1606 data->m = isl_val_gcd(data->m, d); in constraint_check_scaled()
1607 if (isl_val_is_one(data->m)) in constraint_check_scaled()
1619 /* For each constraint of "bmap" that involves the input dimension data->depth,
1620 * make sure that all the other coefficients are multiples of data->m,
1621 * reducing data->m if needed.
1622 * Break out of the iteration if data->m has become equal to "1".
1636 /* For each constraint of "map" that involves the input dimension data->depth,
1637 * make sure that all the other coefficients are multiples of data->m,
1638 * reducing data->m if needed.
1639 * Break out of the iteration if data->m has become equal to "1".
1696 isl_size depth; in create_node() local
1705 depth = isl_ast_build_get_depth(build); in create_node()
1706 if (depth < 0) in create_node()
1708 data.depth = depth; in create_node()
1709 if (!isl_ast_build_has_stride(build, data.depth)) in create_node()
1712 offset = isl_ast_build_get_offset(build, data.depth); in create_node()
1713 data.m = isl_ast_build_get_stride(build, data.depth); in create_node()
1745 aff = isl_multi_aff_get_aff(ma, data.depth); in create_node()
1747 ma = isl_multi_aff_set_aff(ma, data.depth, aff); in create_node()
1839 disjoint = isl_set_is_disjoint(domain, build->domain); in add_node()
1863 * at the current depth for equal values of the outer dimensions?
1868 int depth = *(int *) user; in domain_follows_at_depth() local
1875 for (l = 0; l < depth; ++l) in domain_follows_at_depth()
1878 test = isl_basic_map_order_ge(test, isl_dim_in, depth, in domain_follows_at_depth()
1879 isl_dim_out, depth); in domain_follows_at_depth()
1968 * { [i,i] : 0 <= i <= 1 } and { [i,1-i] : 0 <= i <= 1 }
1984 * While the elements in "scc" should be disjoint, we double-check
1992 isl_size depth; in add_nodes() local
2005 data->list = add_node(data->list, in add_nodes()
2006 isl_union_map_copy(data->executed), bset, in add_nodes()
2007 isl_ast_build_copy(data->build)); in add_nodes()
2008 return data->list ? isl_stat_ok : isl_stat_error; in add_nodes()
2011 depth = isl_ast_build_get_depth(data->build); in add_nodes()
2012 if (depth < 0) in add_nodes()
2017 for (i = 0; i < depth; ++i) in add_nodes()
2019 gt = isl_basic_map_order_gt(gt, isl_dim_in, depth, isl_dim_out, depth); in add_nodes()
2043 data->list = isl_ast_graft_list_concat(data->list, in add_nodes()
2044 generate_sorted_domains(scc, data->executed, data->build)); in add_nodes()
2047 return data->list ? isl_stat_ok : isl_stat_error; in add_nodes()
2054 * at the current depth (for equal values of the outer dimensions),
2060 * are pair-wise disjoint. It can, however, in principle happen that
2064 * The function add_nodes takes care of handling non-trivial components.
2072 isl_size depth; in generate_sorted_domains() local
2088 depth = isl_ast_build_get_depth(build); in generate_sorted_domains()
2091 if (depth < 0 || isl_basic_set_list_foreach_scc(domain_list, in generate_sorted_domains()
2092 &domain_follows_at_depth, &depth, in generate_sorted_domains()
2104 int depth = *(int *) user; in shared_outer() local
2111 for (l = 0; l < depth; ++l) in shared_outer()
2141 * lists into data->list.
2145 * then data->single is set to 1 and the result of generate_sorted_domains
2158 list = generate_sorted_domains(scc, data->executed, data->build); in generate_sorted_domains_wrap()
2159 data->single = n == data->n; in generate_sorted_domains_wrap()
2160 if (!data->single) in generate_sorted_domains_wrap()
2161 list = isl_ast_graft_list_fuse(list, data->build); in generate_sorted_domains_wrap()
2162 if (!data->list) in generate_sorted_domains_wrap()
2163 data->list = list; in generate_sorted_domains_wrap()
2165 data->list = isl_ast_graft_list_concat(data->list, list); in generate_sorted_domains_wrap()
2168 if (!data->list) in generate_sorted_domains_wrap()
2180 * to the execution order at the current depth.
2194 isl_size depth; in generate_parallel_domains() local
2204 depth = isl_ast_build_get_depth(build); in generate_parallel_domains()
2205 if (depth < 0) in generate_parallel_domains()
2211 if (isl_basic_set_list_foreach_scc(domain_list, &shared_outer, &depth, in generate_parallel_domains()
2262 isl_size depth; in explicit_bounds() local
2265 depth = isl_ast_build_get_depth(build); in explicit_bounds()
2267 if (depth < 0 || dim < 0) in explicit_bounds()
2275 isl_dim_set, depth + 1, dim - (depth + 1)); in explicit_bounds()
2277 isl_dim_set, depth, 1); in explicit_bounds()
2283 /* Split data->domain into pieces that intersect with the range of "map"
2286 * with data->domain.
2294 if (data->explicit) in separate_domain()
2295 domain = explicit_bounds(map, data->build); in separate_domain()
2297 domain = implicit_bounds(map, data->build); 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()
2340 * "depth" is the dimension for which to find a lower boudn
2349 * unrolled iteration (after expansion). It is set to -1 if it hasn't
2355 int depth; member
2365 * i_"depth" = aff + offset
2367 static __isl_give isl_constraint *at_offset(int depth, __isl_keep isl_aff *aff, in at_offset() argument
2371 aff = isl_aff_add_coefficient_si(aff, isl_dim_in, depth, -1); in at_offset()
2411 c = at_offset(data->depth, lower, 0); in get_expanded_n_div()
2412 set = isl_set_copy(data->domain); in get_expanded_n_div()
2414 expansion = isl_map_from_basic_map(isl_basic_map_copy(data->expansion)); in get_expanded_n_div()
2416 it_map = isl_ast_build_map_to_iterator(data->build, set); in get_expanded_n_div()
2420 n = -1; in get_expanded_n_div()
2438 * number, then store the lowest value in data->n_div.
2447 return -1; in is_better_lower_bound()
2452 if (!data->lower) in is_better_lower_bound()
2454 cmp = isl_val_cmp_si(n, *data->n); in is_better_lower_bound()
2459 if (data->n_div < 0) in is_better_lower_bound()
2460 data->n_div = get_expanded_n_div(data, data->lower); in is_better_lower_bound()
2461 if (data->n_div < 0) in is_better_lower_bound()
2462 return -1; in is_better_lower_bound()
2463 if (data->n_div == 0) in is_better_lower_bound()
2467 return -1; in is_better_lower_bound()
2468 if (n_div >= data->n_div) in is_better_lower_bound()
2470 data->n_div = n_div; in is_better_lower_bound()
2478 * If "c" does not involve the dimension at the current depth,
2486 * -ceil(f(j)/a)) + i + 1
2490 * -ceil(f(j)/a)) + i + 1 <= n
2508 if (!isl_constraint_is_lower_bound(c, isl_dim_set, data->depth)) in update_unrolling_lower_bound()
2511 lower = isl_constraint_get_bound(c, isl_dim_set, data->depth); in update_unrolling_lower_bound()
2515 aff = isl_aff_add_coefficient_si(aff, isl_dim_in, data->depth, 1); in update_unrolling_lower_bound()
2517 max = isl_set_max_val(data->domain, aff); in update_unrolling_lower_bound()
2527 isl_aff_free(data->lower); in update_unrolling_lower_bound()
2528 data->lower = lower; in update_unrolling_lower_bound()
2529 *data->n = isl_val_get_num_si(max); in update_unrolling_lower_bound()
2550 /* Look for a lower bound l(i) on the dimension at "depth"
2555 * where d is "depth" and l(i) depends only on earlier dimensions.
2567 * involve the dimension at "depth" or because they have no corresponding
2576 int depth, __isl_keep isl_basic_map *expansion, int *n) in find_unroll_lower_bound() argument
2579 { build, domain, depth, expansion, NULL, n, -1 }; in find_unroll_lower_bound()
2603 * Return -1 on failure.
2619 * between l(j) and l(j) + n - 1.
2639 isl_size depth; in foreach_iteration() local
2645 depth = isl_ast_build_get_depth(build); in foreach_iteration()
2646 if (depth < 0) in foreach_iteration()
2665 n = -1; in foreach_iteration()
2669 lower = find_unroll_lower_bound(build, domain, depth, bmap, &n); in foreach_iteration()
2671 n = -1; in foreach_iteration()
2674 n = -1; in foreach_iteration()
2680 slice = at_offset(depth, lower, i); in foreach_iteration()
2695 return n < 0 || i < n ? -1 : 0; in foreach_iteration()
2707 * "option" contains the domains at the current depth that should by
2710 * that they have been made pair-wise disjoint.
2712 * "sep_class" contains the user-specified split into separation classes
2713 * specialized to the current depth.
2743 * add it to data->domains->list.
2755 data->unroll_domain = isl_set_union(data->unroll_domain, in do_unroll_iteration()
2757 set = isl_set_intersect(set, isl_set_copy(data->class_domain)); in do_unroll_iteration()
2760 data->domains->list = isl_basic_set_list_concat(data->domains->list, in do_unroll_iteration()
2766 /* Extend domains->list with a list of basic sets, one for each value
2774 * domains->list and their union in data->unroll_domain, which is then
2791 if (foreach_iteration(domain, domains->build, NULL, in do_unroll()
2800 /* Add domains to domains->list for each individual value of the current
2825 empty = isl_set_is_empty(domains->option[isl_ast_loop_unroll]); in compute_unroll_domains()
2831 unroll_domain = isl_set_copy(domains->option[isl_ast_loop_unroll]); in compute_unroll_domains()
2845 isl_set_copy(domains->schedule_domain)); in compute_unroll_domains()
2863 * Add the resulting basic set(s) to domains->list and remove them
2868 * within a single component so that non-overlapping schedule domains
2886 domain = isl_set_copy(domains->option[isl_ast_loop_atomic]); in compute_atomic_domain()
2889 isl_set_copy(domains->schedule_domain)); in compute_atomic_domain()
2898 domain = isl_ast_build_eliminate(domains->build, domain); in compute_atomic_domain()
2907 domains->list = isl_basic_set_list_concat(domains->list, list); in compute_atomic_domain()
2914 * elements of the same domains, and add the result to domains->list.
2933 domain = isl_set_copy(domains->option[isl_ast_loop_separate]); in compute_separate_domain()
2935 executed = isl_union_map_copy(domains->executed); in compute_separate_domain()
2941 return empty < 0 ? -1 : 0; in compute_separate_domain()
2945 domain = separate_schedule_domains(space, executed, domains->build); in compute_separate_domain()
2948 domains->list = isl_basic_set_list_concat(domains->list, list); in compute_separate_domain()
2953 /* Split up the domain at the current depth into disjoint
2988 * we split it up into basic sets and append the basic sets to domains->list.
2997 isl_set_copy(domains->done)); in compute_partial_domains()
2998 domains->done = isl_set_union(domains->done, in compute_partial_domains()
3009 isl_set_copy(domains->option[isl_ast_loop_separate])); in compute_partial_domains()
3012 isl_set_copy(domains->schedule_domain)); in compute_partial_domains()
3014 domain = isl_ast_build_eliminate(domains->build, domain); in compute_partial_domains()
3021 domains->list = isl_basic_set_list_concat(domains->list, list); 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,
3048 isl_map_copy(domains->sep_class), class_set)); 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()
3063 /* Extract the domains at the current depth that should be atomic,
3089 /* Split up the domain at the current depth into disjoint
3091 * based on the user-specified options.
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
3108 * between the universe and domains->done).
3176 * We first split up the domain at the current depth into disjoint
3177 * basic sets based on the user-specified options.
3236 /* Initialize data->list to a list of "n" elements.
3243 ctx = isl_ast_build_get_ctx(data->build); in init_unroll_tree()
3244 data->list = isl_ast_graft_list_alloc(ctx, n); in init_unroll_tree()
3250 * generate the corresponding AST and add the result to data->list.
3256 data->list = add_node(data->list, isl_union_map_copy(data->executed), in do_unroll_tree_iteration()
3257 bset, isl_ast_build_copy(data->build)); in do_unroll_tree_iteration()
3298 isl_size depth; in has_pure_outer_disjunction() local
3308 depth = isl_ast_build_get_depth(build); in has_pure_outer_disjunction()
3309 if (dim < 0 || depth < 0) in has_pure_outer_disjunction()
3314 isl_dim_set, depth, dim - depth); in has_pure_outer_disjunction()
3422 isl_size depth; in extract_disjunction() local
3426 depth = isl_ast_build_get_depth(build); in extract_disjunction()
3428 if (depth < 0 || dim < 0) in extract_disjunction()
3430 domain = isl_set_eliminate(domain, isl_dim_set, depth, dim - depth); in extract_disjunction()
3619 isl_size depth; in generate_shifted_component_tree() local
3651 depth = isl_ast_build_get_depth(build); in generate_shifted_component_tree()
3652 if (depth < 0) in generate_shifted_component_tree()
3661 for (i = 0; i < depth; ++i) in generate_shifted_component_tree()
3663 gt = isl_map_order_gt(gt, isl_dim_in, depth, isl_dim_out, depth); in generate_shifted_component_tree()
3758 return -1; in dim_is_fixed()
3769 * at position "depth"?
3772 int *order, int n, int depth) in at_most_one_non_fixed() argument
3775 int non_fixed = -1; in at_most_one_non_fixed()
3780 f = dim_is_fixed(domain[order[i]].set, depth); in at_most_one_non_fixed()
3782 return -1; in at_most_one_non_fixed()
3803 int *order, int n, int depth, __isl_keep isl_ast_build *build) in eliminate_non_fixed() argument
3806 int base = -1; in eliminate_non_fixed()
3808 for (i = n - 1; i >= 0; --i) { in eliminate_non_fixed()
3810 f = dim_is_fixed(domain[order[i]].set, depth); in eliminate_non_fixed()
3812 return -1; in eliminate_non_fixed()
3877 return i < n ? -1 : first; in first_offset()
3897 * { [..., j, ...] -> [..., j - offset[i], offset[i], ....] }
3904 * { A[i] -> [2i]: 0 <= i < 10; B[i] -> [2i+1] : 0 <= i < 10 }
3909 * { [j] -> [j, 0] }
3913 * { [j - 1] -> [j, 1] }
3931 * j1 - c1 < j2 - c2
3936 * 0 <= c2 - c1 < s
3940 * j2 - j1 = n * s + r
3943 * In other words, r = c2 - c1.
3946 * j1 - c1 < j2 - c2
3950 * j1 - c1 = j2 - c2
3954 * (j1 - c1, c1) << (j2 - c2, c2)
3968 isl_size depth; in construct_shifted_executed() local
3971 depth = isl_ast_build_get_depth(build); in construct_shifted_executed()
3972 if (depth < 0) in construct_shifted_executed()
3978 map = isl_map_eliminate(map, isl_dim_out, depth, 1); in construct_shifted_executed()
3979 map = isl_map_insert_dims(map, isl_dim_out, depth + 1, 1); in construct_shifted_executed()
3980 space = isl_space_insert_dims(space, isl_dim_out, depth + 1, 1); in construct_shifted_executed()
3983 c = isl_constraint_set_coefficient_si(c, isl_dim_in, depth, 1); in construct_shifted_executed()
3984 c = isl_constraint_set_coefficient_si(c, isl_dim_out, depth, -1); in construct_shifted_executed()
3994 map_i = isl_map_fix_val(map_i, isl_dim_out, depth + 1, in construct_shifted_executed()
4047 isl_size depth; in generate_shift_component() local
4054 depth = isl_ast_build_get_depth(build); in generate_shift_component()
4057 if (depth < 0 || first < 0) in generate_shift_component()
4074 ma = isl_multi_aff_range_splice(ma, depth + 1, zero); in generate_shift_component()
4075 build = isl_ast_build_insert_dim(build, depth + 1); in generate_shift_component()
4118 * { A[i] -> [2i]: 0 <= i < 10; B[i] -> [2i+1] : 0 <= i < 10 }
4123 * { A[i] -> [2i, 0]: 0 <= i < 10; B[i] -> [2i, 1] : 0 <= i < 10 }
4162 * that some domains had non-obviously fixed values for the current dimension.
4168 * domain should get split in pieces with a (non-shifted) stride.
4178 isl_size depth; in generate_component() local
4189 depth = isl_ast_build_get_depth(build); in generate_component()
4190 if (depth < 0) in generate_component()
4195 skip = at_most_one_non_fixed(domain, order, n, depth); in generate_component()
4208 base = eliminate_non_fixed(domain, order, n, depth, build); in generate_component()
4223 for (d = 0; d < depth; ++d) in generate_component()
4227 res = isl_set_dim_residue_class_val(deltas, depth, &m, &r); in generate_component()
4242 res = dim_is_fixed(domain[order[i]].set, depth); in generate_component()
4286 (*next)->map = isl_map_copy(map); in extract_domain()
4287 (*next)->set = isl_map_domain(map); in extract_domain()
4684 * "depth" is the number of loops that have already been generated
4685 * "group_coscheduled" is a local copy of options->ast_build_group_coscheduled
4686 * "domain" is an array of set-map pairs corresponding to the different
4692 int depth; member
4698 * (for a common iteration of the first data->depth loops)?
4700 * data->domain[i].set contains the domain of the inverse schedule
4708 * If data->group_coscheduled is set, then we also return 1 if there
4714 isl_size dim = isl_set_dim(data->domain[i].set, isl_dim_set); in any_scheduled_after()
4720 for (pos = data->depth; pos < dim; ++pos) { 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()
4726 if (follows < -1) in any_scheduled_after()
4734 if (isl_ast_build_has_schedule_node(data->build)) { 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()
4743 return isl_bool_ok(data->group_coscheduled); in any_scheduled_after()
4746 /* Look for independent components at the current depth and generate code
4772 isl_size depth; in generate_components() local
4791 depth = isl_ast_build_get_depth(build); in generate_components()
4792 if (depth < 0) in generate_components()
4795 data.depth = depth; in generate_components()
4808 if (g->order[i] == -1) in generate_components()
4811 ++i; --n; in generate_components()
4812 while (g->order[i] != -1) { in generate_components()
4813 ++i; --n; in generate_components()
4817 g->order + first, i - first, in generate_components()
4855 isl_size depth; in generate_next_level() local
4869 depth = isl_ast_build_get_depth(build); in generate_next_level()
4871 if (depth < 0 || dim < 0) in generate_next_level()
4873 if (depth >= dim) in generate_next_level()
4903 * [E -> S] -> D
4909 * [I -> S] -> D
4913 * I -> E
4915 * take the inverse and the product with S -> S, resulting in
4917 * [I -> S] -> [E -> S]
4937 /* Generate an AST that visits the elements in the range of data->executed
4940 * Add the result to data->list.
4944 * It is equal to the space of "set" if build->domain is parametric.
4949 * was called from an outside user (data->internal not set), then
4962 * in data->build refer only to the additional part of the schedule
4982 executed = isl_union_map_copy(data->executed); in generate_code_in_space()
4986 embed = !isl_set_is_params(data->build->domain); in generate_code_in_space()
4987 if (embed && !data->internal) in generate_code_in_space()
4988 executed = internal_executed(executed, space, data->build); in generate_code_in_space()
4991 domain = isl_ast_build_get_domain(data->build); in generate_code_in_space()
4996 build = isl_ast_build_copy(data->build); in generate_code_in_space()
5003 data->list = isl_ast_graft_list_concat(data->list, list); in generate_code_in_space()
5008 /* Generate an AST that visits the elements in the range of data->executed
5011 * Add the result to data->list.
5019 * [S -> T]
5033 if (isl_set_is_params(data->build->domain)) in generate_code_set()
5036 build_space = isl_ast_build_get_space(data->build, data->internal); in generate_code_set()
5094 isl_union_map_get_space(build->options)); in generate_code()
5329 extra_param -= n_param; in hoist_out_of_context()
5388 isl_size depth; in build_ast_from_context() local
5390 depth = isl_schedule_node_get_tree_depth(node); in build_ast_from_context()
5391 if (depth < 0) in build_ast_from_context()
5414 if (depth == 1) in build_ast_from_context()
5492 isl_multi_aff_copy(build->internal2input)); in build_ast_from_extension()
5610 isl_multi_aff_copy(build->internal2input)); in build_ast_from_guard()
5612 guard = isl_set_gist(guard, isl_set_copy(build->generated)); in build_ast_from_guard()
5640 * Return 0 on success and -1 on error.
5650 if (!build->before_each_mark) in before_each_mark()
5652 return build->before_each_mark(mark, build, in before_each_mark()
5653 build->before_each_mark_user); in before_each_mark()
5666 if (!build->after_each_mark) in after_each_mark()
5668 graft->node = build->after_each_mark(graft->node, build, in after_each_mark()
5669 build->after_each_mark_user); in after_each_mark()
5670 if (!graft->node) in after_each_mark()
5845 * An initial inverse schedule is created that maps a zero-dimensional
5848 * is replaced by the same zero-dimensional schedule space.