Commit 7df5a591 by Kazu Hirata Committed by Kazu Hirata

tree-ssa-live.c (build_tree_conflict_graph): Allocate partition_link and tpa_nodes on heap.

	* tree-ssa-live.c (build_tree_conflict_graph): Allocate
	partition_link and tpa_nodes on heap.

From-SVN: r98617
parent d0b06ef9
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
heap as an argument. Update uses of stack. heap as an argument. Update uses of stack.
(calculate_live_on_entry): Allocate stack on heap. (calculate_live_on_entry): Allocate stack on heap.
* tree-ssa-live.c (build_tree_conflict_graph): Allocate
partition_link and tpa_nodes on heap.
2005-04-23 Mike Stump <mrs@apple.com> 2005-04-23 Mike Stump <mrs@apple.com>
* config/darwin.c (machopic_indirection_name): Don't use * config/darwin.c (machopic_indirection_name): Don't use
......
...@@ -1293,7 +1293,8 @@ build_tree_conflict_graph (tree_live_info_p liveinfo, tpa_p tpa, ...@@ -1293,7 +1293,8 @@ build_tree_conflict_graph (tree_live_info_p liveinfo, tpa_p tpa,
bitmap live; bitmap live;
unsigned x, y, i; unsigned x, y, i;
basic_block bb; basic_block bb;
varray_type partition_link, tpa_to_clear, tpa_nodes; varray_type tpa_to_clear;
int *partition_link, *tpa_nodes;
unsigned l; unsigned l;
ssa_op_iter iter; ssa_op_iter iter;
bitmap_iterator bi; bitmap_iterator bi;
...@@ -1306,8 +1307,8 @@ build_tree_conflict_graph (tree_live_info_p liveinfo, tpa_p tpa, ...@@ -1306,8 +1307,8 @@ build_tree_conflict_graph (tree_live_info_p liveinfo, tpa_p tpa,
live = BITMAP_ALLOC (NULL); live = BITMAP_ALLOC (NULL);
VARRAY_INT_INIT (partition_link, num_var_partitions (map) + 1, "part_link"); partition_link = xcalloc (num_var_partitions (map) + 1, sizeof (int));
VARRAY_INT_INIT (tpa_nodes, tpa_num_trees (tpa), "tpa nodes"); tpa_nodes = xcalloc (tpa_num_trees (tpa), sizeof (int));
VARRAY_INT_INIT (tpa_to_clear, 50, "tpa to clear"); VARRAY_INT_INIT (tpa_to_clear, 50, "tpa to clear");
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
...@@ -1414,26 +1415,28 @@ build_tree_conflict_graph (tree_live_info_p liveinfo, tpa_p tpa, ...@@ -1414,26 +1415,28 @@ build_tree_conflict_graph (tree_live_info_p liveinfo, tpa_p tpa,
i = tpa_find_tree (tpa, x); i = tpa_find_tree (tpa, x);
if (i != (unsigned)TPA_NONE) if (i != (unsigned)TPA_NONE)
{ {
int start = VARRAY_INT (tpa_nodes, i); int start = tpa_nodes[i];
/* If start is 0, a new root reference list is being started. /* If start is 0, a new root reference list is being started.
Register it to be cleared. */ Register it to be cleared. */
if (!start) if (!start)
VARRAY_PUSH_INT (tpa_to_clear, i); VARRAY_PUSH_INT (tpa_to_clear, i);
/* Add interferences to other tpa members seen. */ /* Add interferences to other tpa members seen. */
for (y = start; y != 0; y = VARRAY_INT (partition_link, y)) for (y = start; y != 0; y = partition_link[y])
conflict_graph_add (graph, x, y - 1); conflict_graph_add (graph, x, y - 1);
VARRAY_INT (tpa_nodes, i) = x + 1; tpa_nodes[i] = x + 1;
VARRAY_INT (partition_link, x + 1) = start; partition_link[x + 1] = start;
} }
} }
/* Now clear the used tpa root references. */ /* Now clear the used tpa root references. */
for (l = 0; l < VARRAY_ACTIVE_SIZE (tpa_to_clear); l++) for (l = 0; l < VARRAY_ACTIVE_SIZE (tpa_to_clear); l++)
VARRAY_INT (tpa_nodes, VARRAY_INT (tpa_to_clear, l)) = 0; tpa_nodes[VARRAY_INT (tpa_to_clear, l)] = 0;
VARRAY_POP_ALL (tpa_to_clear); VARRAY_POP_ALL (tpa_to_clear);
} }
free (tpa_nodes);
free (partition_link);
BITMAP_FREE (live); BITMAP_FREE (live);
return graph; return graph;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment