diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-21 03:19:00 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-21 03:19:00 +0000 |
commit | fa0f49c62cf2c54c57fcc8656af7f48d53858ca4 (patch) | |
tree | d63342eb84f672e7ec05ab0664ccacf61232ea1a /gcc/tree-ssanames.c | |
parent | 00d26680769da5f526f907c518e2c836541e0ffd (diff) | |
download | gcc-fa0f49c62cf2c54c57fcc8656af7f48d53858ca4.tar.gz |
* tree-ssanames.c (make_ssa_name): No longer need to clear, then
initialize key elements here.
(release_ssa_name): Zero the released SSA_NAME here.
* tree.h (SSA_NAME_EQUIV, SET_SSA_NAME_EQUIV): New macros.
(struct tree_ssa_name): Add new "equiv" field.
* tree-ssa-dom.c (const_and_copies): Kill the global varray.
(tree_ssa_dominator_optimize): No longer allocate, resize or
clear CONST_AND_COPIES.
(get_value_for, set_value_for): Kill.
(thread_across_edge): Get/set the equivalency using
SSA_NAME_EQUIV and SET_SSA_NAME_EQUIV.
(restore_vars_to_original_value): Likewise.
(record_equivalences_from_phis): Likewise.
(record_dominating_conditions): Likewise.
(record_const_or_copy, record_equality): Likewise.
(lookup_avail_expr): Likewise.
(record_equivalences_from_stmt, cprop_operand): Likewise.
(cprop_into_successor_phis): No longer need to pass around
CONST_AND_COPIES. Callers updated. Get equivalences via
SSA_NAME_EQUIV.
(cprop_into_phis): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87787 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssanames.c')
-rw-r--r-- | gcc/tree-ssanames.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c index cc12f28d7d4..0d8ccf81b16 100644 --- a/gcc/tree-ssanames.c +++ b/gcc/tree-ssanames.c @@ -186,27 +186,19 @@ make_ssa_name (tree var, tree stmt) gcc_assert (!stmt || EXPR_P (stmt) || TREE_CODE (stmt) == PHI_NODE); - /* If our free list has an element, then use it. Also reuse the - SSA version number of the element on the free list which helps - keep sbitmaps and arrays sized HIGHEST_SSA_VERSION smaller. */ + /* If our free list has an element, then use it. */ if (free_ssanames) { - unsigned int save_version; - t = free_ssanames; free_ssanames = TREE_CHAIN (free_ssanames); #ifdef GATHER_STATISTICS ssa_name_nodes_reused++; #endif - /* Clear the node so that it looks just like one we would have - received from make_node. */ - save_version = SSA_NAME_VERSION (t); - memset (t, 0, tree_size (t)); - TREE_SET_CODE (t, SSA_NAME); - SSA_NAME_VERSION (t) = save_version; - gcc_assert (ssa_name (save_version) == NULL); - VARRAY_TREE (ssa_names, save_version) = t; + /* The node was cleared out when we put it on the free list, so + there is no need to do so again here. */ + gcc_assert (ssa_name (SSA_NAME_VERSION (t)) == NULL); + VARRAY_TREE (ssa_names, SSA_NAME_VERSION (t)) = t; } else { @@ -262,8 +254,27 @@ release_ssa_name (tree var) defining statement. */ if (! SSA_NAME_IN_FREE_LIST (var)) { + tree saved_ssa_name_var = SSA_NAME_VAR (var); + int saved_ssa_name_version = SSA_NAME_VERSION (var); + VARRAY_TREE (ssa_names, SSA_NAME_VERSION (var)) = NULL; + memset (var, 0, tree_size (var)); + + /* First put back the right tree node so that the tree checking + macros do not complain. */ + TREE_SET_CODE (var, SSA_NAME); + + /* Restore the version number. */ + SSA_NAME_VERSION (var) = saved_ssa_name_version; + + /* Hopefully this can go away once we have the new incremental + SSA updating code installed. */ + SSA_NAME_VAR (var) = saved_ssa_name_var; + + /* Note this SSA_NAME is now in the first list. */ SSA_NAME_IN_FREE_LIST (var) = 1; + + /* And finally link it into the free list. */ TREE_CHAIN (var) = free_ssanames; free_ssanames = var; } |