From 492b313c655711484bffe4689c91b77e5295bbda Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 26 Mar 2014 09:53:50 +0100 Subject: [PATCH] tree2scop.c: extract_kill: update kill expression rather than creating new one That is, take the kill expression from the other statement, but drop the statement name from the expression, so that we can add the name of the new statement. As a nice side-effect of the clean-up, we remove a call to pet_expr_access_get_access, which we want to remove soon. Signed-off-by: Sven Verdoolaege --- tree2scop.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/tree2scop.c b/tree2scop.c index 6e0377a..f64fe85 100644 --- a/tree2scop.c +++ b/tree2scop.c @@ -2022,9 +2022,8 @@ static struct pet_scop *extract_kill(__isl_keep isl_set *domain, { pet_expr *kill; struct pet_stmt *stmt; - isl_multi_pw_aff *index; - isl_map *access; - pet_expr *expr, *arg; + isl_space *space; + isl_multi_pw_aff *mpa; pet_tree *tree; if (!domain || !scop) @@ -2037,15 +2036,12 @@ static struct pet_scop *extract_kill(__isl_keep isl_set *domain, isl_die(isl_set_get_ctx(domain), isl_error_internal, "expecting kill statement", return NULL); - expr = pet_tree_expr_get_expr(stmt->body); - arg = pet_expr_get_arg(expr, 0); - pet_expr_free(expr); - index = pet_expr_access_get_index(arg); - access = pet_expr_access_get_access(arg); - pet_expr_free(arg); - index = isl_multi_pw_aff_reset_tuple_id(index, isl_dim_in); - access = isl_map_reset_tuple_id(access, isl_dim_in); - kill = pet_expr_kill_from_access_and_index(access, index); + kill = pet_tree_expr_get_expr(stmt->body); + space = pet_stmt_get_space(stmt); + space = isl_space_map_from_set(space); + mpa = isl_multi_pw_aff_identity(space); + mpa = isl_multi_pw_aff_reset_tuple_id(mpa, isl_dim_in); + kill = pet_expr_update_domain(kill, mpa); tree = pet_tree_new_expr(kill); tree = pet_tree_set_loc(tree, pet_loc_copy(stmt->loc)); stmt = pet_stmt_from_pet_tree(isl_set_copy(domain), -- 2.11.4.GIT