Commit f3940b0e by Andrew MacLeod Committed by Andrew Macleod

re PR tree-optimization/18587 (build_v_may_defs and build_vuses can be improved when adding)



2005-10-05  Andrew MacLeod  <amacleod@redhat.com>

	PR tree-optimization/18587

	* tree-ssa-operands.c (struct opbuild_list_d, OPBUILD_LAST): Delete.
	(build_defs, build_uses, build_v_may_defs, build_v_must_defs,
	build_vuses): Change to VEC type.
	(opbuild_initialize_virtual, opbuild_initialize_real, opbuild_free,
	opbuild_num_elems, opbuild_append_real, opbuild_append_virtual,
	opbuild_first, opbuild_next, opbuild_elem_real, opbuild_elem_virtual,
	opbuild_elem_uid, opbuild_clear, opbuild_remove_elem): Delete.
	(get_name_decl): New.  Return DECL_UID of base variable.
	(operand_build_cmp): New.  qsort comparison routine.
	(operand_build_sort_virtual): New.  Sort virtual build vector.
	(init_ssa_operands, fini_ssa_operands): Use VEC routines.
	(FINALIZE_OPBUILD_BASE, FINALIZE_OPBUILD_ELEM): Use VEC_Index.
	(FINALIZE_BASE): Use get_name_decl.
	(finalize_ssa_defs, finalize_ssa_uses, cleanup_v_may_defs,
	finalize_ssa_v_may_defs, finalize_ssa_vuses, finalize_ssa_v_must_defs,
	(start_ssa_stmt_operands, append_def, append_use, append_vuse,
	append_v_may_def, append_v_must_def): Replace opbuild_* routines with
	direct VEC_* manipulations.
	(build_ssa_operands): Call operand_build_sort_virtual.
	(copy_virtual_operand, create_ssa_artficial_load_stmt,
	add_call_clobber_ops, add_call_read_ops): Replace opbuild_* routines
	with direct VEC_* manipulations.
	* tree-ssa-opfinalize.h (FINALIZE_FUNC): Replace opbuild_* routines
	with direct VEC manipulations.

From-SVN: r104996
parent 3015564c
2005-10-05 Andrew MacLeod <amacleod@redhat.com>
PR tree-optimization/18587
* tree-ssa-operands.c (struct opbuild_list_d, OPBUILD_LAST): Delete.
(build_defs, build_uses, build_v_may_defs, build_v_must_defs,
build_vuses): Change to VEC type.
(opbuild_initialize_virtual, opbuild_initialize_real, opbuild_free,
opbuild_num_elems, opbuild_append_real, opbuild_append_virtual,
opbuild_first, opbuild_next, opbuild_elem_real, opbuild_elem_virtual,
opbuild_elem_uid, opbuild_clear, opbuild_remove_elem): Delete.
(get_name_decl): New. Return DECL_UID of base variable.
(operand_build_cmp): New. qsort comparison routine.
(operand_build_sort_virtual): New. Sort virtual build vector.
(init_ssa_operands, fini_ssa_operands): Use VEC routines.
(FINALIZE_OPBUILD_BASE, FINALIZE_OPBUILD_ELEM): Use VEC_Index.
(FINALIZE_BASE): Use get_name_decl.
(finalize_ssa_defs, finalize_ssa_uses, cleanup_v_may_defs,
finalize_ssa_v_may_defs, finalize_ssa_vuses, finalize_ssa_v_must_defs,
(start_ssa_stmt_operands, append_def, append_use, append_vuse,
append_v_may_def, append_v_must_def): Replace opbuild_* routines with
direct VEC_* manipulations.
(build_ssa_operands): Call operand_build_sort_virtual.
(copy_virtual_operand, create_ssa_artficial_load_stmt,
add_call_clobber_ops, add_call_read_ops): Replace opbuild_* routines
with direct VEC_* manipulations.
* tree-ssa-opfinalize.h (FINALIZE_FUNC): Replace opbuild_* routines
with direct VEC manipulations.
2005-10-05 Paolo Bonzini <bonzini@gnu.org>
PR tree-optimization/21419
......
......@@ -63,7 +63,7 @@ FINALIZE_ALLOC (void)
static inline void
FINALIZE_FUNC (tree stmt)
{
int new_i;
unsigned new_i;
FINALIZE_TYPE *old_ops, *ptr, *last;
FINALIZE_BASE_TYPE old_base;
FINALIZE_TYPE new_list;
......@@ -77,8 +77,8 @@ FINALIZE_FUNC (tree stmt)
else
old_base = FINALIZE_BASE_ZERO;
new_i = opbuild_first (&FINALIZE_OPBUILD);
while (old_ops && new_i != OPBUILD_LAST)
new_i = 0;
while (old_ops && new_i < VEC_length (tree, FINALIZE_OPBUILD))
{
FINALIZE_BASE_TYPE new_base = FINALIZE_OPBUILD_BASE (new_i);
if (old_base == new_base)
......@@ -90,7 +90,7 @@ FINALIZE_FUNC (tree stmt)
FINALIZE_CORRECT_USE (FINALIZE_USE_PTR (last), stmt);
#endif
old_ops = old_ops->next;
new_i = opbuild_next (&FINALIZE_OPBUILD, new_i);
new_i++;
}
else
if (old_base < new_base)
......@@ -112,16 +112,14 @@ FINALIZE_FUNC (tree stmt)
FINALIZE_INITIALIZE (ptr, FINALIZE_OPBUILD_ELEM (new_i), stmt);
last->next = ptr;
last = ptr;
new_i = opbuild_next (&FINALIZE_OPBUILD, new_i);
new_i++;
}
if (old_ops)
old_base = FINALIZE_BASE (FINALIZE_ELEM (old_ops));
}
/* If there is anything remaining in the opbuild list, simply emit them. */
for ( ;
new_i != OPBUILD_LAST;
new_i = opbuild_next (&FINALIZE_OPBUILD, new_i))
for ( ; new_i < VEC_length (tree, FINALIZE_OPBUILD); new_i++)
{
ptr = FINALIZE_ALLOC ();
FINALIZE_INITIALIZE (ptr, FINALIZE_OPBUILD_ELEM (new_i), stmt);
......@@ -154,7 +152,7 @@ FINALIZE_FUNC (tree stmt)
for (ptr = FINALIZE_OPS (stmt); ptr; ptr = ptr->next)
x++;
gcc_assert (x == opbuild_num_elems (&FINALIZE_OPBUILD));
gcc_assert (x == VEC_length (tree, FINALIZE_OPBUILD));
}
#endif
}
......
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