aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dse.c
diff options
context:
space:
mode:
authorKenneth Zadeck <zadeck@naturalbridge.com>2008-05-16 09:38:13 -0400
committerDiego Novillo <dnovillo@gcc.gnu.org>2008-05-16 09:38:13 -0400
commit908ff6a3eba98c61f299483ba60011f7bec26e34 (patch)
treec4014ffdd31e6929c2b0896e695bc7a7780f9040 /gcc/tree-ssa-dse.c
parent9defb1fe37d0ff78a3a8f4729e4f51a957ec902e (diff)
downloadgcc-908ff6a3eba98c61f299483ba60011f7bec26e34.zip
gcc-908ff6a3eba98c61f299483ba60011f7bec26e34.tar.gz
gcc-908ff6a3eba98c61f299483ba60011f7bec26e34.tar.bz2
tree-ssa-dse (max_stmt_uid): Removed.
2008-05-16 Kenneth Zadeck <zadeck@naturalbridge.com> * tree-ssa-dse (max_stmt_uid): Removed. (get_stmt_uid, dse_possible_dead_store_p, dse_optimize_stmt, tree_ssa_dse): Encapsulate all uses of stmt_ann->uid. * tree-ssa-sccvn.c (compare_ops, init_scc_vn): Ditto. * function.h (cfun.last_stmt_uid): New field. * tree-flow-inline.h (set_gimple_stmt_uid, gimple_stmt_uid, gimple_stmt_max_uid, set_gimple_stmt_max_uid, inc_gimple_stmt_max_uid): New functions. * tree-dfa.c (renumber_gimple_stmt_uids): New function. (create_stmt_ann): Initialize the ann->uid field. * tree-ssa-pre.c (compute_avail): Encapsulate the stmt_ann->uid with new calls. * tree-flow.h (renumber_gimple_stmt_uids): New function. From-SVN: r135419
Diffstat (limited to 'gcc/tree-ssa-dse.c')
-rw-r--r--gcc/tree-ssa-dse.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index a4e507c..f6f76d5 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -101,19 +101,15 @@ static void dse_record_phis (struct dom_walk_data *, basic_block);
static void dse_finalize_block (struct dom_walk_data *, basic_block);
static void record_voperand_set (bitmap, bitmap *, unsigned int);
-static unsigned max_stmt_uid; /* Maximal uid of a statement. Uids to phi
- nodes are assigned using the versions of
- ssa names they define. */
-
/* Returns uid of statement STMT. */
static unsigned
get_stmt_uid (tree stmt)
{
if (TREE_CODE (stmt) == PHI_NODE)
- return SSA_NAME_VERSION (PHI_RESULT (stmt)) + max_stmt_uid;
+ return SSA_NAME_VERSION (PHI_RESULT (stmt)) + gimple_stmt_max_uid (cfun);
- return stmt_ann (stmt)->uid;
+ return gimple_stmt_uid (stmt);
}
/* Set bit UID in bitmaps GLOBAL and *LOCAL, creating *LOCAL as needed. */
@@ -288,7 +284,6 @@ dse_possible_dead_store_p (tree stmt,
vuse_vec_p vv;
tree defvar = NULL_TREE, temp;
tree prev_defvar = NULL_TREE;
- stmt_ann_t ann = stmt_ann (stmt);
/* We want to verify that each virtual definition in STMT has
precisely one use and that all the virtual definitions are
@@ -364,7 +359,7 @@ dse_possible_dead_store_p (tree stmt,
if (fail)
{
- record_voperand_set (dse_gd->stores, &bd->stores, ann->uid);
+ record_voperand_set (dse_gd->stores, &bd->stores, gimple_stmt_uid (stmt));
return false;
}
@@ -435,7 +430,7 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
memory location. */
if (!get_kill_of_stmt_lhs (stmt, &first_use_p, &use_p, &use_stmt))
{
- record_voperand_set (dse_gd->stores, &bd->stores, ann->uid);
+ record_voperand_set (dse_gd->stores, &bd->stores, gimple_stmt_uid (stmt));
return;
}
}
@@ -505,7 +500,7 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
release_defs (stmt);
}
- record_voperand_set (dse_gd->stores, &bd->stores, ann->uid);
+ record_voperand_set (dse_gd->stores, &bd->stores, gimple_stmt_uid (stmt));
}
}
@@ -556,18 +551,8 @@ tree_ssa_dse (void)
{
struct dom_walk_data walk_data;
struct dse_global_data dse_gd;
- basic_block bb;
- /* Create a UID for each statement in the function. Ordering of the
- UIDs is not important for this pass. */
- max_stmt_uid = 0;
- FOR_EACH_BB (bb)
- {
- block_stmt_iterator bsi;
-
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- stmt_ann (bsi_stmt (bsi))->uid = max_stmt_uid++;
- }
+ renumber_gimple_stmt_uids ();
/* We might consider making this a property of each pass so that it
can be [re]computed on an as-needed basis. Particularly since