summaryrefslogtreecommitdiff
path: root/gcc/tree-ssanames.c
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-10 22:37:05 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-10 22:37:05 +0000
commitc211d99868b9ae23bcd10d9bf1820af33c0ebe7e (patch)
treef3e7c5ed70989e5440f3ec4150aca5517dd053b3 /gcc/tree-ssanames.c
parenta3823e4755a6ed38f7a968db1865df9bb0e754e2 (diff)
downloadgcc-c211d99868b9ae23bcd10d9bf1820af33c0ebe7e.tar.gz
* Makefile.in (tree-ssanames.o): Depend on TREE_FLOW_H.
* tree-flow.h (ssa_names, num_ssa_names, ssa_name): Declare. (highest_ssa_version): Remove. * tree-outof-ssa.c (new_temp_expr_table): Replace highest_ssa_version with num_ssa_names. (dump_replaceable_exprs): Likewise. (rewrite_vars_out_of_ssa): Likewise. * tree-ssa-ccp.c (initialize): Likewise * tree-ssa-copyrename.c (rename_ssa_copies): Likewise. * tree-ssa-dce.c (tree_dce_init): Likewise. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise. * tree-ssa-live.c (create_ssa_var_map): Likewise. (dump_var_map): Likewise. * tree-ssa.c (verify_ssa): Likewise. (kill_redundant_phi_nodes): Likewise. Do not build a local array of SSA_NAMEs. Use the ssa_names table. * tree-ssanames.c: Include tree-flow.h (ssa_names): New varray. (init_ssa_names): Initialize ssa_names. Reserve the first slot of the ssa_names table. (make_ssa_name): Push the newly created SSA_NAME into ssa_names. Assign version numbers using num_ssa_names. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82950 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssanames.c')
-rw-r--r--gcc/tree-ssanames.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c
index 1142492430e..6a0fda6006f 100644
--- a/gcc/tree-ssanames.c
+++ b/gcc/tree-ssanames.c
@@ -25,6 +25,7 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "varray.h"
#include "ggc.h"
+#include "tree-flow.h"
/* Rewriting a function into SSA form can create a huge number of SSA_NAMEs,
many of which may be thrown away shortly after their creation if jumps
@@ -57,8 +58,8 @@ Boston, MA 02111-1307, USA. */
a very well defined lifetime. If someone wants to experiment with that
this is the place to try it. */
-/* Next SSA version number to be allocated. */
-unsigned int highest_ssa_version;
+/* Array of all SSA_NAMEs used in the function. */
+varray_type ssa_names;
/* Free list of SSA_NAMEs. This list is wiped at the end of each function
after we leave SSA form. */
@@ -78,7 +79,13 @@ unsigned int ssa_name_nodes_created;
void
init_ssanames (void)
{
- highest_ssa_version = UNUSED_NAME_VERSION + 1;
+ VARRAY_TREE_INIT (ssa_names, 50, "ssa_names table");
+
+ /* Version 0 is special, so reserve the first slot in the table. Though
+ currently unused, we may use version 0 in alias analysis as part of
+ the heuristics used to group aliases when the alias sets are too
+ large. */
+ VARRAY_PUSH_TREE (ssa_names, NULL_TREE);
free_ssanames = NULL;
}
@@ -142,7 +149,8 @@ make_ssa_name (tree var, tree stmt)
else
{
t = make_node (SSA_NAME);
- SSA_NAME_VERSION (t) = highest_ssa_version++;
+ SSA_NAME_VERSION (t) = num_ssa_names;
+ VARRAY_PUSH_TREE (ssa_names, t);
#ifdef GATHER_STATISTICS
ssa_name_nodes_created++;
#endif
@@ -151,10 +159,12 @@ make_ssa_name (tree var, tree stmt)
TREE_TYPE (t) = TREE_TYPE (var);
SSA_NAME_VAR (t) = var;
SSA_NAME_DEF_STMT (t) = stmt;
+ SSA_NAME_PTR_INFO (t) = NULL;
return t;
}
+
/* We no longer need the SSA_NAME expression VAR, release it so that
it may be reused.