diff options
author | Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> | 2002-05-16 10:34:53 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-05-16 10:34:53 -0700 |
commit | 355e4ec44580fbe7c605e726afee6e2eba03f905 (patch) | |
tree | 47d672ee2344eb156d43b4e6fc935c02ed904ce7 /gcc/regrename.c | |
parent | 5a566bed2b7e0133247fa9fb3282116a8405dd3f (diff) | |
download | gcc-355e4ec44580fbe7c605e726afee6e2eba03f905.zip gcc-355e4ec44580fbe7c605e726afee6e2eba03f905.tar.gz gcc-355e4ec44580fbe7c605e726afee6e2eba03f905.tar.bz2 |
Basic block renumbering removal.
From-SVN: r53522
Diffstat (limited to 'gcc/regrename.c')
-rw-r--r-- | gcc/regrename.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/gcc/regrename.c b/gcc/regrename.c index 4297da7..421a7bb5 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -201,7 +201,7 @@ regrename_optimize () { int tick[FIRST_PSEUDO_REGISTER]; int this_tick = 0; - int b; + basic_block bb; char *first_obj; memset (tick, 0, sizeof tick); @@ -209,9 +209,8 @@ regrename_optimize () gcc_obstack_init (&rename_obstack); first_obj = (char *) obstack_alloc (&rename_obstack, 0); - for (b = 0; b < n_basic_blocks; b++) + FOR_ALL_BB (bb) { - basic_block bb = BASIC_BLOCK (b); struct du_chain *all_chains = 0; HARD_REG_SET unavailable; HARD_REG_SET regs_seen; @@ -219,7 +218,7 @@ regrename_optimize () CLEAR_HARD_REG_SET (unavailable); if (rtl_dump_file) - fprintf (rtl_dump_file, "\nBasic block %d:\n", b); + fprintf (rtl_dump_file, "\nBasic block %d:\n", bb->sindex); all_chains = build_def_use (bb); @@ -1726,30 +1725,30 @@ copyprop_hardreg_forward () { struct value_data *all_vd; bool need_refresh; - int b; + basic_block bb, bbp; need_refresh = false; - all_vd = xmalloc (sizeof (struct value_data) * n_basic_blocks); + all_vd = xmalloc (sizeof (struct value_data) * last_basic_block); - for (b = 0; b < n_basic_blocks; b++) + FOR_ALL_BB (bb) { - basic_block bb = BASIC_BLOCK (b); - /* If a block has a single predecessor, that we've already processed, begin with the value data that was live at the end of the predecessor block. */ /* ??? Ought to use more intelligent queueing of blocks. */ + if (bb->pred) + for (bbp = bb; bbp && bbp != bb->pred->src; bbp = bbp->prev_bb); if (bb->pred && ! bb->pred->pred_next && ! (bb->pred->flags & (EDGE_ABNORMAL_CALL | EDGE_EH)) - && bb->pred->src->index != ENTRY_BLOCK - && bb->pred->src->index < b) - all_vd[b] = all_vd[bb->pred->src->index]; + && bb->pred->src != ENTRY_BLOCK_PTR + && bbp) + all_vd[bb->sindex] = all_vd[bb->pred->src->sindex]; else - init_value_data (all_vd + b); + init_value_data (all_vd + bb->sindex); - if (copyprop_hardreg_forward_1 (bb, all_vd + b)) + if (copyprop_hardreg_forward_1 (bb, all_vd + bb->sindex)) need_refresh = true; } |