diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-16 13:38:13 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-16 13:38:13 +0000 |
commit | ec415c454f37dbd00b9c58c00bc8a2f47ea44c99 (patch) | |
tree | c4014ffdd31e6929c2b0896e695bc7a7780f9040 /gcc/tree-ssa-dse.c | |
parent | c27baad4400d165080bcd69ea555a2e32785cae6 (diff) | |
download | gcc-ec415c454f37dbd00b9c58c00bc8a2f47ea44c99.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135419 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-dse.c')
-rw-r--r-- | gcc/tree-ssa-dse.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c index a4e507c3224..f6f76d5b7c5 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 |