#include "domwalk.h"
#include "ggc.h"
#include "params.h"
+#include "vecprim.h"
/* This file builds the SSA form for a function as described in:
R. Cytron, J. Ferrante, B. Rosen, M. Wegman, and K. Zadeck. Efficiently
associated with the current block. */
static VEC(tree,heap) *block_defs_stack;
-/* Basic block vectors used in this file ought to be allocated in the
- heap. We use pointer vector, because ints can be easily passed by
- value. */
-DEF_VEC_I(int);
-DEF_VEC_ALLOC_I(int,heap);
-
/* Set of existing SSA names being replaced by update_ssa. */
static sbitmap old_ssa_names;
if (!SSA_NAME_AUX (name))
SSA_NAME_AUX (name) = xcalloc (1, sizeof (struct ssa_name_info));
- return SSA_NAME_AUX (name);
+ return (struct ssa_name_info *) SSA_NAME_AUX (name);
}
slot = htab_find_slot (def_blocks, (void *) &db, INSERT);
if (*slot == NULL)
{
- db_p = xmalloc (sizeof (*db_p));
+ db_p = XNEW (struct def_blocks_d);
db_p->var = var;
db_p->def_blocks = BITMAP_ALLOC (NULL);
db_p->phi_blocks = BITMAP_ALLOC (NULL);
slot = htab_find_slot (repl_tbl, (void *) &m, INSERT);
if (*slot == NULL)
{
- mp = xmalloc (sizeof (*mp));
+ mp = XNEW (struct repl_map_d);
mp->name = new;
mp->set = BITMAP_ALLOC (NULL);
*slot = (void *) mp;
WALK_DATA->GLOBAL_DATA->KILLS.
2- If S uses a variable VAR and there is no preceding kill of VAR,
- then it is marked in marked in the LIVEIN_BLOCKS bitmap
- associated with VAR.
+ then it is marked in the LIVEIN_BLOCKS bitmap associated with VAR.
This information is used to determine which variables are live
across block boundaries to reduce the number of PHI nodes
basic_block bb,
block_stmt_iterator bsi)
{
- struct mark_def_sites_global_data *gd = walk_data->global_data;
+ struct mark_def_sites_global_data *gd =
+ (struct mark_def_sites_global_data *) walk_data->global_data;
bitmap kills = gd->kills;
tree stmt, def;
use_operand_p use_p;
static void
def_blocks_free (void *p)
{
- struct def_blocks_d *entry = p;
+ struct def_blocks_d *entry = (struct def_blocks_d *) p;
BITMAP_FREE (entry->def_blocks);
BITMAP_FREE (entry->phi_blocks);
BITMAP_FREE (entry->livein_blocks);
mark_def_sites_initialize_block (struct dom_walk_data *walk_data,
basic_block bb ATTRIBUTE_UNUSED)
{
- struct mark_def_sites_global_data *gd = walk_data->global_data;
+ struct mark_def_sites_global_data *gd =
+ (struct mark_def_sites_global_data *) walk_data->global_data;
bitmap kills = gd->kills;
bitmap_clear (kills);
}
4- Rename all the blocks (rewrite_blocks) and statements in the program.
- Steps 3 and 5 are done using the dominator tree walker
+ Steps 3 and 4 are done using the dominator tree walker
(walk_dominator_tree). */
-static void
+static unsigned int
rewrite_into_ssa (void)
{
bitmap *dfs;
timevar_pop (TV_TREE_SSA_OTHER);
in_ssa_p = true;
+ return 0;
}
PROP_ssa, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_func | TODO_verify_ssa, /* todo_flags_finish */
+ TODO_dump_func
+ | TODO_verify_ssa
+ | TODO_remove_unused_locals, /* todo_flags_finish */
0 /* letter */
};
/* If the caller requested PHI nodes to be added, compute
dominance frontiers. */
- dfs = xmalloc (last_basic_block * sizeof (bitmap));
+ dfs = XNEWVEC (bitmap, last_basic_block);
FOR_EACH_BB (bb)
dfs[bb->index] = BITMAP_ALLOC (NULL);
compute_dominance_frontiers (dfs);