From ae3807264e9c75a19447221468efaf195af12e69 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 7 Jan 2014 12:55:24 +0100 Subject: [PATCH] add isl_schedule_reset_user Signed-off-by: Sven Verdoolaege --- doc/user.pod | 7 +++++++ include/isl/schedule.h | 3 +++ isl_schedule.c | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index bf026529..9c4208dd 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -7324,6 +7324,13 @@ can be created using the following functions. The domains of the two input schedules need to be disjoint. +The following function resets the user pointers on all parameter +and tuple identifiers referenced by the nodes of the given schedule. + + #include + __isl_give isl_schedule *isl_schedule_reset_user( + __isl_take isl_schedule *schedule); + An C representation of the schedule can be obtained from an C using the following function. diff --git a/include/isl/schedule.h b/include/isl/schedule.h index e9257671..37b2b498 100644 --- a/include/isl/schedule.h +++ b/include/isl/schedule.h @@ -106,6 +106,9 @@ __isl_give isl_schedule *isl_schedule_sequence( __isl_give isl_schedule *isl_schedule_set( __isl_take isl_schedule *schedule1, __isl_take isl_schedule *schedule2); +__isl_give isl_schedule *isl_schedule_reset_user( + __isl_take isl_schedule *schedule); + __isl_give isl_band_list *isl_schedule_get_band_forest( __isl_keep isl_schedule *schedule); diff --git a/isl_schedule.c b/isl_schedule.c index 21abc85e..2a568ba2 100644 --- a/isl_schedule.c +++ b/isl_schedule.c @@ -374,6 +374,24 @@ __isl_give isl_schedule *isl_schedule_map_schedule_node( return schedule; } +/* Wrapper around isl_schedule_node_reset_user for use as + * an isl_schedule_map_schedule_node callback. + */ +static __isl_give isl_schedule_node *reset_user( + __isl_take isl_schedule_node *node, void *user) +{ + return isl_schedule_node_reset_user(node); +} + +/* Reset the user pointer on all identifiers of parameters and tuples + * in the schedule "schedule". + */ +__isl_give isl_schedule *isl_schedule_reset_user( + __isl_take isl_schedule *schedule) +{ + return isl_schedule_map_schedule_node(schedule, &reset_user, NULL); +} + /* Return an isl_union_map representation of the schedule. * If we still have access to the schedule tree, then we return * an isl_union_map corresponding to the subtree schedule of the child -- 2.11.4.GIT