Lines Matching full:build

53  * "build" is the input build.
57 isl_ast_build *build; member
64 __isl_take isl_ast_build *build);
66 __isl_take isl_union_map *executed, __isl_take isl_ast_build *build,
92 isl_ast_build *build; in generate_non_single_valued() local
95 build = isl_ast_build_copy(data->build); in generate_non_single_valued()
99 build = isl_ast_build_set_single_valued(build, 1); in generate_non_single_valued()
101 list = generate_code(isl_union_map_from_map(executed), build, 1); in generate_non_single_valued()
109 * after recording the current inverse schedule in the build.
112 __isl_keep isl_map *executed, __isl_keep isl_ast_build *build) in at_each_domain() argument
114 if (!graft || !build) in at_each_domain()
116 if (!build->at_each_domain) in at_each_domain()
119 build = isl_ast_build_copy(build); in at_each_domain()
120 build = isl_ast_build_set_executed(build, in at_each_domain()
122 if (!build) 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()
127 isl_ast_build_free(build); in at_each_domain()
139 * or it is the result of gisting "executed" with respect to the build domain.
142 * At this stage, any pending constraints in the build can no longer
156 isl_ast_build *build; in add_domain() local
161 build = isl_ast_build_copy(data->build); in add_domain()
162 pending = isl_ast_build_get_pending(build); in add_domain()
163 build = isl_ast_build_replace_pending_by_guard(build, pending); in add_domain()
168 guard = isl_set_gist(guard, isl_ast_build_get_generated(build)); in add_domain()
169 guard = isl_ast_build_specialize(build, guard); in add_domain()
171 graft = isl_ast_graft_alloc_domain(map, build); in add_domain()
172 graft = at_each_domain(graft, executed, build); in add_domain()
173 isl_ast_build_free(build); in add_domain()
175 graft = isl_ast_graft_add_guard(graft, guard, data->build); in add_domain()
192 * some of the constraints of data->build->domain. In particular,
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,
274 * from the build that is (presumbably) only meaningful
277 * of the build first.
280 __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) in call_create_leaf() argument
287 guard = isl_ast_build_get_pending(build); in call_create_leaf()
288 user_build = isl_ast_build_copy(build); in call_create_leaf()
296 node = build->create_leaf(user_build, build->create_leaf_user); in call_create_leaf()
297 graft = isl_ast_graft_alloc(node, build); in call_create_leaf()
298 graft = isl_ast_graft_add_guard(graft, guard, build); in call_create_leaf()
299 isl_ast_build_free(build); in call_create_leaf()
304 __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node,
320 __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) in generate_inner_level() argument
323 struct isl_generate_domain_data data = { build }; in generate_inner_level()
325 if (!build || !executed) in generate_inner_level()
328 if (isl_ast_build_has_schedule_node(build)) { in generate_inner_level()
330 node = isl_ast_build_get_schedule_node(build); in generate_inner_level()
331 build = isl_ast_build_reset_schedule_node(build); in generate_inner_level()
332 return build_ast_from_child(build, node, executed); in generate_inner_level()
335 if (build->create_leaf) in generate_inner_level()
336 return call_create_leaf(executed, build); in generate_inner_level()
345 isl_ast_build_free(build); in generate_inner_level()
353 __isl_keep isl_ast_build *build) in before_each_for() argument
357 if (!node || !build) in before_each_for()
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()
369 __isl_keep isl_ast_build *build) in after_each_for() argument
371 if (!graft || !build) in after_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()
389 __isl_take isl_union_map *executed, __isl_keep isl_ast_build *build) in plug_in_values() argument
391 return isl_ast_build_substitute_values_union_map_domain(build, in plug_in_values()
443 int pos, __isl_keep isl_ast_build *build) in lower_bound() argument
450 if (isl_ast_build_has_stride(build, pos)) { in lower_bound()
454 offset = isl_ast_build_get_offset(build, pos); in lower_bound()
455 stride = isl_ast_build_get_stride(build, pos); in lower_bound()
464 aff = isl_ast_build_compute_gist_aff(build, aff); in lower_bound()
482 __isl_keep isl_ast_build *build, int upper) in exact_bound() argument
491 stride = isl_ast_build_get_stride_constraint(build); in exact_bound()
494 it_map = isl_ast_build_map_to_iterator(build, domain); in exact_bound()
501 pa = isl_ast_build_compute_gist_pw_aff(build, pa); in exact_bound()
517 * with respect to the other bounds in "list" and the domain of "build".
530 __isl_take isl_pw_aff_list *list, __isl_keep isl_ast_build *build) in remove_redundant_lower_bounds() argument
544 domain = isl_ast_build_get_domain(build); in remove_redundant_lower_bounds()
600 __isl_keep isl_set *domain, __isl_keep isl_ast_build *build) in lower_bounds() argument
607 if (!build) in lower_bounds()
615 pa = exact_bound(domain, build, 0); in lower_bounds()
619 ctx = isl_ast_build_get_ctx(build); in lower_bounds()
627 aff = lower_bound(c, pos, build); in lower_bounds()
632 if (isl_ast_build_has_stride(build, pos)) in lower_bounds()
633 list = remove_redundant_lower_bounds(list, build); in lower_bounds()
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()
661 ctx = isl_ast_build_get_ctx(build); in upper_bounds()
688 __isl_keep isl_pw_aff_list *list, __isl_keep isl_ast_build *build) in reduce_list() argument
700 return isl_ast_build_expr_from_pw_aff_internal(build, in reduce_list()
714 expr_i = isl_ast_build_expr_from_pw_aff_internal(build, in reduce_list()
736 __isl_keep isl_ast_build *build) in add_implied_guards() argument
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()
762 set = isl_ast_build_get_stride_constraint(build); in add_implied_guards()
767 dom = isl_ast_build_compute_gist(build, dom); in add_implied_guards()
775 * "build" is the build in which graft->node was created
785 __isl_take isl_ast_graft *graft, __isl_keep isl_ast_build *build, in refine_degenerate() argument
796 init = isl_ast_build_expr_from_pw_aff_internal(build, value); in refine_degenerate()
959 * is defined over the internal schedule space of "build".
962 __isl_take isl_pw_aff_list *list, __isl_keep isl_ast_build *build) in list_add_one() argument
974 space = isl_ast_build_get_space(build, 1); in list_add_one()
1006 __isl_keep isl_ast_build *build) in set_for_cond_from_list() argument
1020 list = list_add_one(list, build); in set_for_cond_from_list()
1024 bound = reduce_list(isl_ast_expr_op_min, list, build); in set_for_cond_from_list()
1040 __isl_keep isl_ast_build *build) in set_for_cond_from_set() argument
1047 cond = isl_ast_build_expr_from_set_internal(build, isl_set_copy(set)); in set_for_cond_from_set()
1057 static __isl_give isl_ast_expr *for_inc(__isl_keep isl_ast_build *build) in for_inc() argument
1063 depth = isl_ast_build_get_depth(build); in for_inc()
1066 ctx = isl_ast_build_get_ctx(build); 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()
1114 __isl_keep isl_set *upper_set, __isl_keep isl_ast_build *build) in set_for_node_expressions() argument
1121 init = reduce_list(isl_ast_expr_op_max, lower, build); in set_for_node_expressions()
1123 graft->node = isl_ast_node_for_set_inc(graft->node, for_inc(build)); in set_for_node_expressions()
1129 graft = set_for_cond_from_list(graft, upper_list, build); in set_for_node_expressions()
1131 graft = set_for_cond_from_set(graft, upper_set, build); in set_for_node_expressions()
1171 __isl_keep isl_set *domain, __isl_keep isl_ast_build *build) in refine_generic_bounds() argument
1181 depth = isl_ast_build_get_depth(build); 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()
1211 upper_set, build); in refine_generic_bounds()
1264 * the caller and are included in the generated constraints of "build".
1267 * "build" is the build in which graft->node was created.
1276 __isl_keep isl_set *domain, __isl_keep isl_ast_build *build) in refine_generic_split() argument
1283 depth = isl_ast_build_get_depth(build); in refine_generic_split()
1306 return refine_generic_bounds(graft, lower, upper, domain, build); in refine_generic_split()
1315 * "build" is the build in which graft->node was created.
1323 __isl_keep isl_ast_build *build) in refine_generic() argument
1327 if (!build || !graft) in refine_generic()
1332 graft = refine_generic_split(graft, list, domain, build); in refine_generic()
1341 static __isl_give isl_ast_node *create_for(__isl_keep isl_ast_build *build, in create_for() argument
1348 depth = isl_ast_build_get_depth(build); in create_for()
1352 id = isl_ast_build_get_iterator_id(build, depth); in create_for()
1365 __isl_keep isl_ast_graft_list *list, __isl_keep isl_ast_build *build) in extract_shared_enforced() argument
1375 return isl_ast_graft_list_extract_shared_enforced(list, build); in extract_shared_enforced()
1377 space = isl_ast_build_get_space(build, 1); in extract_shared_enforced()
1381 /* Return the pending constraints of "build" that are not already taken
1383 * of "build").
1385 static __isl_give isl_set *extract_pending(__isl_keep isl_ast_build *build, in extract_pending() argument
1390 guard = isl_ast_build_get_pending(build); in extract_pending()
1393 isl_ast_build_get_generated(build)); in extract_pending()
1414 * callbacks, we record the current inverse schedule in the build.
1417 * "build" is the one in which the current level is created,
1418 * "body_build" is the build in which the next level is created,
1422 * "build" already contains information (in strides and offsets)
1424 * reflected in the build->domain.
1442 * and the build domain, that then this information is also reflected
1454 * with the pending constraints in the build. These constraints
1466 * We do so in a context where the pending constraints of the build
1472 __isl_take isl_ast_build *build) in create_node_scaled() argument
1487 domain = isl_ast_build_eliminate_divs(build, domain); in create_node_scaled()
1491 build = isl_ast_build_set_executed(build, isl_union_map_copy(executed)); in create_node_scaled()
1493 depth = isl_ast_build_get_depth(build); in create_node_scaled()
1495 build = isl_ast_build_free(build); in create_node_scaled()
1496 sub_build = isl_ast_build_copy(build); in create_node_scaled()
1506 bounds = isl_ast_build_compute_gist_basic_set(build, bounds); in create_node_scaled()
1512 node = create_for(build, degenerate); in create_node_scaled()
1521 enforced = extract_shared_enforced(children, build); in create_node_scaled()
1523 hoisted = isl_ast_graft_list_extract_hoistable_guard(children, build); in create_node_scaled()
1532 guard = add_implied_guards(guard, degenerate, bounds, build); in create_node_scaled()
1535 isl_set_copy(guard), enforced, build, sub_build); in create_node_scaled()
1541 for_build = isl_ast_build_copy(build); in create_node_scaled()
1557 isl_ast_build_free(build); in create_node_scaled()
1693 __isl_take isl_ast_build *build) in create_node() argument
1701 ctx = isl_ast_build_get_ctx(build); in create_node()
1703 return create_node_scaled(executed, bounds, domain, build); in create_node()
1705 depth = isl_ast_build_get_depth(build); in create_node()
1707 build = isl_ast_build_free(build); in create_node()
1709 if (!isl_ast_build_has_stride(build, data.depth)) in create_node()
1710 return create_node_scaled(executed, bounds, domain, build); 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()
1742 space = isl_ast_build_get_space(build, 1); in create_node()
1757 build = isl_ast_build_scale_down(build, isl_val_copy(data.m), in create_node()
1763 return create_node_scaled(executed, bounds, domain, build); in create_node()
1806 * conflict with the current build domain
1818 __isl_take isl_basic_set *bounds, __isl_take isl_ast_build *build) in add_node() argument
1835 domain = isl_ast_build_specialize(build, 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()
1848 isl_ast_build_copy(build)); in add_node()
1850 isl_ast_build_free(build); in add_node()
1858 isl_ast_build_free(build); in add_node()
1943 __isl_keep isl_ast_build *build);
1947 * "executed" and "build" are extra arguments to be passed to add_node.
1952 isl_ast_build *build; member
2007 isl_ast_build_copy(data->build)); in add_nodes()
2011 depth = isl_ast_build_get_depth(data->build); in add_nodes()
2044 generate_sorted_domains(scc, data->executed, data->build)); in add_nodes()
2068 __isl_keep isl_union_map *executed, __isl_keep isl_ast_build *build) in generate_sorted_domains() argument
2086 isl_ast_build_copy(build)); in generate_sorted_domains()
2088 depth = isl_ast_build_get_depth(build); in generate_sorted_domains()
2090 data.build = build; in generate_sorted_domains()
2123 * "executed" and "build" are extra arguments to be passed
2133 isl_ast_build *build; member
2158 list = generate_sorted_domains(scc, data->executed, data->build); in generate_sorted_domains_wrap()
2161 list = isl_ast_graft_list_fuse(list, data->build); in generate_sorted_domains_wrap()
2192 __isl_keep isl_union_map *executed, __isl_keep isl_ast_build *build) in generate_parallel_domains() argument
2202 return generate_sorted_domains(domain_list, executed, build); in generate_parallel_domains()
2204 depth = isl_ast_build_get_depth(build); in generate_parallel_domains()
2209 data.build = build; in generate_parallel_domains()
2229 isl_ast_build *build; member
2240 __isl_keep isl_ast_build *build) in implicit_bounds() argument
2245 domain = isl_ast_build_eliminate(build, domain); in implicit_bounds()
2259 __isl_keep isl_ast_build *build) in explicit_bounds() argument
2265 depth = isl_ast_build_get_depth(build); in explicit_bounds()
2295 domain = explicit_bounds(map, data->build); in separate_domain()
2297 domain = implicit_bounds(map, data->build); in separate_domain()
2320 __isl_keep isl_ast_build *build) in separate_schedule_domains() argument
2322 struct isl_separate_domain_data data = { build }; in separate_schedule_domains()
2325 ctx = isl_ast_build_get_ctx(build); in separate_schedule_domains()
2338 * "build" is the build in which the unrolling will be performed
2353 isl_ast_build *build; member
2416 it_map = isl_ast_build_map_to_iterator(data->build, set); in get_expanded_n_div()
2558 * "build" is the build in which the unrolling will be performed.
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()
2634 __isl_keep isl_ast_build *build, int (*init)(int n, void *user), in foreach_iteration() argument
2645 depth = isl_ast_build_get_depth(build); 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()
2651 stride_build = isl_ast_build_copy(build); in foreach_iteration()
2669 lower = find_unroll_lower_bound(build, domain, depth, bmap, &n); in foreach_iteration()
2704 * "executed" and "build" are inputs to compute_domains.
2721 isl_ast_build *build; member
2791 if (foreach_iteration(domain, domains->build, NULL, in do_unroll()
2898 domain = isl_ast_build_eliminate(domains->build, domain); in compute_atomic_domain()
2945 domain = separate_schedule_domains(space, executed, domains->build); in compute_separate_domain()
3014 domain = isl_ast_build_eliminate(domains->build, domain); in compute_partial_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()
3070 __isl_keep isl_ast_build *build) in compute_domains_init_options() argument
3077 option[type] = isl_ast_build_get_option_domain(build, type); in compute_domains_init_options()
3111 __isl_keep isl_union_map *executed, __isl_keep isl_ast_build *build) in compute_domains() argument
3132 compute_domains_init_options(domains.option, build); in compute_domains()
3134 domains.sep_class = isl_ast_build_get_separation_class(build); in compute_domains()
3142 domains.build = build; in compute_domains()
3159 domain = isl_ast_build_eliminate(build, domain); in compute_domains()
3181 __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) in generate_shifted_component_flat() argument
3186 domain_list = compute_domains(executed, build); in generate_shifted_component_flat()
3187 list = generate_parallel_domains(domain_list, executed, build); in generate_shifted_component_flat()
3191 isl_ast_build_free(build); in generate_shifted_component_flat()
3204 __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) in generate_shifted_component_tree_separate() argument
3211 space = isl_ast_build_get_space(build, 1); in generate_shifted_component_tree_separate()
3213 isl_union_map_copy(executed), build); in generate_shifted_component_tree_separate()
3216 list = generate_parallel_domains(domain_list, executed, build); in generate_shifted_component_tree_separate()
3220 isl_ast_build_free(build); in generate_shifted_component_tree_separate()
3227 * "executed" and "build" are inputs to generate_shifted_component_tree_unroll.
3232 isl_ast_build *build; member
3243 ctx = isl_ast_build_get_ctx(data->build); in init_unroll_tree()
3257 bset, isl_ast_build_copy(data->build)); in do_unroll_tree_iteration()
3271 __isl_take isl_ast_build *build) in generate_shifted_component_tree_unroll() argument
3273 struct isl_ast_unroll_tree_data data = { executed, build, NULL }; in generate_shifted_component_tree_unroll()
3275 if (foreach_iteration(domain, build, &init_unroll_tree, in generate_shifted_component_tree_unroll()
3280 isl_ast_build_free(build); in generate_shifted_component_tree_unroll()
3293 __isl_keep isl_ast_build *build) in has_pure_outer_disjunction() argument
3308 depth = isl_ast_build_get_depth(build); in has_pure_outer_disjunction()
3357 __isl_take isl_union_map *executed, __isl_take isl_ast_build *build, in generate_shifted_component_tree_base() argument
3367 type = isl_ast_build_get_loop_type(build, isolated); in generate_shifted_component_tree_base()
3373 build); in generate_shifted_component_tree_base()
3380 build); in generate_shifted_component_tree_base()
3382 domain = isl_ast_build_eliminate(build, domain); in generate_shifted_component_tree_base()
3385 outer_disjunction = has_pure_outer_disjunction(domain, build); in generate_shifted_component_tree_base()
3398 list = generate_parallel_domains(domain_list, executed, build); in generate_shifted_component_tree_base()
3402 isl_ast_build_free(build); in generate_shifted_component_tree_base()
3407 isl_ast_build_free(build); in generate_shifted_component_tree_base()
3419 __isl_keep isl_ast_build *build) in extract_disjunction() argument
3425 domain = isl_ast_build_specialize(build, domain); in extract_disjunction()
3426 depth = isl_ast_build_get_depth(build); in extract_disjunction()
3440 * "build" is the outer AST build, while "sub_build" includes "guard"
3449 __isl_keep isl_ast_build *build, __isl_keep isl_ast_build *sub_build) in list_add_guard() argument
3463 graft = isl_ast_graft_add_guard(graft, isl_set_copy(guard), build); in list_add_guard()
3480 __isl_keep isl_ast_build *build, int isolated) in generate_shifted_component_tree_part() argument
3497 ctx = isl_ast_build_get_ctx(build); in generate_shifted_component_tree_part()
3501 sub_build = isl_ast_build_copy(build); in generate_shifted_component_tree_part()
3503 domain = extract_disjunction(domain, build); in generate_shifted_component_tree_part()
3510 list = list_add_guard(list, domain, build, sub_build); in generate_shifted_component_tree_part()
3529 __isl_take isl_set *other, __isl_take isl_ast_build *build) in generate_shifted_component_parts() argument
3533 res = generate_shifted_component_tree_part(executed, before, build, 0); in generate_shifted_component_parts()
3535 build, 1); in generate_shifted_component_parts()
3537 list = generate_shifted_component_tree_part(executed, after, build, 0); in generate_shifted_component_parts()
3539 list = generate_shifted_component_tree_part(executed, other, build, 0); in generate_shifted_component_parts()
3543 isl_ast_build_free(build); in generate_shifted_component_parts()
3575 __isl_take isl_set *after, __isl_take isl_ast_build *build, in generate_shifted_component_only_after() argument
3584 isolated, after, empty, build); in generate_shifted_component_only_after()
3616 __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) in generate_shifted_component_tree() argument
3629 build = isl_ast_build_extract_isolated(build); in generate_shifted_component_tree()
3630 has_isolate = isl_ast_build_has_isolated(build); in generate_shifted_component_tree()
3634 return generate_shifted_component_tree_base(executed, build, 0); in generate_shifted_component_tree()
3639 isolated = isl_ast_build_get_isolated(build); in generate_shifted_component_tree()
3641 test = isl_ast_build_specialize(build, isl_set_copy(isolated)); in generate_shifted_component_tree()
3649 return generate_shifted_component_tree_base(executed, build, 0); in generate_shifted_component_tree()
3651 depth = isl_ast_build_get_depth(build); in generate_shifted_component_tree()
3655 isolated = isl_ast_build_eliminate(build, isolated); in generate_shifted_component_tree()
3674 domain, build, before, after); in generate_shifted_component_tree()
3682 after, domain, build); in generate_shifted_component_tree()
3687 isl_ast_build_free(build); in generate_shifted_component_tree()
3698 __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) in generate_shifted_component() argument
3700 if (isl_ast_build_has_schedule_node(build)) in generate_shifted_component()
3701 return generate_shifted_component_tree(executed, build); in generate_shifted_component()
3703 return generate_shifted_component_flat(executed, build); in generate_shifted_component()
3741 __isl_take isl_ast_build *build) in generate_shifted_component_from_list() argument
3746 return generate_shifted_component(executed, build); in generate_shifted_component_from_list()
3803 int *order, int n, int depth, __isl_keep isl_ast_build *build) in eliminate_non_fixed() argument
3815 domain[order[i]].set = isl_ast_build_eliminate_inner(build, in eliminate_non_fixed()
3842 __isl_keep isl_ast_build *build) in first_offset() argument
3848 min_first = isl_ast_build_map_to_iterator(build, in first_offset()
3856 min = isl_ast_build_map_to_iterator(build, in first_offset()
3962 __isl_keep isl_ast_build *build) in construct_shifted_executed() argument
3971 depth = isl_ast_build_get_depth(build); in construct_shifted_executed()
3974 space = isl_ast_build_get_space(build, 1); in construct_shifted_executed()
4034 * the build needs to be changed accordingly.
4043 __isl_take isl_ast_build *build) in generate_shift_component() argument
4054 depth = isl_ast_build_get_depth(build); in generate_shift_component()
4056 first = first_offset(domain, order, n, build); in generate_shift_component()
4067 build); in generate_shift_component()
4068 space = isl_ast_build_get_space(build, 1); in generate_shift_component()
4075 build = isl_ast_build_insert_dim(build, depth + 1); in generate_shift_component()
4076 list = generate_shifted_component(executed, build); in generate_shift_component()
4084 isl_ast_build_free(build); in generate_shift_component()
4089 * of "build" depend on outer schedule nodes?
4091 static int has_anchored_subtree(__isl_keep isl_ast_build *build) in has_anchored_subtree() argument
4096 node = isl_ast_build_get_schedule_node(build); in has_anchored_subtree()
4175 __isl_take isl_ast_build *build) in generate_component() argument
4189 depth = isl_ast_build_get_depth(build); in generate_component()
4197 if (isl_ast_build_has_schedule_node(build)) in generate_component()
4198 skip = has_anchored_subtree(build); in generate_component()
4200 skip = isl_ast_build_options_involve_depth(build); in generate_component()
4206 order, n, build); in generate_component()
4208 base = eliminate_non_fixed(domain, order, n, depth, build); in generate_component()
4212 ctx = isl_ast_build_get_ctx(build); in generate_component()
4260 isl_ast_build_free(build); in generate_component()
4264 order, n, build); in generate_component()
4267 build); in generate_component()
4275 isl_ast_build_free(build); in generate_component()
4656 static isl_bool after_in_subtree(__isl_keep isl_ast_build *build, in after_in_subtree() argument
4664 node = isl_ast_build_get_schedule_node(build); in after_in_subtree()
4683 * "build" is the build in which the AST is constructed.
4691 isl_ast_build *build; member
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()
4767 __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) in generate_components() argument
4770 isl_ctx *ctx = isl_ast_build_get_ctx(build); in generate_components()
4791 depth = isl_ast_build_get_depth(build); in generate_components()
4794 data.build = build; in generate_components()
4818 isl_ast_build_copy(build)); in generate_components()
4819 list = isl_ast_graft_list_merge(list, list_c, build); in generate_components()
4833 isl_ast_build_free(build); in generate_components()
4853 __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) in generate_next_level() argument
4859 if (!build || !executed) in generate_next_level()
4863 isl_ctx *ctx = isl_ast_build_get_ctx(build); in generate_next_level()
4865 isl_ast_build_free(build); in generate_next_level()
4869 depth = isl_ast_build_get_depth(build); in generate_next_level()
4870 dim = isl_ast_build_dim(build, isl_dim_set); in generate_next_level()
4874 return generate_inner_level(executed, build); in generate_next_level()
4880 return generate_shifted_component(executed, build); in generate_next_level()
4882 return generate_components(executed, build); in generate_next_level()
4885 isl_ast_build_free(build); in generate_next_level()
4890 * internal, executed and build are the inputs to generate_code.
4896 isl_ast_build *build; member
4901 /* Given an inverse schedule in terms of the external build schedule, i.e.,
4905 * with E the external build schedule and S the additional schedule "space",
4923 __isl_keep isl_ast_build *build) in internal_executed() argument
4927 proj = isl_ast_build_get_schedule_map(build); in internal_executed()
4944 * It is equal to the space of "set" if build->domain is parametric.
4947 * If the build space is not parametric and
4950 * the (inverse) schedule refers to the external build domain and needs to
4951 * be transformed to refer to the internal build domain.
4953 * If the build space is parametric, then we add some of the parameter
4960 * The build is extended to include the additional part of the schedule.
4961 * If the original build space was not parametric, then the options
4962 * in data->build refer only to the additional part of the schedule
4963 * and they need to be adjusted to refer to the complete AST build
4966 * After having adjusted inverse schedule and build, we start generating
4970 * If the original build space was not parametric, we undo the embedding
4972 * the outer AST build.
4978 isl_ast_build *build; in generate_code_in_space() local
4986 embed = !isl_set_is_params(data->build->domain); 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()
4997 build = isl_ast_build_product(build, space); in generate_code_in_space()
4999 list = generate_next_level(executed, build); in generate_code_in_space()
5015 * If the build space S is not parametric, then the space of "set"
5023 * If the build space is not parametric, then T is the space of "set".
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()
5058 * "build" is an isl_ast_build that has either been constructed by
5079 __isl_take isl_union_map *executed, __isl_take isl_ast_build *build, in generate_code() argument
5088 if (!build) in generate_code()
5090 space = isl_ast_build_get_space(build, 1); in generate_code()
5094 isl_union_map_get_space(build->options)); in generate_code()
5095 build = isl_ast_build_align_params(build, isl_space_copy(space)); in generate_code()
5097 if (!executed || !build) in generate_code()
5100 ctx = isl_ast_build_get_ctx(build); in generate_code()
5104 data.build = build; in generate_code()
5116 isl_ast_build_free(build); in generate_code()
5120 isl_ast_build_free(build); in generate_code()
5127 * "build" is an isl_ast_build that has either been constructed by
5150 __isl_keep isl_ast_build *build, __isl_take isl_union_map *schedule) in isl_ast_build_node_from_schedule_map() argument
5156 build = isl_ast_build_copy(build); in isl_ast_build_node_from_schedule_map()
5157 build = isl_ast_build_set_single_valued(build, 0); in isl_ast_build_node_from_schedule_map()
5161 list = generate_code(executed, isl_ast_build_copy(build), 0); in isl_ast_build_node_from_schedule_map()
5162 node = isl_ast_node_from_graft_list(list, build); in isl_ast_build_node_from_schedule_map()
5163 isl_ast_build_free(build); in isl_ast_build_node_from_schedule_map()
5173 __isl_keep isl_ast_build *build, __isl_take isl_union_map *schedule) in isl_ast_build_ast_from_schedule() argument
5175 return isl_ast_build_node_from_schedule_map(build, schedule); in isl_ast_build_ast_from_schedule()
5185 * Note that the current build does not refer to any band node, so
5196 __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, in build_ast_from_leaf() argument
5202 list = generate_inner_level(executed, isl_ast_build_copy(build)); in build_ast_from_leaf()
5203 list = isl_ast_graft_list_group_on_guard(list, build); in build_ast_from_leaf()
5204 isl_ast_build_free(build); in build_ast_from_leaf()
5242 * Otherwise, we extend the build and the inverse schedule with
5250 __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, in build_ast_from_band() argument
5261 if (!build || n < 0 || !executed) in build_ast_from_band()
5265 return build_ast_from_child(build, node, executed); in build_ast_from_band()
5269 isl_ast_build_get_space(build, 1)); in build_ast_from_band()
5281 n1 = isl_ast_build_dim(build, isl_dim_param); in build_ast_from_band()
5282 build = isl_ast_build_product(build, space); in build_ast_from_band()
5283 n2 = isl_ast_build_dim(build, isl_dim_param); in build_ast_from_band()
5285 build = isl_ast_build_free(build); in build_ast_from_band()
5287 isl_die(isl_ast_build_get_ctx(build), isl_error_invalid, in build_ast_from_band()
5289 build = isl_ast_build_free(build)); in build_ast_from_band()
5290 build = isl_ast_build_set_schedule_node(build, node); in build_ast_from_band()
5292 list = generate_next_level(executed, build); in build_ast_from_band()
5300 isl_ast_build_free(build); in build_ast_from_band()
5306 * to "build".
5313 __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build, in hoist_out_of_context() argument
5321 n_param = isl_ast_build_dim(build, isl_dim_param); in hoist_out_of_context()
5340 build, sub_build); in hoist_out_of_context()
5356 * We add the extra parameters to a new build and the context
5357 * constraints to both the build and (as a single disjunct)
5364 * the new build, in order to be able to exploit the additional
5379 __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, in build_ast_from_context() argument
5392 build = isl_ast_build_free(build); in build_ast_from_context()
5393 space = isl_ast_build_get_space(build, 1); in build_ast_from_context()
5396 sub_build = isl_ast_build_copy(build); in build_ast_from_context()
5418 list = hoist_out_of_context(list, build, sub_build); in build_ast_from_context()
5420 isl_ast_build_free(build); in build_ast_from_context()
5437 __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, in build_ast_from_expansion() argument
5453 isl_die(isl_ast_build_get_ctx(build), isl_error_invalid, in build_ast_from_expansion()
5457 return build_ast_from_child(build, node, executed); in build_ast_from_expansion()
5459 isl_ast_build_free(build); in build_ast_from_expansion()
5478 __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, in build_ast_from_extension() argument
5485 set = isl_ast_build_get_generated(build); in build_ast_from_extension()
5492 isl_multi_aff_copy(build->internal2input)); in build_ast_from_extension()
5494 extension = isl_ast_build_substitute_values_union_map_domain(build, in build_ast_from_extension()
5498 return build_ast_from_child(build, node, executed); in build_ast_from_extension()
5519 __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, in build_ast_from_filter() argument
5531 if (!build || !node || !executed) in build_ast_from_filter()
5543 isl_die(isl_ast_build_get_ctx(build), isl_error_invalid, in build_ast_from_filter()
5553 return build_ast_from_child(build, node, orig); in build_ast_from_filter()
5557 return build_ast_from_child(build, node, executed); in build_ast_from_filter()
5559 ctx = isl_ast_build_get_ctx(build); in build_ast_from_filter()
5561 isl_ast_build_free(build); in build_ast_from_filter()
5566 isl_ast_build_free(build); in build_ast_from_filter()
5587 __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, in build_ast_from_guard() argument
5598 space = isl_ast_build_get_space(build, 1); in build_ast_from_guard()
5606 isl_die(isl_ast_build_get_ctx(build), isl_error_invalid, in build_ast_from_guard()
5610 isl_multi_aff_copy(build->internal2input)); in build_ast_from_guard()
5611 guard = isl_ast_build_specialize(build, guard); in build_ast_from_guard()
5612 guard = isl_set_gist(guard, isl_set_copy(build->generated)); in build_ast_from_guard()
5614 sub_build = isl_ast_build_copy(build); in build_ast_from_guard()
5629 enforced = extract_shared_enforced(list, build); in build_ast_from_guard()
5631 build, sub_build); in build_ast_from_guard()
5634 isl_ast_build_free(build); in build_ast_from_guard()
5643 * in "build".
5646 __isl_keep isl_ast_build *build) in before_each_mark() argument
5648 if (!build) in before_each_mark()
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()
5659 * in "build".
5662 __isl_take isl_ast_graft *graft, __isl_keep isl_ast_build *build) in after_each_mark() argument
5664 if (!graft || !build) in after_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()
5684 * callbacks, we record the current inverse schedule in the build.
5691 __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, in build_ast_from_mark() argument
5699 build = isl_ast_build_set_executed(build, isl_union_map_copy(executed)); in build_ast_from_mark()
5702 if (before_each_mark(mark, build) < 0) in build_ast_from_mark()
5705 list = build_ast_from_child(isl_ast_build_copy(build), node, executed); in build_ast_from_mark()
5706 list = isl_ast_graft_list_fuse(list, build); in build_ast_from_mark()
5715 graft = after_each_mark(graft, build); in build_ast_from_mark()
5718 isl_ast_build_free(build); in build_ast_from_mark()
5724 __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node,
5738 __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, in build_ast_from_sequence() argument
5746 ctx = isl_ast_build_get_ctx(build); in build_ast_from_sequence()
5757 list_i = build_ast_from_schedule_node(isl_ast_build_copy(build), in build_ast_from_sequence()
5761 isl_ast_build_free(build); in build_ast_from_sequence()
5780 __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, in build_ast_from_schedule_node() argument
5791 return build_ast_from_leaf(build, node, executed); in build_ast_from_schedule_node()
5793 return build_ast_from_band(build, node, executed); in build_ast_from_schedule_node()
5795 return build_ast_from_context(build, node, executed); in build_ast_from_schedule_node()
5800 return build_ast_from_expansion(build, node, executed); in build_ast_from_schedule_node()
5802 return build_ast_from_extension(build, node, executed); in build_ast_from_schedule_node()
5804 return build_ast_from_filter(build, node, executed); in build_ast_from_schedule_node()
5806 return build_ast_from_guard(build, node, executed); in build_ast_from_schedule_node()
5808 return build_ast_from_mark(build, node, executed); in build_ast_from_schedule_node()
5811 return build_ast_from_sequence(build, node, executed); in build_ast_from_schedule_node()
5814 isl_die(isl_ast_build_get_ctx(build), isl_error_internal, in build_ast_from_schedule_node()
5819 isl_ast_build_free(build); in build_ast_from_schedule_node()
5835 __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, in build_ast_from_child() argument
5839 return build_ast_from_schedule_node(build, node, executed); in build_ast_from_child()
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
5858 __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node) in build_ast_from_domain() argument
5869 if (!build) in build_ast_from_domain()
5872 ctx = isl_ast_build_get_ctx(build); in build_ast_from_domain()
5873 space = isl_ast_build_get_space(build, 1); in build_ast_from_domain()
5887 build = isl_ast_build_product(build, space); in build_ast_from_domain()
5889 set = isl_ast_build_get_domain(build); in build_ast_from_domain()
5894 list = build_ast_from_child(isl_ast_build_copy(build), node, executed); in build_ast_from_domain()
5895 ast = isl_ast_node_from_graft_list(list, build); in build_ast_from_domain()
5896 isl_ast_build_free(build); in build_ast_from_domain()
5901 isl_ast_build_free(build); in build_ast_from_domain()
5908 * "build" is an isl_ast_build that has been created using
5916 __isl_keep isl_ast_build *build, __isl_take isl_schedule *schedule) in isl_ast_build_node_from_schedule() argument
5921 if (!build || !schedule) in isl_ast_build_node_from_schedule()
5924 ctx = isl_ast_build_get_ctx(build); in isl_ast_build_node_from_schedule()
5931 build = isl_ast_build_copy(build); in isl_ast_build_node_from_schedule()
5932 build = isl_ast_build_set_single_valued(build, 0); in isl_ast_build_node_from_schedule()
5936 build = isl_ast_build_free(build)); in isl_ast_build_node_from_schedule()
5937 return build_ast_from_domain(build, node); in isl_ast_build_node_from_schedule()