Lines Matching full:schedule
19 #include <isl/schedule.h>
27 /* Return a schedule encapsulating the given schedule tree.
29 * We currently only allow schedule trees with a domain or extension as root.
32 * used to represent leaves in the constructed schedule.
35 * these leaves to ensure that they are only used while the schedule
42 isl_schedule *schedule; in isl_schedule_from_schedule_tree() local
50 "root of schedule tree should be a domain or extension", in isl_schedule_from_schedule_tree()
53 schedule = isl_calloc_type(ctx, isl_schedule); in isl_schedule_from_schedule_tree()
54 if (!schedule) in isl_schedule_from_schedule_tree()
57 schedule->ref = 1; in isl_schedule_from_schedule_tree()
58 schedule->root = tree; in isl_schedule_from_schedule_tree()
59 schedule->leaf = isl_schedule_tree_leaf(ctx); in isl_schedule_from_schedule_tree()
61 if (!schedule->leaf) in isl_schedule_from_schedule_tree()
62 return isl_schedule_free(schedule); in isl_schedule_from_schedule_tree()
63 return schedule; in isl_schedule_from_schedule_tree()
69 /* Return a pointer to a schedule with as single node
83 /* Return a pointer to a schedule with as single node
102 /* Return an isl_schedule that is equal to "schedule" and that has only
105 __isl_give isl_schedule *isl_schedule_cow(__isl_take isl_schedule *schedule) in isl_schedule_cow() argument
110 if (!schedule) in isl_schedule_cow()
112 if (schedule->ref == 1) in isl_schedule_cow()
113 return schedule; in isl_schedule_cow()
115 ctx = isl_schedule_get_ctx(schedule); in isl_schedule_cow()
116 schedule->ref--; in isl_schedule_cow()
117 tree = isl_schedule_tree_copy(schedule->root); in isl_schedule_cow()
135 /* Replace the root of "schedule" by "tree".
138 __isl_take isl_schedule *schedule, __isl_take isl_schedule_tree *tree) in isl_schedule_set_root() argument
140 if (!schedule || !tree) in isl_schedule_set_root()
142 if (schedule->root == tree) { in isl_schedule_set_root()
144 return schedule; in isl_schedule_set_root()
147 schedule = isl_schedule_cow(schedule); in isl_schedule_set_root()
148 if (!schedule) in isl_schedule_set_root()
150 isl_schedule_tree_free(schedule->root); in isl_schedule_set_root()
151 schedule->root = tree; in isl_schedule_set_root()
153 return schedule; in isl_schedule_set_root()
155 isl_schedule_free(schedule); in isl_schedule_set_root()
160 isl_ctx *isl_schedule_get_ctx(__isl_keep isl_schedule *schedule) in isl_schedule_get_ctx() argument
162 return schedule ? isl_schedule_tree_get_ctx(schedule->leaf) : NULL; in isl_schedule_get_ctx()
165 /* Return a pointer to the leaf of "schedule".
168 __isl_keep isl_schedule *schedule) in isl_schedule_peek_leaf() argument
170 return schedule ? schedule->leaf : NULL; in isl_schedule_peek_leaf()
186 /* Return the (parameter) space of the schedule, i.e., the space
190 __isl_keep isl_schedule *schedule) in isl_schedule_get_space() argument
196 if (!schedule) in isl_schedule_get_space()
198 type = isl_schedule_tree_get_type(schedule->root); in isl_schedule_get_space()
200 isl_die(isl_schedule_get_ctx(schedule), isl_error_internal, in isl_schedule_get_space()
203 domain = isl_schedule_tree_domain_get_domain(schedule->root); in isl_schedule_get_space()
210 /* Return a pointer to the root of "schedule".
213 __isl_keep isl_schedule *schedule) in isl_schedule_get_root() argument
219 if (!schedule) in isl_schedule_get_root()
222 ctx = isl_schedule_get_ctx(schedule); in isl_schedule_get_root()
223 tree = isl_schedule_tree_copy(schedule->root); in isl_schedule_get_root()
224 schedule = isl_schedule_copy(schedule); in isl_schedule_get_root()
226 return isl_schedule_node_alloc(schedule, tree, ancestors, NULL); in isl_schedule_get_root()
229 /* Return the domain of the root domain node of "schedule".
232 __isl_keep isl_schedule *schedule) in isl_schedule_get_domain() argument
234 if (!schedule) in isl_schedule_get_domain()
236 return isl_schedule_tree_domain_get_domain(schedule->root); in isl_schedule_get_domain()
273 __isl_take isl_schedule *schedule, in isl_schedule_map_schedule_node_bottom_up() argument
279 node = isl_schedule_get_root(schedule); in isl_schedule_map_schedule_node_bottom_up()
280 isl_schedule_free(schedule); in isl_schedule_map_schedule_node_bottom_up()
283 schedule = isl_schedule_node_get_schedule(node); in isl_schedule_map_schedule_node_bottom_up()
286 return schedule; in isl_schedule_map_schedule_node_bottom_up()
299 * in the schedule "schedule".
302 __isl_take isl_schedule *schedule) in isl_schedule_reset_user() argument
304 return isl_schedule_map_schedule_node_bottom_up(schedule, &reset_user, in isl_schedule_reset_user()
319 /* Align the parameters of all nodes in schedule "schedule"
323 __isl_take isl_schedule *schedule, __isl_take isl_space *space) in isl_schedule_align_params() argument
325 schedule = isl_schedule_map_schedule_node_bottom_up(schedule, in isl_schedule_align_params()
328 return schedule; in isl_schedule_align_params()
343 /* Compute the pullback of "schedule" by the function represented by "upma".
344 * In other words, plug in "upma" in the iteration domains of "schedule".
346 * The schedule tree is not allowed to contain any expansion nodes.
349 __isl_take isl_schedule *schedule, in isl_schedule_pullback_union_pw_multi_aff() argument
352 schedule = isl_schedule_map_schedule_node_bottom_up(schedule, in isl_schedule_pullback_union_pw_multi_aff()
355 return schedule; in isl_schedule_pullback_union_pw_multi_aff()
358 /* Expand the schedule "schedule" by extending all leaves
367 __isl_give isl_schedule *isl_schedule_expand(__isl_take isl_schedule *schedule, in isl_schedule_expand() argument
383 node = isl_schedule_get_root(schedule); in isl_schedule_expand()
384 isl_schedule_free(schedule); in isl_schedule_expand()
386 schedule = isl_schedule_node_get_schedule(node); in isl_schedule_expand()
389 return schedule; in isl_schedule_expand()
392 /* Intersect the domain of the schedule "schedule" with "domain".
393 * The root of "schedule" is required to be a domain node.
396 __isl_take isl_schedule *schedule, __isl_take isl_union_set *domain) in isl_schedule_intersect_domain() argument
401 if (!schedule || !domain) in isl_schedule_intersect_domain()
404 root_type = isl_schedule_tree_get_type(schedule->root); in isl_schedule_intersect_domain()
406 isl_die(isl_schedule_get_ctx(schedule), isl_error_invalid, in isl_schedule_intersect_domain()
409 node = isl_schedule_get_root(schedule); in isl_schedule_intersect_domain()
410 isl_schedule_free(schedule); in isl_schedule_intersect_domain()
412 schedule = isl_schedule_node_get_schedule(node); in isl_schedule_intersect_domain()
415 return schedule; in isl_schedule_intersect_domain()
417 isl_schedule_free(schedule); in isl_schedule_intersect_domain()
422 /* Replace the domain of the schedule "schedule" with the gist
426 __isl_take isl_schedule *schedule, __isl_take isl_set *context) in isl_schedule_gist_domain_params() argument
431 if (!schedule || !context) in isl_schedule_gist_domain_params()
434 root_type = isl_schedule_tree_get_type(schedule->root); in isl_schedule_gist_domain_params()
436 isl_die(isl_schedule_get_ctx(schedule), isl_error_invalid, in isl_schedule_gist_domain_params()
439 node = isl_schedule_get_root(schedule); in isl_schedule_gist_domain_params()
440 isl_schedule_free(schedule); in isl_schedule_gist_domain_params()
442 schedule = isl_schedule_node_get_schedule(node); in isl_schedule_gist_domain_params()
445 return schedule; in isl_schedule_gist_domain_params()
447 isl_schedule_free(schedule); in isl_schedule_gist_domain_params()
452 /* Return an isl_union_map representation of the schedule. In particular,
453 * return an isl_union_map corresponding to the subtree schedule of the child
478 /* Insert a band node with partial schedule "partial" between the domain
479 * root node of "schedule" and its single child.
480 * Return a pointer to the updated schedule.
486 __isl_take isl_schedule *schedule, in isl_schedule_insert_partial_schedule() argument
492 node = isl_schedule_get_root(schedule); in isl_schedule_insert_partial_schedule()
493 isl_schedule_free(schedule); in isl_schedule_insert_partial_schedule()
510 schedule = isl_schedule_node_get_schedule(node); in isl_schedule_insert_partial_schedule()
513 return schedule; in isl_schedule_insert_partial_schedule()
521 * root node of "schedule" and its single child.
522 * Return a pointer to the updated schedule.
525 __isl_take isl_schedule *schedule, __isl_take isl_set *context) in isl_schedule_insert_context() argument
529 node = isl_schedule_get_root(schedule); in isl_schedule_insert_context()
530 isl_schedule_free(schedule); in isl_schedule_insert_context()
533 schedule = isl_schedule_node_get_schedule(node); in isl_schedule_insert_context()
536 return schedule; in isl_schedule_insert_context()
540 * root node of "schedule" and its single child.
541 * Return a pointer to the updated schedule.
544 __isl_take isl_schedule *schedule, __isl_take isl_set *guard) in isl_schedule_insert_guard() argument
548 node = isl_schedule_get_root(schedule); in isl_schedule_insert_guard()
549 isl_schedule_free(schedule); in isl_schedule_insert_guard()
552 schedule = isl_schedule_node_get_schedule(node); in isl_schedule_insert_guard()
555 return schedule; in isl_schedule_insert_guard()
582 /* Construct a schedule that combines the schedules "schedule1" and "schedule2"
587 * The new schedule has as domain the union of the domains of the two
629 "schedule domains not disjoint", in isl_schedule_pair()
650 /* Construct a schedule that combines the schedules "schedule1" and "schedule2"
661 /* Construct a schedule that combines the schedules "schedule1" and "schedule2"
671 /* Print "schedule" to "p".
674 __isl_keep isl_schedule *schedule) in isl_printer_print_schedule() argument
676 if (!schedule) in isl_printer_print_schedule()
679 return isl_printer_print_schedule_tree(p, schedule->root); in isl_printer_print_schedule()
683 #define BASE schedule