aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssanames.c
diff options
context:
space:
mode:
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 1142492..6a0fda6 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.