Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
__isl_give isl_band_list *isl_schedule_get_band_forest(
__isl_keep isl_schedule *schedule);
__isl_give isl_band_list *isl_schedule_get_band_forest(
__isl_keep isl_schedule *schedule);
+The individual bands can be visited in depth-first post-order
+using the following function.
+
+ #include <isl/schedule.h>
+ int isl_schedule_foreach_band(
+ __isl_keep isl_schedule *sched,
+ int (*fn)(__isl_keep isl_band *band, void *user),
+ void *user);
+
The list can be manipulated as explained in L<"Lists">.
The bands inside the list can be copied and freed using the following
functions.
The list can be manipulated as explained in L<"Lists">.
The bands inside the list can be copied and freed using the following
functions.
That is, if the dependence distances of the proximity
dependences are all zero in that direction (for fixed
iterations of outer bands).
That is, if the dependence distances of the proximity
dependences are all zero in that direction (for fixed
iterations of outer bands).
-The function C<isl_band_list_foreach_band> calls C<fn> on the bands
+Like C<isl_schedule_foreach_band>,
+the function C<isl_band_list_foreach_band> calls C<fn> on the bands
in depth-first post-order.
A band can be tiled using the following function.
in depth-first post-order.
A band can be tiled using the following function.
#include <isl/union_set_type.h>
#include <isl/union_map_type.h>
#include <isl/union_set_type.h>
#include <isl/union_map_type.h>
#include <isl/list.h>
#if defined(__cplusplus)
#include <isl/list.h>
#if defined(__cplusplus)
__isl_keep isl_schedule *schedule);
void isl_schedule_dump(__isl_keep isl_schedule *schedule);
__isl_keep isl_schedule *schedule);
void isl_schedule_dump(__isl_keep isl_schedule *schedule);
+int isl_schedule_foreach_band(__isl_keep isl_schedule *sched,
+ int (*fn)(__isl_keep isl_band *band, void *user), void *user);
+
#if defined(__cplusplus)
}
#endif
#if defined(__cplusplus)
}
#endif
return isl_band_list_dup(schedule->band_forest);
}
return isl_band_list_dup(schedule->band_forest);
}
+/* Call "fn" on each band in the schedule in depth-first post-order.
+ */
+int isl_schedule_foreach_band(__isl_keep isl_schedule *sched,
+ int (*fn)(__isl_keep isl_band *band, void *user), void *user)
+{
+ int r;
+ isl_band_list *forest;
+
+ if (!sched)
+ return -1;
+
+ forest = isl_schedule_get_band_forest(sched);
+ r = isl_band_list_foreach_band(forest, fn, user);
+ isl_band_list_free(forest);
+
+ return r;
+}
+
static __isl_give isl_printer *print_band_list(__isl_take isl_printer *p,
__isl_keep isl_band_list *list);
static __isl_give isl_printer *print_band_list(__isl_take isl_printer *p,
__isl_keep isl_band_list *list);