Commit 9caf90a8 by Kazu Hirata Committed by Kazu Hirata

tree-into-ssa.c (update_ssa): Clean up by shortening the live range of DFS.

	* tree-into-ssa.c (update_ssa): Clean up by shortening the
	live range of DFS.

From-SVN: r99847
parent 221ca267
2005-05-17 Kazu Hirata <kazu@cs.umass.edu>
* tree-into-ssa.c (update_ssa): Clean up by shortening the
live range of DFS.
2005-05-17 Hans-Peter Nilsson <hp@axis.com> 2005-05-17 Hans-Peter Nilsson <hp@axis.com>
* config/cris/cris.md (ncond, ocode, rcond): Remove separate * config/cris/cris.md (ncond, ocode, rcond): Remove separate
......
...@@ -2611,7 +2611,7 @@ switch_virtuals_to_full_rewrite (void) ...@@ -2611,7 +2611,7 @@ switch_virtuals_to_full_rewrite (void)
void void
update_ssa (unsigned update_flags) update_ssa (unsigned update_flags)
{ {
bitmap *dfs, blocks; bitmap blocks;
basic_block bb, start_bb; basic_block bb, start_bb;
bitmap_iterator bi; bitmap_iterator bi;
unsigned i; unsigned i;
...@@ -2646,13 +2646,8 @@ update_ssa (unsigned update_flags) ...@@ -2646,13 +2646,8 @@ update_ssa (unsigned update_flags)
if (insert_phi_p) if (insert_phi_p)
{ {
/* If the caller requested PHI nodes to be added, compute /* If the caller requested PHI nodes to be added, initialize
dominance frontiers and initialize live-in information data live-in information data structures (DEF_BLOCKS). */
structures (DEF_BLOCKS). */
dfs = (bitmap *) xmalloc (last_basic_block * sizeof (bitmap *));
FOR_EACH_BB (bb)
dfs[bb->index] = BITMAP_ALLOC (NULL);
compute_dominance_frontiers (dfs);
/* For each SSA name N, the DEF_BLOCKS table describes where the /* For each SSA name N, the DEF_BLOCKS table describes where the
name is defined, which blocks have PHI nodes for N, and which name is defined, which blocks have PHI nodes for N, and which
...@@ -2663,7 +2658,6 @@ update_ssa (unsigned update_flags) ...@@ -2663,7 +2658,6 @@ update_ssa (unsigned update_flags)
} }
else else
{ {
dfs = NULL;
def_blocks = NULL; def_blocks = NULL;
} }
...@@ -2738,6 +2732,15 @@ update_ssa (unsigned update_flags) ...@@ -2738,6 +2732,15 @@ update_ssa (unsigned update_flags)
and for symbols in SYMS_TO_RENAME. */ and for symbols in SYMS_TO_RENAME. */
if (insert_phi_p) if (insert_phi_p)
{ {
bitmap *dfs;
/* If the caller requested PHI nodes to be added, compute
dominance frontiers. */
dfs = xmalloc (last_basic_block * sizeof (bitmap *));
FOR_EACH_BB (bb)
dfs[bb->index] = BITMAP_ALLOC (NULL);
compute_dominance_frontiers (dfs);
if (sbitmap_first_set_bit (old_ssa_names) >= 0) if (sbitmap_first_set_bit (old_ssa_names) >= 0)
{ {
/* insert_update_phi_nodes_for will call add_new_name_mapping /* insert_update_phi_nodes_for will call add_new_name_mapping
...@@ -2757,6 +2760,10 @@ update_ssa (unsigned update_flags) ...@@ -2757,6 +2760,10 @@ update_ssa (unsigned update_flags)
insert_updated_phi_nodes_for (referenced_var (i), dfs, blocks, insert_updated_phi_nodes_for (referenced_var (i), dfs, blocks,
update_flags); update_flags);
FOR_EACH_BB (bb)
BITMAP_FREE (dfs[bb->index]);
free (dfs);
/* Insertion of PHI nodes may have added blocks to the region. /* Insertion of PHI nodes may have added blocks to the region.
We need to re-compute START_BB to include the newly added We need to re-compute START_BB to include the newly added
blocks. */ blocks. */
...@@ -2813,13 +2820,6 @@ update_ssa (unsigned update_flags) ...@@ -2813,13 +2820,6 @@ update_ssa (unsigned update_flags)
/* Free allocated memory. */ /* Free allocated memory. */
done: done:
if (insert_phi_p)
{
FOR_EACH_BB (bb)
BITMAP_FREE (dfs[bb->index]);
free (dfs);
}
BITMAP_FREE (blocks); BITMAP_FREE (blocks);
delete_update_ssa (); delete_update_ssa ();
......
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