Commit 26caf960 by Kazu Hirata Committed by Kazu Hirata

* global.c (calculate_reg_pav): Use VEC instead of VARRAY.

From-SVN: r99085
parent ec234842
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
* gimplify.c (gimplify_compound_lval): Use VEC instead of * gimplify.c (gimplify_compound_lval): Use VEC instead of
VARRAY. VARRAY.
* global.c (calculate_reg_pav): Use VEC instead of VARRAY.
2005-05-01 Mark Mitchell <mark@codesourcery.com> 2005-05-01 Mark Mitchell <mark@codesourcery.com>
PR C++/14391 PR C++/14391
......
...@@ -2292,6 +2292,9 @@ rpost_cmp (const void *bb1, const void *bb2) ...@@ -2292,6 +2292,9 @@ rpost_cmp (const void *bb1, const void *bb2)
/* Temporary bitmap used for live_pavin, live_pavout calculation. */ /* Temporary bitmap used for live_pavin, live_pavout calculation. */
static bitmap temp_bitmap; static bitmap temp_bitmap;
DEF_VEC_P(basic_block);
DEF_VEC_ALLOC_P(basic_block,heap);
/* The function calculates partial register availability according to /* The function calculates partial register availability according to
the following equations: the following equations:
...@@ -2307,22 +2310,22 @@ calculate_reg_pav (void) ...@@ -2307,22 +2310,22 @@ calculate_reg_pav (void)
basic_block bb, succ; basic_block bb, succ;
edge e; edge e;
int i, nel; int i, nel;
varray_type bbs, new_bbs, temp; VEC(basic_block,heap) *bbs, *new_bbs, *temp;
basic_block *bb_array; basic_block *bb_array;
sbitmap wset; sbitmap wset;
VARRAY_BB_INIT (bbs, n_basic_blocks, "basic blocks"); bbs = VEC_alloc (basic_block, heap, n_basic_blocks);
VARRAY_BB_INIT (new_bbs, n_basic_blocks, "basic blocks for the next iter."); new_bbs = VEC_alloc (basic_block, heap, n_basic_blocks);
temp_bitmap = BITMAP_ALLOC (NULL); temp_bitmap = BITMAP_ALLOC (NULL);
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
{ {
VARRAY_PUSH_BB (bbs, bb); VEC_quick_push (basic_block, bbs, bb);
} }
wset = sbitmap_alloc (n_basic_blocks + 1); wset = sbitmap_alloc (n_basic_blocks + 1);
while (VARRAY_ACTIVE_SIZE (bbs)) while (VEC_length (basic_block, bbs))
{ {
bb_array = &VARRAY_BB (bbs, 0); bb_array = VEC_address (basic_block, bbs);
nel = VARRAY_ACTIVE_SIZE (bbs); nel = VEC_length (basic_block, bbs);
qsort (bb_array, nel, sizeof (basic_block), rpost_cmp); qsort (bb_array, nel, sizeof (basic_block), rpost_cmp);
sbitmap_zero (wset); sbitmap_zero (wset);
for (i = 0; i < nel; i++) for (i = 0; i < nel; i++)
...@@ -2356,7 +2359,7 @@ calculate_reg_pav (void) ...@@ -2356,7 +2359,7 @@ calculate_reg_pav (void)
&& !TEST_BIT (wset, succ->index)) && !TEST_BIT (wset, succ->index))
{ {
SET_BIT (wset, succ->index); SET_BIT (wset, succ->index);
VARRAY_PUSH_BB (new_bbs, succ); VEC_quick_push (basic_block, new_bbs, succ);
} }
} }
} }
...@@ -2364,10 +2367,12 @@ calculate_reg_pav (void) ...@@ -2364,10 +2367,12 @@ calculate_reg_pav (void)
temp = bbs; temp = bbs;
bbs = new_bbs; bbs = new_bbs;
new_bbs = temp; new_bbs = temp;
VARRAY_POP_ALL (new_bbs); VEC_truncate (basic_block, new_bbs, 0);
} }
sbitmap_free (wset); sbitmap_free (wset);
BITMAP_FREE (temp_bitmap); BITMAP_FREE (temp_bitmap);
VEC_free (basic_block, heap, new_bbs);
VEC_free (basic_block, heap, bbs);
} }
/* The function modifies partial availability information for two /* The function modifies partial availability information for two
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment