struct mark_def_sites_global_data mark_def_sites_global_data;
/* Allocate memory for the DEF_BLOCKS hash table. */
- def_blocks = htab_create (VARRAY_ACTIVE_SIZE (referenced_vars),
+ def_blocks = htab_create (VEC_length (tree, referenced_vars),
def_blocks_hash, def_blocks_eq, def_blocks_free);
for (i = 0; i < num_referenced_vars; i++)
sbitmap_zero (interesting_blocks);
/* Initialize dominance frontier. */
- dfs = (bitmap *) xmalloc (last_basic_block * sizeof (bitmap *));
+ dfs = (bitmap *) xmalloc (last_basic_block * sizeof (bitmap));
FOR_EACH_BB (bb)
dfs[bb->index] = BITMAP_ALLOC (NULL);
void
update_ssa (unsigned update_flags)
{
- bitmap *dfs, blocks;
+ bitmap blocks;
basic_block bb, start_bb;
bitmap_iterator bi;
unsigned i;
if (insert_phi_p)
{
- /* If the caller requested PHI nodes to be added, compute
- dominance frontiers and initialize live-in information data
- 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);
+ /* If the caller requested PHI nodes to be added, initialize
+ live-in information data structures (DEF_BLOCKS). */
/* For each SSA name N, the DEF_BLOCKS table describes where the
name is defined, which blocks have PHI nodes for N, and which
}
else
{
- dfs = NULL;
def_blocks = NULL;
}
and for symbols in SYMS_TO_RENAME. */
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)
{
/* insert_update_phi_nodes_for will call add_new_name_mapping
insert_updated_phi_nodes_for (referenced_var (i), dfs, blocks,
update_flags);
+ FOR_EACH_BB (bb)
+ BITMAP_FREE (dfs[bb->index]);
+ free (dfs);
+
/* Insertion of PHI nodes may have added blocks to the region.
We need to re-compute START_BB to include the newly added
blocks. */
/* Free allocated memory. */
done:
- if (insert_phi_p)
- {
- FOR_EACH_BB (bb)
- BITMAP_FREE (dfs[bb->index]);
- free (dfs);
- }
-
BITMAP_FREE (blocks);
delete_update_ssa ();