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 <s.pop@samsung.com>
From-SVN: r229783
+2015-11-04 Aditya Kumar <aditya.k7@samsung.com>
+ Sebastian Pop <s.pop@samsung.com>
+
+ * 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 <aditya.k7@samsung.com>
Sebastian Pop <s.pop@samsung.com>
"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
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.
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);
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;
SESE_PARAMS (region).release ();
SESE_LOOP_NEST (region).release ();
- delete region->parameter_rename_map;
- region->parameter_rename_map = NULL;
XDELETE (region);
}
/* 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)
{
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
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;
&& 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);
{
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,
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);
}
}
#ifndef GCC_SESE_H
#define GCC_SESE_H
-typedef hash_map<tree, tree> parameter_rename_map_t;
-
/* A Single Entry, Single Exit region is a part of the CFG delimited
by two edges. */
struct sese_l
/* Parameters used within the SCOP. */
vec<tree> params;
- /* Parameters to be renamed. */
- parameter_rename_map_t *parameter_rename_map;
-
/* Loops completely contained in this SESE. */
bitmap loops;
vec<loop_p> loop_nest;