@@ -101,12 +101,7 @@ static sbitmap interesting_blocks;
released after we finish updating the SSA web. */
bitmap names_to_release;
-/* vec of vec of PHIs to rewrite in a basic block. Element I corresponds
- the to basic block with index I. Allocated once per compilation, *not*
- released between different functions. */
-static vec< vec<gphi *> > phis_to_rewrite;
-
-/* The bitmap of non-NULL elements of PHIS_TO_REWRITE. */
+/* The bitmap of blocks with PHIs to rewrite. */
static bitmap blocks_with_phis_to_rewrite;
/* Growth factor for NEW_SSA_NAMES and OLD_SSA_NAMES. These sets need
@@ -942,9 +937,6 @@ find_def_blocks_for (tree var)
static void
mark_phi_for_rewrite (basic_block bb, gphi *phi)
{
- vec<gphi *> phis;
- unsigned n, idx = bb->index;
-
if (rewrite_uses_p (phi))
return;
@@ -953,21 +945,7 @@ mark_phi_for_rewrite (basic_block bb, gphi *phi)
if (!blocks_with_phis_to_rewrite)
return;
- if (bitmap_set_bit (blocks_with_phis_to_rewrite, idx))
- {
- n = (unsigned) last_basic_block_for_fn (cfun) + 1;
- if (phis_to_rewrite.length () < n)
- phis_to_rewrite.safe_grow_cleared (n, true);
-
- phis = phis_to_rewrite[idx];
- gcc_assert (!phis.exists ());
- phis.create (10);
- }
- else
- phis = phis_to_rewrite[idx];
-
- phis.safe_push (phi);
- phis_to_rewrite[idx] = phis;
+ bitmap_set_bit (blocks_with_phis_to_rewrite, bb->index);
}
/* Insert PHI nodes for variable VAR using the iterated dominance
@@ -2097,18 +2075,17 @@ rewrite_update_phi_arguments (basic_block bb)
FOR_EACH_EDGE (e, ei, bb->succs)
{
- vec<gphi *> phis;
-
if (!bitmap_bit_p (blocks_with_phis_to_rewrite, e->dest->index))
continue;
- phis = phis_to_rewrite[e->dest->index];
- for (gphi *phi : phis)
+ for (auto gsi = gsi_start_phis (e->dest);
+ !gsi_end_p (gsi); gsi_next(&gsi))
{
tree arg, lhs_sym, reaching_def = NULL;
use_operand_p arg_p;
-
- gcc_checking_assert (rewrite_uses_p (phi));
+ gphi *phi = *gsi;
+ if (!rewrite_uses_p (*gsi))
+ continue;
arg_p = PHI_ARG_DEF_PTR_FROM_EDGE (phi, e);
arg = USE_FROM_PTR (arg_p);
@@ -3060,10 +3037,6 @@ delete_update_ssa (void)
fini_ssa_renamer ();
- if (blocks_with_phis_to_rewrite)
- EXECUTE_IF_SET_IN_BITMAP (blocks_with_phis_to_rewrite, 0, i, bi)
- phis_to_rewrite[i].release ();
-
BITMAP_FREE (blocks_with_phis_to_rewrite);
BITMAP_FREE (blocks_to_update);
@@ -3470,8 +3443,7 @@ update_ssa (unsigned update_flags)
gcc_assert (update_ssa_initialized_fn == cfun);
blocks_with_phis_to_rewrite = BITMAP_ALLOC (NULL);
- if (!phis_to_rewrite.exists ())
- phis_to_rewrite.create (last_basic_block_for_fn (cfun) + 1);
+ bitmap_tree_view (blocks_with_phis_to_rewrite);
blocks_to_update = BITMAP_ALLOC (NULL);
insert_phi_p = (update_flags != TODO_update_ssa_no_phi);