Commit d6fd4b8d by Daniel Berlin Committed by Daniel Berlin

tree-ssa-pre.c (compute_antic_aux): Use malloc'd worklist, to avoid generating useless garbage.

2004-09-20  Daniel Berlin  <dberlin@dberlin.org>

	* tree-ssa-pre.c (compute_antic_aux): Use malloc'd worklist, to avoid
	generating useless garbage.

From-SVN: r87760
parent c2dda19b
2004-09-20 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-pre.c (compute_antic_aux): Use malloc'd worklist, to avoid
generating useless garbage.
2004-09-20 Paolo Bonzini <bonzini@gnu.org> 2004-09-20 Paolo Bonzini <bonzini@gnu.org>
* builtins.c (fold_builtin): Call the new omonymous * builtins.c (fold_builtin): Call the new omonymous
......
...@@ -510,8 +510,10 @@ bitmap_insert_into_set (bitmap_set_t set, tree expr) ...@@ -510,8 +510,10 @@ bitmap_insert_into_set (bitmap_set_t set, tree expr)
gcc_assert (val); gcc_assert (val);
if (!is_gimple_min_invariant (val)) if (!is_gimple_min_invariant (val))
{
bitmap_set_bit (set->values, VALUE_HANDLE_ID (val)); bitmap_set_bit (set->values, VALUE_HANDLE_ID (val));
bitmap_set_bit (set->expressions, SSA_NAME_VERSION (expr)); bitmap_set_bit (set->expressions, SSA_NAME_VERSION (expr));
}
} }
/* Insert EXPR into SET. */ /* Insert EXPR into SET. */
...@@ -1098,6 +1100,8 @@ clean (value_set_t set) ...@@ -1098,6 +1100,8 @@ clean (value_set_t set)
} }
} }
DEF_VEC_MALLOC_P (basic_block);
/* Compute the ANTIC set for BLOCK. /* Compute the ANTIC set for BLOCK.
ANTIC_OUT[BLOCK] = intersection of ANTIC_IN[b] for all succ(BLOCK), if ANTIC_OUT[BLOCK] = intersection of ANTIC_IN[b] for all succ(BLOCK), if
...@@ -1164,24 +1168,23 @@ compute_antic_aux (basic_block block) ...@@ -1164,24 +1168,23 @@ compute_antic_aux (basic_block block)
them. */ them. */
else else
{ {
varray_type worklist; VEC (basic_block) * worklist;
edge e; edge e;
size_t i; size_t i;
basic_block bprime, first; basic_block bprime, first;
VARRAY_BB_INIT (worklist, 1, "succ"); worklist = VEC_alloc (basic_block, 2);
e = block->succ; e = block->succ;
while (e) while (e)
{ {
VARRAY_PUSH_BB (worklist, e->dest); VEC_safe_push (basic_block, worklist, e->dest);
e = e->succ_next; e = e->succ_next;
} }
first = VARRAY_BB (worklist, 0); first = VEC_index (basic_block, worklist, 0);
set_copy (ANTIC_OUT, ANTIC_IN (first)); set_copy (ANTIC_OUT, ANTIC_IN (first));
for (i = 1; i < VARRAY_ACTIVE_SIZE (worklist); i++) for (i = 1; VEC_iterate (basic_block, worklist, i, bprime); i++)
{ {
bprime = VARRAY_BB (worklist, i);
node = ANTIC_OUT->head; node = ANTIC_OUT->head;
while (node) while (node)
{ {
...@@ -1193,7 +1196,7 @@ compute_antic_aux (basic_block block) ...@@ -1193,7 +1196,7 @@ compute_antic_aux (basic_block block)
node = next; node = next;
} }
} }
VARRAY_CLEAR (worklist); VEC_free (basic_block, worklist);
} }
/* Generate ANTIC_OUT - TMP_GEN */ /* Generate ANTIC_OUT - TMP_GEN */
......
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