From d32f3c6c6a306c9c874a66f11b884fb981d0a0d4 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 30 Jul 2014 13:22:27 +0200 Subject: [PATCH] drop isl_ast_graft_alloc_level Now that we have inlined the only use of this function, we no longer need it and we can simplify the function that was called by both isl_ast_graft_alloc_level and isl_ast_graft_fuse. Signed-off-by: Sven Verdoolaege --- isl_ast_graft.c | 42 +++++------------------------------------- isl_ast_graft_private.h | 3 --- 2 files changed, 5 insertions(+), 40 deletions(-) diff --git a/isl_ast_graft.c b/isl_ast_graft.c index 56b06944..d5f43bb1 100644 --- a/isl_ast_graft.c +++ b/isl_ast_graft.c @@ -812,11 +812,6 @@ __isl_give isl_ast_graft *isl_ast_graft_alloc_from_children( /* Combine the grafts in the list into a single graft. * - * If "up" is set then the resulting graft will be used at an outer level. - * In this case, "build" refers to the outer level, while "sub_build" - * refers to the inner level. If "up" is not set, then the same build - * should be passed to both arguments. - * * The guard is initialized to the shared guard of the list elements (if any), * provided it does not depend on the current dimension. * The guards in the elements are then simplified with respect to the @@ -831,10 +826,8 @@ __isl_give isl_ast_graft *isl_ast_graft_alloc_from_children( * or, if there is only a single element, the node of that element. */ static __isl_give isl_ast_graft *ast_graft_list_fuse( - __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build, - __isl_keep isl_ast_build *sub_build, int up) + __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build) { - isl_ctx *ctx; isl_ast_graft *graft; isl_basic_set *enforced; isl_set *guard; @@ -842,18 +835,10 @@ static __isl_give isl_ast_graft *ast_graft_list_fuse( if (!list) return NULL; - ctx = isl_ast_build_get_ctx(build); - if (!up || isl_options_get_ast_build_exploit_nested_bounds(ctx)) - enforced = isl_ast_graft_list_extract_shared_enforced(list, - build); - else { - isl_space *space = isl_ast_build_get_space(build, 1); - enforced = isl_basic_set_universe(space); - } - + enforced = isl_ast_graft_list_extract_shared_enforced(list, build); guard = isl_ast_graft_list_extract_hoistable_guard(list, build); graft = isl_ast_graft_alloc_from_children(list, guard, enforced, - build, sub_build); + build, build); return graft; } @@ -872,7 +857,7 @@ __isl_give isl_ast_graft_list *isl_ast_graft_list_fuse( return NULL; if (isl_ast_graft_list_n_ast_graft(list) <= 1) return list; - graft = ast_graft_list_fuse(list, build, build, 0); + graft = ast_graft_list_fuse(list, build); return isl_ast_graft_list_from_ast_graft(graft); } @@ -892,24 +877,7 @@ static __isl_give isl_ast_graft *isl_ast_graft_fuse( list = isl_ast_graft_list_add(list, graft1); list = isl_ast_graft_list_add(list, graft2); - return ast_graft_list_fuse(list, build, build, 0); -} - -/* Allocate a graft for the current level based on the list of grafts - * of the inner level. - * "build" represents the context of the current level. - * "sub_build" represents the context of the inner level. - * - * The node is initialized to either a block containing the nodes of "children" - * or, if there is only a single child, the node of that child. - * If the current level requires a for node, it should be inserted by - * a subsequent call to isl_ast_graft_insert_for. - */ -__isl_give isl_ast_graft *isl_ast_graft_alloc_level( - __isl_take isl_ast_graft_list *children, - __isl_keep isl_ast_build *build, __isl_keep isl_ast_build *sub_build) -{ - return ast_graft_list_fuse(children, build, sub_build, 1); + return ast_graft_list_fuse(list, build); } /* Insert a for node enclosing the current graft->node. diff --git a/isl_ast_graft_private.h b/isl_ast_graft_private.h index f3da4dce..0b9f759c 100644 --- a/isl_ast_graft_private.h +++ b/isl_ast_graft_private.h @@ -48,9 +48,6 @@ __isl_give isl_ast_graft *isl_ast_graft_alloc_from_children( __isl_take isl_ast_graft_list *list, __isl_take isl_set *guard, __isl_take isl_basic_set *enforced, __isl_keep isl_ast_build *build, __isl_keep isl_ast_build *sub_build); -__isl_give isl_ast_graft *isl_ast_graft_alloc_level( - __isl_take isl_ast_graft_list *children, - __isl_keep isl_ast_build *build, __isl_keep isl_ast_build *sub_build); __isl_give isl_ast_graft_list *isl_ast_graft_list_fuse( __isl_take isl_ast_graft_list *children, __isl_keep isl_ast_build *build); -- 2.11.4.GIT