Commit e288e2f5 by Andrew MacLeod Committed by Andrew Macleod

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


2004-11-25  Andrew Macleod  <amacleod@redhat.com>

	PR tree-optimization/18587
	* tree-flow-inline.h (mark_call_clobbered, mark_non_addressable): Flag
	call clobbered caches as invalid.
	* tree-ssa-operands.c (ssa_call_clobbered_cache_valid): New.  Flag
	indicating whether the call clobbered operand cache is valid.
	(ssa_ro_call_cache_valid): New.  Flag indicating whether the pure/const
	call operand cache is valid.
	(clobbered_v_may_defs, clobbered_vuses, ro_call_vuses): New.
	cached list of operands for cached call virtual operands.
	(clobbered_aliased_loads, clobbered_aliased_stores,
	ro_call_aliased_load): New.  flags caching whether alias bits are to be
	set in call stmt's.  */
	(fini_ssa_operands): Remove call operand caches if present.
	(get_expr_operands, get_asm_expr_operands, get_indirect_ref_operands):
	Pass stmt annotation to add_stmt_operand.
	(get_call_expr_operands): Add call clobbered variables first.
	(add_stmt_operand): Take stmt annotation rather than stmt as a param.
	(add_call_clobber_ops, add_call_read_ops): Use the call operand cache
	if it is valid, otherise fill the cache.
	* tree-ssa-operands.h (ssa_clobbered_cache_valid): Declare extern.

	* tree-flow.h (struct var_ann_d): Add in_vuse_list and in_v_may_def_list
	bits.
	* tree-ssa-operands.c (cleanup_v_may_defs): New.  Clear the in_list bits
	for the v_may_def elements and empty the operand build array.
	(finalize_ssa_vuses): Use cleanup_v_may_defs and remove redundant VUSES
	by checking the in_v_may_def_list bit.
	(append_v_may_def, append_vuse): Use the in_list bit rather than
	scanning the array for duplicates.

From-SVN: r91305
parent 5257260c
2004-11-25 Andrew MacLeod <amacleod@redhat.com>
PR tree-optimization/18587
* tree-flow-inline.h (mark_call_clobbered, mark_non_addressable): Flag
call clobbered caches as invalid.
* tree-ssa-operands.c (ssa_call_clobbered_cache_valid): New. Flag
indicating whether the call clobbered operand cache is valid.
(ssa_ro_call_cache_valid): New. Flag indicating whether the pure/const
call operand cache is valid.
(clobbered_v_may_defs, clobbered_vuses, ro_call_vuses): New. Cached
list of operands for cached call virtual operands.
(clobbered_aliased_loads, clobbered_aliased_stores,
ro_call_aliased_load): New. flags caching whether alias bits are to be
set in call stmt's.
(fini_ssa_operands): Remove call operand caches if present.
(get_expr_operands, get_asm_expr_operands, get_indirect_ref_operands):
Pass stmt annotation to add_stmt_operand.
(get_call_expr_operands): Add call clobbered variables first.
(add_stmt_operand): Take stmt annotation rather than stmt as a param.
(add_call_clobber_ops, add_call_read_ops): Use the call operand cache
if it is valid, otherise fill the cache.
* tree-ssa-operands.h (ssa_clobbered_cache_valid): Declare extern.
* tree-flow.h (struct var_ann_d): Add in_vuse_list and in_v_may_def_list
bits.
* tree-ssa-operands.c (cleanup_v_may_defs): New. Clear the in_list bits
for the v_may_def elements and empty the operand build array.
(finalize_ssa_vuses): Use cleanup_v_may_defs and remove redundant VUSES
by checking the in_v_may_def_list bit.
(append_v_may_def, append_vuse): Use the in_list bit rather than
scanning the array for duplicates.
2004-11-25 Ulrich Weigand <uweigand@de.ibm.com> 2004-11-25 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390.c (s390_short_displacement): UNSPEC_GOTNTPOFF * config/s390/s390.c (s390_short_displacement): UNSPEC_GOTNTPOFF
......
...@@ -621,6 +621,8 @@ mark_call_clobbered (tree var) ...@@ -621,6 +621,8 @@ mark_call_clobbered (tree var)
if (ann->mem_tag_kind != NOT_A_TAG) if (ann->mem_tag_kind != NOT_A_TAG)
DECL_EXTERNAL (var) = 1; DECL_EXTERNAL (var) = 1;
bitmap_set_bit (call_clobbered_vars, ann->uid); bitmap_set_bit (call_clobbered_vars, ann->uid);
ssa_call_clobbered_cache_valid = false;
ssa_ro_call_cache_valid = false;
} }
/* Mark variable VAR as being non-addressable. */ /* Mark variable VAR as being non-addressable. */
...@@ -629,6 +631,8 @@ mark_non_addressable (tree var) ...@@ -629,6 +631,8 @@ mark_non_addressable (tree var)
{ {
bitmap_clear_bit (call_clobbered_vars, var_ann (var)->uid); bitmap_clear_bit (call_clobbered_vars, var_ann (var)->uid);
TREE_ADDRESSABLE (var) = 0; TREE_ADDRESSABLE (var) = 0;
ssa_call_clobbered_cache_valid = false;
ssa_ro_call_cache_valid = false;
} }
/* Return the common annotation for T. Return NULL if the annotation /* Return the common annotation for T. Return NULL if the annotation
......
...@@ -166,6 +166,14 @@ struct var_ann_d GTY(()) ...@@ -166,6 +166,14 @@ struct var_ann_d GTY(())
states. */ states. */
ENUM_BITFIELD (need_phi_state) need_phi_state : 2; ENUM_BITFIELD (need_phi_state) need_phi_state : 2;
/* Used during operand processing to determine if this variable is already
in the vuse list. */
unsigned in_vuse_list : 1;
/* Used during operand processing to determine if this variable is already
in the v_may_def list. */
unsigned in_v_may_def_list : 1;
/* An artificial variable representing the memory location pointed-to by /* An artificial variable representing the memory location pointed-to by
all the pointers that TBAA (type-based alias analysis) considers all the pointers that TBAA (type-based alias analysis) considers
to be aliased. If the variable is not a pointer or if it is never to be aliased. If the variable is not a pointer or if it is never
......
...@@ -188,6 +188,8 @@ extern void get_stmt_operands (tree); ...@@ -188,6 +188,8 @@ extern void get_stmt_operands (tree);
extern void copy_virtual_operands (tree, tree); extern void copy_virtual_operands (tree, tree);
extern void create_ssa_artficial_load_stmt (stmt_operands_p, tree); extern void create_ssa_artficial_load_stmt (stmt_operands_p, tree);
extern bool ssa_call_clobbered_cache_valid;
extern bool ssa_ro_call_cache_valid;
/* This structure is used in the operand iterator loops. It contains the /* This structure is used in the operand iterator loops. It contains the
items required to determine which operand is retrieved next. During items required to determine which operand is retrieved next. During
......
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