From cf3791ae4c9d51be572563af5d5cf427d232d5df Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Fri, 27 Jul 2012 12:31:06 +0000 Subject: [PATCH] invoke.texi (min-virtual-mappings, [...]): Remove param documentation. 2012-07-27 Richard Guenther * doc/invoke.texi (min-virtual-mappings, virtual-mappings-ratio): Remove param documentation. * params.def (PARAM_MIN_VIRTUAL_MAPPINGS, PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO): Remove. * tree-flow.h (mark_set_for_renaming): Remove. * tree-into-ssa.c (struct update_ssa_stats_d): Remove. (add_new_name_mapping): Remove bookkeeping code. (dump_update_ssa): Remove stats dumping code. (init_update_ssa): Remove stats allocation code. (delete_update_ssa): Remove stats freeing code. (mark_set_for_renaming): Remove. (switch_virtuals_to_full_rewrite_p): Likewise. (switch_virtuals_to_full_rewrite): Likewise. (update_ssa): Do not call switch_virtuals_to_full_rewrite. From-SVN: r189911 --- gcc/ChangeLog | 17 ++++++ gcc/doc/invoke.texi | 12 ---- gcc/params.def | 24 -------- gcc/tree-flow.h | 1 - gcc/tree-into-ssa.c | 141 -------------------------------------------- 5 files changed, 17 insertions(+), 178 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5e32766579d..4ef15abfedc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2012-07-27 Richard Guenther + + * doc/invoke.texi (min-virtual-mappings, virtual-mappings-ratio): + Remove param documentation. + * params.def (PARAM_MIN_VIRTUAL_MAPPINGS, + PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO): Remove. + * tree-flow.h (mark_set_for_renaming): Remove. + * tree-into-ssa.c (struct update_ssa_stats_d): Remove. + (add_new_name_mapping): Remove bookkeeping code. + (dump_update_ssa): Remove stats dumping code. + (init_update_ssa): Remove stats allocation code. + (delete_update_ssa): Remove stats freeing code. + (mark_set_for_renaming): Remove. + (switch_virtuals_to_full_rewrite_p): Likewise. + (switch_virtuals_to_full_rewrite): Likewise. + (update_ssa): Do not call switch_virtuals_to_full_rewrite. + 2012-07-27 Marek Polacek * cgraphunit.c: Rename varpool_finalize_variable to diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index a5b7f824b11..bdbc2a49ad9 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -9155,18 +9155,6 @@ Small integer constants can use a shared data structure, reducing the compiler's memory usage and increasing its speed. This sets the maximum value of a shared integer constant. The default value is 256. -@item min-virtual-mappings -Specifies the minimum number of virtual mappings in the incremental -SSA updater that should be registered to trigger the virtual mappings -heuristic defined by virtual-mappings-ratio. The default value is -100. - -@item virtual-mappings-ratio -If the number of virtual mappings is virtual-mappings-ratio bigger -than the number of virtual symbols to be updated, then the incremental -SSA updater switches to a full update for those symbols. The default -ratio is 3. - @item ssp-buffer-size The minimum size of buffers (i.e.@: arrays) that receive stack smashing protection when @option{-fstack-protection} is used. diff --git a/gcc/params.def b/gcc/params.def index ad2cf4375bf..efa686061e7 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -644,30 +644,6 @@ DEFPARAM (PARAM_INTEGER_SHARE_LIMIT, "The upper bound for sharing integer constants", 256, 2, 2) -/* Incremental SSA updates for virtual operands may be very slow if - there is a large number of mappings to process. In those cases, it - is faster to rewrite the virtual symbols from scratch as if they - had been recently introduced. This heuristic cannot be applied to - SSA mappings for real SSA names, only symbols kept in FUD chains. - - PARAM_MIN_VIRTUAL_MAPPINGS specifies the minimum number of virtual - mappings that should be registered to trigger the heuristic. - - PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO specifies the ratio between - mappings and symbols. If the number of virtual mappings is - PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO bigger than the number of - virtual symbols to be updated, then the updater switches to a full - update for those symbols. */ -DEFPARAM (PARAM_MIN_VIRTUAL_MAPPINGS, - "min-virtual-mappings", - "Minimum number of virtual mappings to consider switching to full virtual renames", - 100, 0, 0) - -DEFPARAM (PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO, - "virtual-mappings-ratio", - "Ratio between virtual mappings and virtual symbols to do full virtual renames", - 3, 0, 0) - DEFPARAM (PARAM_SSP_BUFFER_SIZE, "ssp-buffer-size", "The lower bound for a buffer to be considered for stack smashing protection", diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index 9ed6c0c7bcb..75f91871cf0 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -575,7 +575,6 @@ bool name_registered_for_update_p (tree); void release_ssa_name_after_update_ssa (tree); void compute_global_livein (bitmap, bitmap); void mark_sym_for_renaming (tree); -void mark_set_for_renaming (bitmap); bool symbol_marked_for_renaming (tree); tree get_current_def (tree); void set_current_def (tree, tree); diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c index 113003822bd..335d9c0ad82 100644 --- a/gcc/tree-into-ssa.c +++ b/gcc/tree-into-ssa.c @@ -140,21 +140,6 @@ static htab_t repl_tbl; NULL if they need to be initialized by register_new_name_mapping. */ static struct function *update_ssa_initialized_fn = NULL; -/* Statistics kept by update_ssa to use in the virtual mapping - heuristic. If the number of virtual mappings is beyond certain - threshold, the updater will switch from using the mappings into - renaming the virtual symbols from scratch. In some cases, the - large number of name mappings for virtual names causes significant - slowdowns in the PHI insertion code. */ -struct update_ssa_stats_d -{ - unsigned num_virtual_mappings; - unsigned num_total_mappings; - bitmap virtual_symbols; - unsigned num_virtual_symbols; -}; -static struct update_ssa_stats_d update_ssa_stats; - /* Global data to attach to the main dominator walk structure. */ struct mark_def_sites_global_data { @@ -662,26 +647,6 @@ add_new_name_mapping (tree new_tree, tree old) /* OLD and NEW_TREE must be different SSA names for the same symbol. */ gcc_assert (new_tree != old && SSA_NAME_VAR (new_tree) == SSA_NAME_VAR (old)); - /* If this mapping is for virtual names, we will need to update - virtual operands. If this is a mapping for .MEM, then we gather - the symbols associated with each name. */ - if (!is_gimple_reg (new_tree)) - { - tree sym; - - update_ssa_stats.num_virtual_mappings++; - update_ssa_stats.num_virtual_symbols++; - - /* Keep counts of virtual mappings and symbols to use in the - virtual mapping heuristic. If we have large numbers of - virtual mappings for a relatively low number of symbols, it - will make more sense to rename the symbols from scratch. - Otherwise, the insertion of PHI nodes for each of the old - names in these mappings will be very slow. */ - sym = SSA_NAME_VAR (new_tree); - bitmap_set_bit (update_ssa_stats.virtual_symbols, DECL_UID (sym)); - } - /* We may need to grow NEW_SSA_NAMES and OLD_SSA_NAMES because our caller may have created new names since the set was created. */ if (new_ssa_names->n_bits <= num_ssa_names - 1) @@ -704,9 +669,6 @@ add_new_name_mapping (tree new_tree, tree old) SET_BIT (new_ssa_names, SSA_NAME_VERSION (new_tree)); SET_BIT (old_ssa_names, SSA_NAME_VERSION (old)); - /* Update mapping counter to use in the virtual mapping heuristic. */ - update_ssa_stats.num_total_mappings++; - timevar_pop (TV_TREE_SSA_INCREMENTAL); } @@ -2827,18 +2789,6 @@ dump_update_ssa (FILE *file) EXECUTE_IF_SET_IN_SBITMAP (new_ssa_names, 0, i, sbi) dump_names_replaced_by (file, ssa_name (i)); - - fprintf (file, "\n"); - fprintf (file, "Number of virtual NEW -> OLD mappings: %7u\n", - update_ssa_stats.num_virtual_mappings); - fprintf (file, "Number of real NEW -> OLD mappings: %7u\n", - update_ssa_stats.num_total_mappings - - update_ssa_stats.num_virtual_mappings); - fprintf (file, "Number of total NEW -> OLD mappings: %7u\n", - update_ssa_stats.num_total_mappings); - - fprintf (file, "\nNumber of virtual symbols: %u\n", - update_ssa_stats.num_virtual_symbols); } if (!bitmap_empty_p (SYMS_TO_RENAME (cfun))) @@ -2886,8 +2836,6 @@ init_update_ssa (struct function *fn) repl_tbl = htab_create (20, repl_map_hash, repl_map_eq, repl_map_free); names_to_release = NULL; - memset (&update_ssa_stats, 0, sizeof (update_ssa_stats)); - update_ssa_stats.virtual_symbols = BITMAP_ALLOC (NULL); update_ssa_initialized_fn = fn; } @@ -2910,7 +2858,6 @@ delete_update_ssa (void) repl_tbl = NULL; bitmap_clear (SYMS_TO_RENAME (update_ssa_initialized_fn)); - BITMAP_FREE (update_ssa_stats.virtual_symbols); if (names_to_release) { @@ -2994,22 +2941,6 @@ mark_sym_for_renaming (tree sym) } -/* Register all the symbols in SET to be renamed by update_ssa. */ - -void -mark_set_for_renaming (bitmap set) -{ - bitmap_iterator bi; - unsigned i; - - if (set == NULL || bitmap_empty_p (set)) - return; - - EXECUTE_IF_SET_IN_BITMAP (set, 0, i, bi) - mark_sym_for_renaming (referenced_var (i)); -} - - /* Return true if there is any work to be done by update_ssa for function FN. */ @@ -3171,73 +3102,6 @@ insert_updated_phi_nodes_for (tree var, bitmap_head *dfs, bitmap blocks, } -/* Heuristic to determine whether SSA name mappings for virtual names - should be discarded and their symbols rewritten from scratch. When - there is a large number of mappings for virtual names, the - insertion of PHI nodes for the old names in the mappings takes - considerable more time than if we inserted PHI nodes for the - symbols instead. - - Currently the heuristic takes these stats into account: - - - Number of mappings for virtual SSA names. - - Number of distinct virtual symbols involved in those mappings. - - If the number of virtual mappings is much larger than the number of - virtual symbols, then it will be faster to compute PHI insertion - spots for the symbols. Even if this involves traversing the whole - CFG, which is what happens when symbols are renamed from scratch. */ - -static bool -switch_virtuals_to_full_rewrite_p (void) -{ - if (update_ssa_stats.num_virtual_mappings < (unsigned) MIN_VIRTUAL_MAPPINGS) - return false; - - if (update_ssa_stats.num_virtual_mappings - > (unsigned) VIRTUAL_MAPPINGS_TO_SYMS_RATIO - * update_ssa_stats.num_virtual_symbols) - return true; - - return false; -} - - -/* Remove every virtual mapping and mark all the affected virtual - symbols for renaming. */ - -static void -switch_virtuals_to_full_rewrite (void) -{ - unsigned i = 0; - sbitmap_iterator sbi; - - if (dump_file) - { - fprintf (dump_file, "\nEnabled virtual name mapping heuristic.\n"); - fprintf (dump_file, "\tNumber of virtual mappings: %7u\n", - update_ssa_stats.num_virtual_mappings); - fprintf (dump_file, "\tNumber of unique virtual symbols: %7u\n", - update_ssa_stats.num_virtual_symbols); - fprintf (dump_file, "Updating FUD-chains from top of CFG will be " - "faster than processing\nthe name mappings.\n\n"); - } - - /* Remove all virtual names from NEW_SSA_NAMES and OLD_SSA_NAMES. - Note that it is not really necessary to remove the mappings from - REPL_TBL, that would only waste time. */ - EXECUTE_IF_SET_IN_SBITMAP (new_ssa_names, 0, i, sbi) - if (!is_gimple_reg (ssa_name (i))) - RESET_BIT (new_ssa_names, i); - - EXECUTE_IF_SET_IN_SBITMAP (old_ssa_names, 0, i, sbi) - if (!is_gimple_reg (ssa_name (i))) - RESET_BIT (old_ssa_names, i); - - mark_set_for_renaming (update_ssa_stats.virtual_symbols); -} - - /* Given a set of newly created SSA names (NEW_SSA_NAMES) and a set of existing SSA names (OLD_SSA_NAMES), update the SSA form so that: @@ -3366,11 +3230,6 @@ update_ssa (unsigned update_flags) def_blocks = NULL; } - /* Heuristic to avoid massive slow downs when the replacement - mappings include lots of virtual names. */ - if (insert_phi_p && switch_virtuals_to_full_rewrite_p ()) - switch_virtuals_to_full_rewrite (); - /* If there are names defined in the replacement table, prepare definition and use sites for all the names in NEW_SSA_NAMES and OLD_SSA_NAMES. */ -- 2.30.2