summaryrefslogtreecommitdiff
path: root/gcc/tree-ssanames.c
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-23 00:59:54 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-23 00:59:54 +0000
commit095dcfa3b1e6d64902cdac04c689fbb3cc1274b3 (patch)
tree91adcaea930945439c930df02da120abe55f1ac1 /gcc/tree-ssanames.c
parent53ece644fcadb603f9082900e75161bdbb7c32df (diff)
downloadgcc-095dcfa3b1e6d64902cdac04c689fbb3cc1274b3.tar.gz
2005-04-22 Diego Novillo <dnovillo@redhat.com>
* Makefile.in (tree-into-ssa.o): Add dependency on PARAMS_H. * lambda-code.c (perfect_nestify): Mark virtual operands in the moved statement for renaming. * params.def (PARAM_MIN_VIRTUAL_MAPPINGS): Define. (PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO): Define. * params.h (MIN_VIRTUAL_MAPPINGS): Define. (VIRTUAL_MAPPINGS_TO_SYMS_RATIO): Define. * tree-flow.h (struct var_ann_d): Update comments. (rewrite_to_new_ssa_names_bb, rewrite_to_new_ssa_names, allocate_ssa_names, find_phi_node_for, dump_tree_ssa, debug_tree_ssa, debug_def_blocks, dump_tree_ssa_stats, debug_tree_ssa_stats, rewrite_ssa_into_ssa, dump_repl_tbl, debug_repl_tbl, dump_names_replaced_by, debug_names_replaced_by): Remove declarations. (delete_update_ssa, get_current_def, set_current_def): Declare. (rewrite_into_loop_closed_ssa): Add new argument. Update all callers. * tree-into-ssa.c: Include params.h. (old_virtual_ssa_names): Remove. Update all users. (need_to_replace_names_p): Remove. Update all users. (struct update_ssa_stats_d): Declare. (update_ssa_stats): New local. (dump_tree_ssa, debug_tree_ssa, debug_def_blocks, dump_tree_ssa_stats, debug_tree_ssa_stats, dump_update_ssa, debug_update_ssa, dump_names_replaced_by, debug_names_replaced_by): Declare. (get_current_def, set current_def): Make extern. (is_old_name, is_new_name): Protect against references past the end of the sets. (add_new_name_mapping): Assert that OLD and NEW are different SSA names for the same symbol. When adding a virtual mapping, update stats for virtual mapping heuristic. (insert_phi_nodes_for): If UPDATE_P is true, create the LHS of the new PHI by duplicating SSA name VAR. (insert_phi_nodes_1): Remove. Update all users. (insert_phi_nodes): Remove second argument. Update all users. (maybe_replace_use, maybe_replace_def): New. (rewrite_update_stmt): Call them. (mark_def_interesting): Remove calls to is_gimple_reg. (prepare_phi_args_for_update): Remove. Update all users. (prepare_block_for_update): Only process virtual operands and GIMPLE registers in normal form. (prepare_use_sites_for): New. (prepare_names_to_update): Rename from prepare_def_sites. Call prepare_use_sites_for. (dump_update_ssa): Rename from dump_repl_tbl. Update all users. Show statistics for virtual mapping heuristic. (debug_update_ssa): Rename from debug_debug_repl_tbl. (init_update_ssa): Initialize UPDATE_SSA_STATS. (delete_update_ssa): Make extern. (mark_set_for_renaming): If the set is empty, do nothing. (release_ssa_name_after_update_ssa): Update comment. (insert_updated_phi_nodes_for): Do not remove existing PHI nodes for symbols. (switch_virtuals_to_full_rewrite_p): New. (switch_virtuals_to_full_rewrite): New. (update_ssa): Call them. Clear REWRITE_THIS_STMT and REGISTER_DEFS_IN_THIS_STMT for every statement before updating. If all the names in NEW_SSA_NAMES have been marked for removal, do nothing. Only start at the top of the CFG if there are symbols in SYMS_TO_RENAME. (ssa_rewrite_finalize_block): Remove. (ssa_register_new_def): Remove. (ssa_rewrite_stmt): Remove. (ssa_rewrite_phi_arguments): Remove. (ssa_rewrite_initialize_block): Remove. (ssa_mark_def_sites): Remove. (ssa_mark_def_sites_initialize_block): Remove. (ssa_mark_phi_uses): Remove. (rewrite_ssa_into_ssa): Remove. * tree-phinodes.c (find_phi_node_for): Remove. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Call update_ssa. * tree-ssa-loop-unswitch.c (tree_ssa_unswitch_loops): Remove calls to verify_dominators and verify_loop_structure. (tree_unswitch_single_loop): Call update_ssa. * tree-ssa.c (verify_ssa): Assert that need_ssa_update_p returns false. Call verify_stmts. (delete_tree_ssa): Assert that need_ssa_update_p returns false. * tree-vect-transform.c (vect_transform_loop): Call update_ssa. * tree-vectorizer.c (allocate_new_names, rename_def_op, free_new_names): Remove. Update all users. (rename_use_op): Call get_current_def. (rename_variables_in_bb): Do not handle any real or virtual definition. (slpeel_update_phis_for_duplicate_loop): Call get_current_def and set_current_def instead of using SSA_NAME_AUX. (slpeel_update_phi_nodes_for_guard2): Reformat comments. (slpeel_can_duplicate_loop_p): Call need_ssa_update_p, ssa_names_to_replace and delete_update_ssa. * doc/invoke.texi: Document --param min-virtual-mappings and --param virtual-mappings-ratio. 2005-04-22 Zdenek Dvorak <dvorakz@suse.cz> Diego Novillo <dnovillo@redhat.com> * tree-cfg.c (tree_duplicate_bb): Call create_new_def_for for newly created PHI nodes. Call create_new_def_for for every new V_MAY_DEF and V_MUST_DEF on the copied statement. (struct ssa_name_map_entry): Remove. (ssa_name_map_entry_hash): Remove. (ssa_name_map_entry_eq): Remove. (allocate_ssa_names): Remove. (rewrite_to_new_ssa_names_def): Remove. (rewrite_to_new_ssa_names_use): Remove. (rewrite_to_new_ssa_names_bb): Remove. (rewrite_to_new_ssa_names): Remove. (tree_duplicate_sese_region): Remove variables ver, definitions, phi, ssa_name_map and bi. Call need_ssa_update_p instead of any_marked_for_rewrite_p. Call update_ssa. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Call update_ssa instead of rewrite_ssa_into_ssa. * tree-ssa-loop-manip.c (add_exit_phis_edge): Call create_new_def_for. (find_uses_to_rename_use): Add argument 'need_phis'. (find_uses_to_rename_stmt): Do not scan virtual operands. (find_uses_to_rename): Only scan PHI nodes for non-virtual names. (rewrite_into_loop_closed_ssa): Call update_ssa. (check_loop_closed_ssa_use): Ignore virtual operands. (check_loop_closed_ssa_stmt): Likewise. (verify_loop_closed_ssa): Do nothing if CURRENT_LOOPS is NULL. (rename_variables, set_phi_def_stmts): Remove. (tree_duplicate_loop_to_header_edge): Reformat comment. Remove variables BB, I and DEFINITIONS. Call need_ssa_update_p. Call update_ssa. (lv_adjust_loop_header_phi): Reformat comment. * tree-ssanames.c (ssa_names_to_rewrite): Remove. (marked_for_rewrite_p, any_marked_for_rewrite_p, mark_for_rewrite, unmark_all_for_rewrite, marked_ssa_names): Remove. Update all users. (release_ssa_name): If VAR has been registered for SSA updating, do nothing. * tree-vrp.c (new_ssa_names, old_ssa_names): Remove. (build_assert_expr_for): Call register_new_name_mapping. (insert_range_assertions): Update call to update_ssa. * tree.h (mark_for_rewrite, unmark_all_for_rewrite, marked_for_rewrite_p, any_marked_for_rewrite_p, marked_ssa_names): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98599 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssanames.c')
-rw-r--r--gcc/tree-ssanames.c67
1 files changed, 8 insertions, 59 deletions
diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c
index b0c430b8f96..0f0381f4a98 100644
--- a/gcc/tree-ssanames.c
+++ b/gcc/tree-ssanames.c
@@ -61,9 +61,6 @@ Boston, MA 02111-1307, USA. */
/* Array of all SSA_NAMEs used in the function. */
varray_type ssa_names;
-/* Bitmap of ssa names marked for rewriting. */
-static bitmap ssa_names_to_rewrite;
-
/* Free list of SSA_NAMEs. This list is wiped at the end of each function
after we leave SSA form. */
static GTY (()) tree free_ssanames;
@@ -77,54 +74,6 @@ unsigned int ssa_name_nodes_reused;
unsigned int ssa_name_nodes_created;
#endif
-/* Returns true if ssa name VAR is marked for rewrite. */
-
-bool
-marked_for_rewrite_p (tree var)
-{
- return bitmap_bit_p (ssa_names_to_rewrite, SSA_NAME_VERSION (var));
-}
-
-/* Returns true if any ssa name is marked for rewrite. */
-
-bool
-any_marked_for_rewrite_p (void)
-{
- if (!ssa_names_to_rewrite)
- return false;
-
- return !bitmap_empty_p (ssa_names_to_rewrite);
-}
-
-/* Mark ssa name VAR for rewriting. */
-
-void
-mark_for_rewrite (tree var)
-{
- bitmap_set_bit (ssa_names_to_rewrite, SSA_NAME_VERSION (var));
-}
-
-/* Unmark all ssa names marked for rewrite. */
-
-void
-unmark_all_for_rewrite (void)
-{
- bitmap_clear (ssa_names_to_rewrite);
-}
-
-/* Return the bitmap of ssa names to rewrite. Copy the bitmap,
- so that the optimizers cannot access internals directly */
-
-bitmap
-marked_ssa_names (void)
-{
- bitmap ret = BITMAP_ALLOC (NULL);
-
- bitmap_copy (ret, ssa_names_to_rewrite);
-
- return ret;
-}
-
/* Initialize management of SSA_NAMEs. */
void
@@ -138,7 +87,6 @@ init_ssanames (void)
large. */
VARRAY_PUSH_TREE (ssa_names, NULL_TREE);
free_ssanames = NULL;
- ssa_names_to_rewrite = BITMAP_ALLOC (NULL);
}
/* Finalize management of SSA_NAMEs. */
@@ -146,7 +94,6 @@ init_ssanames (void)
void
fini_ssanames (void)
{
- BITMAP_FREE (ssa_names_to_rewrite);
ggc_free (ssa_names);
ssa_names = NULL;
free_ssanames = NULL;
@@ -237,11 +184,13 @@ release_ssa_name (tree var)
if (var == var_ann (SSA_NAME_VAR (var))->default_def)
return;
- /* If the ssa name is marked for rewriting, it may have multiple definitions,
- but we may happen to remove just one of them. So do not remove the
- ssa name now. */
- if (marked_for_rewrite_p (var))
- return;
+ /* If VAR has been registered for SSA updating, don't remove it.
+ After update_ssa has run, the name will be released. */
+ if (name_registered_for_update_p (var))
+ {
+ release_ssa_name_after_update_ssa (var);
+ return;
+ }
/* release_ssa_name can be called multiple times on a single SSA_NAME.
However, it should only end up on our free list one time. We
@@ -304,7 +253,7 @@ duplicate_ssa_name (tree name, tree stmt)
/* Creates a duplicate of the ptr_info_def at PTR_INFO for use by
- the ssa name NAME. */
+ the SSA name NAME. */
void
duplicate_ssa_name_ptr_info (tree name, struct ptr_info_def *ptr_info)