aboutsummaryrefslogtreecommitdiff
path: root/gcc/regrename.c
diff options
context:
space:
mode:
authorSteven Bosscher <stevenb@suse.de>2005-01-17 22:02:28 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2005-01-17 22:02:28 +0000
commit740ce53d8ae86887612273a219a3aa6fa97040a9 (patch)
tree9482053a02baa634992e1645e25ff362d2445b74 /gcc/regrename.c
parent2184a1201e63dbd4798c041370f7fcbb711813fb (diff)
downloadgcc-740ce53d8ae86887612273a219a3aa6fa97040a9.zip
gcc-740ce53d8ae86887612273a219a3aa6fa97040a9.tar.gz
gcc-740ce53d8ae86887612273a219a3aa6fa97040a9.tar.bz2
basic-block.h: Document BB_* flags.
* basic-block.h: Document BB_* flags. * regrename.c (copyprop_hardreg_forward): Don't use BB_VISITED, use an sbitmap instead. * sched-rgn.c (compute_trg_info): Likewise. From-SVN: r93779
Diffstat (limited to 'gcc/regrename.c')
-rw-r--r--gcc/regrename.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/gcc/regrename.c b/gcc/regrename.c
index eec594c..f2ab1f1 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -1746,29 +1746,26 @@ copyprop_hardreg_forward (void)
struct value_data *all_vd;
bool need_refresh;
basic_block bb;
+ sbitmap visited;
need_refresh = false;
all_vd = xmalloc (sizeof (struct value_data) * last_basic_block);
- /* Clear all BB_VISITED flags. We use BB_VISITED flags to indicate
- whether we have processed a given basic block or not. Note that
- we never put BB_VISITED flag on ENTRY_BLOCK_PTR throughout this
- function because we want to call init_value_data for all
- successors of ENTRY_BLOCK_PTR. */
- FOR_ALL_BB (bb)
- bb->flags &= ~BB_VISITED;
+ visited = sbitmap_alloc (last_basic_block - (INVALID_BLOCK + 1));
+ sbitmap_zero (visited);
FOR_EACH_BB (bb)
{
- bb->flags |= BB_VISITED;
+ SET_BIT (visited, bb->index - (INVALID_BLOCK + 1));
/* 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 queuing of blocks. */
if (EDGE_COUNT (bb->preds) == 1
- && ((EDGE_PRED (bb, 0)->src->flags & BB_VISITED) != 0)
+ && TEST_BIT (visited,
+ EDGE_PRED (bb, 0)->src->index - (INVALID_BLOCK + 1))
&& ! (EDGE_PRED (bb, 0)->flags & (EDGE_ABNORMAL_CALL | EDGE_EH)))
all_vd[bb->index] = all_vd[EDGE_PRED (bb, 0)->src->index];
else
@@ -1778,11 +1775,7 @@ copyprop_hardreg_forward (void)
need_refresh = true;
}
- /* Clear BB_VISITED flag on each basic block. We do not need to
- clear the one on ENTRY_BLOCK_PTR because it's already cleared
- above. */
- FOR_EACH_BB (bb)
- bb->flags &= ~BB_VISITED;
+ sbitmap_free (visited);
if (need_refresh)
{