In the next commits, we will allow the user to modify the band forest.
This means that the schedule represented by the modified band forest
may not be the same as the schedule that was originally computed.
We therefore need to extract it from this forest if the forest
has been constructed already.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
return schedule ? isl_space_get_ctx(schedule->dim) : NULL;
}
+/* Return an isl_union_map of the schedule. If we have already constructed
+ * a band forest, then this band forest may have been modified so we need
+ * to extract the isl_union_map from the forest rather than from
+ * the originally computed schedule.
+ */
__isl_give isl_union_map *isl_schedule_get_map(__isl_keep isl_schedule *sched)
{
int i;
if (!sched)
return NULL;
+ if (sched->band_forest)
+ return isl_band_list_get_suffix_schedule(sched->band_forest);
+
umap = isl_union_map_empty(isl_space_copy(sched->dim));
for (i = 0; i < sched->n; ++i) {
isl_multi_aff *ma;