From b30a651ce738011628f7fe27cf8b13ce87f60c40 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 1 Jul 2014 16:52:30 +0200 Subject: [PATCH] add isl_schedule_node_band_get_space The function isl_schedule_node_band_tile that will be introduced in the next commit requires the sizes to live in the same space as the band itself. The function isl_schedule_node_band_get_space provides a convenient way for users to query this space. Signed-off-by: Sven Verdoolaege --- doc/user.pod | 4 ++++ include/isl/schedule_node.h | 2 ++ isl_schedule_band.c | 10 ++++++++++ isl_schedule_band.h | 2 ++ isl_schedule_node.c | 11 +++++++++++ isl_schedule_tree.c | 15 +++++++++++++++ isl_schedule_tree.h | 2 ++ 7 files changed, 46 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index cc8a27d9..e175fb51 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -7398,6 +7398,8 @@ Several node types have their own functions for querying (and in some cases setting) some node type specific properties. #include + __isl_give isl_space *isl_schedule_node_band_get_space( + __isl_keep isl_schedule_node *node); __isl_give isl_multi_union_pw_aff * isl_schedule_node_band_get_partial_schedule( __isl_keep isl_schedule_node *node); @@ -7418,6 +7420,8 @@ Several node types have their own functions for querying isl_schedule_node_band_set_permutable( __isl_take isl_schedule_node *node, int permutable); +The function C returns the space +of the partial schedule of the band. The function C returns a representation of the partial schedule of the band node in the form of an C. diff --git a/include/isl/schedule_node.h b/include/isl/schedule_node.h index 91291254..4ae0c67f 100644 --- a/include/isl/schedule_node.h +++ b/include/isl/schedule_node.h @@ -46,6 +46,8 @@ __isl_give isl_schedule_node *isl_schedule_node_previous_sibling( __isl_give isl_schedule_node *isl_schedule_node_next_sibling( __isl_take isl_schedule_node *node); +__isl_give isl_space *isl_schedule_node_band_get_space( + __isl_keep isl_schedule_node *node); __isl_give isl_multi_union_pw_aff *isl_schedule_node_band_get_partial_schedule( __isl_keep isl_schedule_node *node); __isl_give isl_union_map *isl_schedule_node_band_get_partial_schedule_union_map( diff --git a/isl_schedule_band.c b/isl_schedule_band.c index 6c93d62d..12d8a011 100644 --- a/isl_schedule_band.c +++ b/isl_schedule_band.c @@ -215,6 +215,16 @@ __isl_give isl_schedule_band *isl_schedule_band_set_permutable( return band; } +/* Return the schedule space of the band. + */ +__isl_give isl_space *isl_schedule_band_get_space( + __isl_keep isl_schedule_band *band) +{ + if (!band) + return NULL; + return isl_multi_union_pw_aff_get_space(band->mupa); +} + /* Return the schedule of the band in isolation. */ __isl_give isl_multi_union_pw_aff *isl_schedule_band_get_partial_schedule( diff --git a/isl_schedule_band.h b/isl_schedule_band.h index 269bd431..8078bb53 100644 --- a/isl_schedule_band.h +++ b/isl_schedule_band.h @@ -34,6 +34,8 @@ __isl_null isl_schedule_band *isl_schedule_band_free( isl_ctx *isl_schedule_band_get_ctx(__isl_keep isl_schedule_band *band); +__isl_give isl_space *isl_schedule_band_get_space( + __isl_keep isl_schedule_band *band); __isl_give isl_multi_union_pw_aff *isl_schedule_band_get_partial_schedule( __isl_keep isl_schedule_band *band); diff --git a/isl_schedule_node.c b/isl_schedule_node.c index 87c1ce0e..7fd5c563 100644 --- a/isl_schedule_node.c +++ b/isl_schedule_node.c @@ -867,6 +867,17 @@ __isl_give isl_schedule_node *isl_schedule_node_band_set_permutable( return node; } +/* Return the schedule space of the band node. + */ +__isl_give isl_space *isl_schedule_node_band_get_space( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_tree_band_get_space(node->tree); +} + /* Return the schedule of the band node in isolation. */ __isl_give isl_multi_union_pw_aff *isl_schedule_node_band_get_partial_schedule( diff --git a/isl_schedule_tree.c b/isl_schedule_tree.c index 0c045ef7..393f188d 100644 --- a/isl_schedule_tree.c +++ b/isl_schedule_tree.c @@ -543,6 +543,21 @@ __isl_give isl_schedule_tree *isl_schedule_tree_band_set_permutable( return tree; } +/* Return the schedule space of the band tree root. + */ +__isl_give isl_space *isl_schedule_tree_band_get_space( + __isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return NULL); + + return isl_schedule_band_get_space(tree->band); +} + /* Return the schedule of the band tree root in isolation. */ __isl_give isl_multi_union_pw_aff *isl_schedule_tree_band_get_partial_schedule( diff --git a/isl_schedule_tree.h b/isl_schedule_tree.h index eb1f9ed1..72a72cdb 100644 --- a/isl_schedule_tree.h +++ b/isl_schedule_tree.h @@ -64,6 +64,8 @@ __isl_give isl_schedule_tree *isl_schedule_tree_from_children( enum isl_schedule_node_type type, __isl_take isl_schedule_tree_list *list); +__isl_give isl_space *isl_schedule_tree_band_get_space( + __isl_keep isl_schedule_tree *tree); __isl_give isl_multi_union_pw_aff *isl_schedule_tree_band_get_partial_schedule( __isl_keep isl_schedule_tree *tree); __isl_give isl_union_set *isl_schedule_tree_domain_get_domain( -- 2.11.4.GIT