From 24bc75034b5828506cb753309adcb6df618df158 Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Wed, 4 Nov 2015 20:59:18 +0000 Subject: [PATCH] remove parameter_rename_map This map was used in the transition to the new scop detection: with the new scop detection, we do not need this map anymore. * graphite-isl-ast-to-gimple.c (gcc_expression_from_isl_ast_expr_id): Remove use of parameter_rename_map. (copy_def): Remove. (copy_internal_parameters): Remove. (graphite_regenerate_ast_isl): Remove call to copy_internal_parameters. * sese.c (new_sese_info): Do not initialize parameter_rename_map. (free_sese_info): Do not free parameter_rename_map. (set_rename): Do not use parameter_rename_map. (rename_uses): Update call to set_rename. (graphite_copy_stmts_from_block): Do not use parameter_rename_map. * sese.h (parameter_rename_map_t): Remove. (struct sese_info_t): Remove field parameter_rename_map. Co-Authored-By: Sebastian Pop From-SVN: r229783 --- gcc/ChangeLog | 16 +++++++ gcc/graphite-isl-ast-to-gimple.c | 73 +------------------------------- gcc/sese.c | 44 ++----------------- gcc/sese.h | 5 --- 4 files changed, 20 insertions(+), 118 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9e4b928bfde..99ad1589cab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2015-11-04 Aditya Kumar + Sebastian Pop + + * graphite-isl-ast-to-gimple.c (gcc_expression_from_isl_ast_expr_id): + Remove use of parameter_rename_map. + (copy_def): Remove. + (copy_internal_parameters): Remove. + (graphite_regenerate_ast_isl): Remove call to copy_internal_parameters. + * sese.c (new_sese_info): Do not initialize parameter_rename_map. + (free_sese_info): Do not free parameter_rename_map. + (set_rename): Do not use parameter_rename_map. + (rename_uses): Update call to set_rename. + (graphite_copy_stmts_from_block): Do not use parameter_rename_map. + * sese.h (parameter_rename_map_t): Remove. + (struct sese_info_t): Remove field parameter_rename_map. + 2015-11-04 Aditya Kumar Sebastian Pop diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c index 975e1063c2d..628fc90f7b2 100644 --- a/gcc/graphite-isl-ast-to-gimple.c +++ b/gcc/graphite-isl-ast-to-gimple.c @@ -288,11 +288,7 @@ gcc_expression_from_isl_ast_expr_id (tree type, "Could not map isl_id to tree expression"); isl_ast_expr_free (expr_id); tree t = res->second; - tree *val = region->parameter_rename_map->get(t); - - if (!val) - val = &t; - return fold_convert (type, *val); + return fold_convert (type, t); } /* Converts an isl_ast_expr_int expression E to a GCC expression tree of @@ -1089,70 +1085,6 @@ scop_to_isl_ast (scop_p scop, ivs_params &ip) return ast_isl; } -/* Copy def from sese REGION to the newly created TO_REGION. TR is defined by - DEF_STMT. GSI points to entry basic block of the TO_REGION. */ - -static void -copy_def (tree tr, gimple *def_stmt, sese_info_p region, sese_info_p to_region, - gimple_stmt_iterator *gsi) -{ - if (!defined_in_sese_p (tr, region->region)) - return; - - ssa_op_iter iter; - use_operand_p use_p; - FOR_EACH_SSA_USE_OPERAND (use_p, def_stmt, iter, SSA_OP_USE) - { - tree use_tr = USE_FROM_PTR (use_p); - - /* Do not copy parameters that have been generated in the header of the - scop. */ - if (region->parameter_rename_map->get(use_tr)) - continue; - - gimple *def_of_use = SSA_NAME_DEF_STMT (use_tr); - if (!def_of_use) - continue; - - copy_def (use_tr, def_of_use, region, to_region, gsi); - } - - gimple *copy = gimple_copy (def_stmt); - gsi_insert_after (gsi, copy, GSI_NEW_STMT); - - /* Create new names for all the definitions created by COPY and - add replacement mappings for each new name. */ - def_operand_p def_p; - ssa_op_iter op_iter; - FOR_EACH_SSA_DEF_OPERAND (def_p, copy, op_iter, SSA_OP_ALL_DEFS) - { - tree old_name = DEF_FROM_PTR (def_p); - tree new_name = create_new_def_for (old_name, copy, def_p); - region->parameter_rename_map->put(old_name, new_name); - } - - update_stmt (copy); -} - -static void -copy_internal_parameters (sese_info_p region, sese_info_p to_region) -{ - /* For all the parameters which definitino is in the if_region->false_region, - insert code on true_region (if_region->true_region->entry). */ - - int i; - tree tr; - gimple_stmt_iterator gsi = gsi_start_bb(to_region->region.entry->dest); - - FOR_EACH_VEC_ELT (region->params, i, tr) - { - // If def is not in region. - gimple *def_stmt = SSA_NAME_DEF_STMT (tr); - if (def_stmt) - copy_def (tr, def_stmt, region, to_region, &gsi); - } -} - /* GIMPLE Loop Generator: generates loops from STMT in GIMPLE form for the given SCOP. Return true if code generation succeeded. @@ -1192,9 +1124,6 @@ graphite_regenerate_ast_isl (scop_p scop) context_loop = region->region.entry->src->loop_father; - /* Copy all the parameters which are defined in the region. */ - copy_internal_parameters(if_region->false_region, if_region->true_region); - translate_isl_ast_to_gimple t(region); edge e = single_succ_edge (if_region->true_region->region.entry->dest); split_edge (e); diff --git a/gcc/sese.c b/gcc/sese.c index c176b8ab98a..644c87cf39f 100644 --- a/gcc/sese.c +++ b/gcc/sese.c @@ -259,7 +259,6 @@ new_sese_info (edge entry, edge exit) SESE_LOOPS (region) = BITMAP_ALLOC (NULL); SESE_LOOP_NEST (region).create (3); SESE_PARAMS (region).create (3); - region->parameter_rename_map = new parameter_rename_map_t; region->bbs.create (3); return region; @@ -275,8 +274,6 @@ free_sese_info (sese_info_p region) SESE_PARAMS (region).release (); SESE_LOOP_NEST (region).release (); - delete region->parameter_rename_map; - region->parameter_rename_map = NULL; XDELETE (region); } @@ -370,8 +367,7 @@ get_rename (rename_map_type *rename_map, tree old_name) /* Register in RENAME_MAP the rename tuple (OLD_NAME, EXPR). */ static void -set_rename (rename_map_type *rename_map, tree old_name, tree expr, - sese_info_p region) +set_rename (rename_map_type *rename_map, tree old_name, tree expr) { if (dump_file) { @@ -386,13 +382,6 @@ set_rename (rename_map_type *rename_map, tree old_name, tree expr, return; rename_map->put (old_name, expr); - - tree t; - int i; - /* For a parameter of a scop we dont want to rename it. */ - FOR_EACH_VEC_ELT (SESE_PARAMS (region), i, t) - if (old_name == t) - region->parameter_rename_map->put(old_name, expr); } /* Renames the scalar uses of the statement COPY, using the @@ -498,7 +487,7 @@ rename_uses (gimple *copy, rename_map_type *rename_map, recompute_tree_invariant_for_addr_expr (rhs); } - set_rename (rename_map, old_name, new_expr, region); + set_rename (rename_map, old_name, new_expr); } return changed; @@ -539,14 +528,6 @@ graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, && scev_analyzable_p (lhs, region->region)) continue; - /* Do not copy parameters that have been generated in the header of the - scop. */ - if (is_gimple_assign (stmt) - && (lhs = gimple_assign_lhs (stmt)) - && TREE_CODE (lhs) == SSA_NAME - && region->parameter_rename_map->get(lhs)) - continue; - /* Create a new copy of STMT and duplicate STMT's virtual operands. */ copy = gimple_copy (stmt); @@ -561,7 +542,7 @@ graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, { tree old_name = DEF_FROM_PTR (def_p); tree new_name = create_new_def_for (old_name, copy, def_p); - set_rename (rename_map, old_name, new_name, region); + set_rename (rename_map, old_name, new_name); } if (rename_uses (copy, rename_map, &gsi_tgt, region, loop, iv_map, @@ -571,25 +552,6 @@ graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, fold_stmt_inplace (&gsi_tgt); } - /* For each SSA_NAME in the parameter_rename_map rename their usage. */ - ssa_op_iter iter; - use_operand_p use_p; - if (!is_gimple_debug (copy)) - FOR_EACH_SSA_USE_OPERAND (use_p, copy, iter, SSA_OP_USE) - { - tree old_name = USE_FROM_PTR (use_p); - - if (TREE_CODE (old_name) != SSA_NAME - || SSA_NAME_IS_DEFAULT_DEF (old_name)) - continue; - - tree *new_expr = region->parameter_rename_map->get (old_name); - if (!new_expr) - continue; - - replace_exp (use_p, *new_expr); - } - update_stmt (copy); } } diff --git a/gcc/sese.h b/gcc/sese.h index 98ab4911e20..b3d48b9d421 100644 --- a/gcc/sese.h +++ b/gcc/sese.h @@ -22,8 +22,6 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_SESE_H #define GCC_SESE_H -typedef hash_map parameter_rename_map_t; - /* A Single Entry, Single Exit region is a part of the CFG delimited by two edges. */ struct sese_l @@ -61,9 +59,6 @@ typedef struct sese_info_t /* Parameters used within the SCOP. */ vec params; - /* Parameters to be renamed. */ - parameter_rename_map_t *parameter_rename_map; - /* Loops completely contained in this SESE. */ bitmap loops; vec loop_nest; -- 2.30.2