summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-25 21:20:34 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-25 21:20:34 +0000
commit3a0e28bda34bfc65320f301a503a41fcd0fb9cb1 (patch)
tree8266407752dab136d0fc9a405ebbc3aca2e08f48 /gcc/tree-ssa-alias.c
parente4107e95e5f29b4e2f74f0b56b9971e7b3585337 (diff)
downloadgcc-3a0e28bda34bfc65320f301a503a41fcd0fb9cb1.tar.gz
2008-02-25 Richard Guenther <rguenther@suse.de>
Revert: 2008-02-25 Richard Guenther <rguenther@suse.de> * tree-flow.h (uid_decl_map_hash, uid_decl_map_eq): Move ... * tree.h (uid_decl_map_hash, uid_decl_map_eq): ... here. (lookup_decl_from_uid): Declare. * tree-ssa.c (uid_decl_map_eq, uid_decl_map_hash): Move ... * tree.c (uid_decl_map_eq, uid_decl_map_hash): ... here. (decl_for_uid_map): New global hashtable mapping DECL_UID to the decl tree. (init_ttree): Allocate it. (insert_decl_to_uid_decl_map): New helper function. (make_node_stat): Insert new decls into the map. (copy_node_stat): Likewise. (lookup_decl_from_uid): New function. (print_decl_for_uid_map_statistics): New helper. (dump_tree_statistics): Call it. * tree-flow.h (struct gimple_df): Make referenced_vars a bitmap. (referenced_var_iterator): Adjust. (FOR_EACH_REFERENCED_VAR): Adjust. (FOR_EACH_REFERENCED_VAR_IN_BITMAP): New iterator. (num_referenced_vars): Adjust. * tree-flow-inline.h (gimple_referenced_vars): Adjust. (first_referenced_var): Remove. (end_referenced_vars_p): Likewise. (next_referenced_var): Likewise. (referenced_var_iterator_set): New helper function. * tree-dfa.c (referenced_var_lookup): Adjust. (referenced_var_check_and_insert): Likewise. (remove_referenced_var): Likewise. * tree-ssa.c (verify_flow_insensitive_alias_info): Use FOR_EACH_REFERENCED_VAR_IN_BITMAP. (verify_call_clobbering): Likewise. (verify_memory_partitions): Likewise. (init_tree_ssa): Allocate bitmap instead of hashtable for referenced_vars. (delete_tree_ssa): Adjust. * tree-ssa-alias.c (mark_aliases_call_clobbered): Use FOR_EACH_REFERENCED_VAR_IN_BITMAP. (compute_tag_properties): Likewise. (set_initial_properties): Likewise. (find_partition_for): Likewise. (update_reference_counts): Likewise. (dump_may_aliases_for): Likewise. * tree-ssa-operands.c (add_virtual_operand): Likewise. (add_call_clobber_ops): Likewise. (add_call_read_ops): Likewise. (get_asm_expr_operands): Likewise. * tree-into-ssa.c (dump_decl_set): Likewise. (update_ssa): Likewise. * tree-sra.c (scan_function): Likewise. (decide_instantiations): Likewise. (scalarize_parms): Likewise. * tree-ssa-alias-warnings.c (build_reference_table): Likewise. (dsa_named_for): Likewise. * tree-ssa-structalias.c (update_alias_info): Likewise. (merge_smts_into): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132643 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r--gcc/tree-ssa-alias.c58
1 files changed, 36 insertions, 22 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 2166a7bb17d..7ab2f6b5473 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -390,7 +390,8 @@ mark_aliases_call_clobbered (tree tag, VEC (tree, heap) **worklist,
bitmap on_worklist, bitmap queued)
{
bitmap aliases;
- referenced_var_iterator ri;
+ bitmap_iterator bi;
+ unsigned int i;
tree entry;
var_ann_t ta = var_ann (tag);
@@ -400,8 +401,9 @@ mark_aliases_call_clobbered (tree tag, VEC (tree, heap) **worklist,
if (!aliases)
return;
- FOR_EACH_REFERENCED_VAR_IN_BITMAP (aliases, entry, ri)
+ EXECUTE_IF_SET_IN_BITMAP (aliases, 0, i, bi)
{
+ entry = referenced_var (i);
/* If you clobber one part of a structure, you
clobber the entire thing. While this does not make
the world a particularly nice place, it is necessary
@@ -418,9 +420,9 @@ mark_aliases_call_clobbered (tree tag, VEC (tree, heap) **worklist,
}
if (!bitmap_empty_p (queued))
{
- FOR_EACH_REFERENCED_VAR_IN_BITMAP (queued, entry, ri)
+ EXECUTE_IF_SET_IN_BITMAP (queued, 0, i, bi)
{
- subvar_t svars = get_subvars_for_var (entry);
+ subvar_t svars = get_subvars_for_var (referenced_var (i));
unsigned int i;
tree subvar;
@@ -482,7 +484,8 @@ compute_tag_properties (void)
for (k = 0; VEC_iterate (tree, taglist, k, tag); k++)
{
bitmap ma;
- referenced_var_iterator ri;
+ bitmap_iterator bi;
+ unsigned int i;
tree entry;
bool tagcc = is_call_clobbered (tag);
bool tagglobal = MTAG_GLOBAL (tag);
@@ -494,8 +497,9 @@ compute_tag_properties (void)
if (!ma)
continue;
- FOR_EACH_REFERENCED_VAR_IN_BITMAP (ma, entry, ri)
+ EXECUTE_IF_SET_IN_BITMAP (ma, 0, i, bi)
{
+ entry = referenced_var (i);
/* Call clobbered entries cause the tag to be marked
call clobbered. */
if (!tagcc && is_call_clobbered (entry))
@@ -577,10 +581,12 @@ set_initial_properties (struct alias_info *ai)
if (pi->pt_vars)
{
- referenced_var_iterator ri;
- tree alias;
- FOR_EACH_REFERENCED_VAR_IN_BITMAP (pi->pt_vars, alias, ri)
+ bitmap_iterator bi;
+ unsigned int j;
+ EXECUTE_IF_SET_IN_BITMAP (pi->pt_vars, 0, j, bi)
{
+ tree alias = referenced_var (j);
+
/* If you clobber one part of a structure, you
clobber the entire thing. While this does not make
the world a particularly nice place, it is necessary
@@ -594,9 +600,9 @@ set_initial_properties (struct alias_info *ai)
/* Process variables we need to clobber all parts of. */
if (!bitmap_empty_p (queued))
{
- FOR_EACH_REFERENCED_VAR_IN_BITMAP (queued, alias, ri)
+ EXECUTE_IF_SET_IN_BITMAP (queued, 0, j, bi)
{
- subvar_t svars = get_subvars_for_var (alias);
+ subvar_t svars = get_subvars_for_var (referenced_var (j));
unsigned int i;
tree subvar;
@@ -1182,11 +1188,13 @@ find_partition_for (mem_sym_stats_t mp_p)
static void
rewrite_alias_set_for (tree tag, bitmap new_aliases)
{
- referenced_var_iterator ri;
+ bitmap_iterator bi;
+ unsigned i;
tree mpt, sym;
- FOR_EACH_REFERENCED_VAR_IN_BITMAP (MTAG_ALIASES (tag), sym, ri)
+ EXECUTE_IF_SET_IN_BITMAP (MTAG_ALIASES (tag), 0, i, bi)
{
+ sym = referenced_var (i);
mpt = memory_partition (sym);
if (mpt)
bitmap_set_bit (new_aliases, DECL_UID (mpt));
@@ -1297,10 +1305,9 @@ estimate_vop_reduction (struct mem_ref_stats_d *mem_ref_stats,
static void
update_reference_counts (struct mem_ref_stats_d *mem_ref_stats)
{
- referenced_var_iterator ri;
+ unsigned i;
+ bitmap_iterator bi;
mem_sym_stats_t sym_stats;
- unsigned int i;
- tree sym;
for (i = 1; i < num_ssa_names; i++)
{
@@ -1313,7 +1320,9 @@ update_reference_counts (struct mem_ref_stats_d *mem_ref_stats)
&& (pi = SSA_NAME_PTR_INFO (ptr)) != NULL
&& pi->is_dereferenced)
{
- tree tag, alias;
+ unsigned j;
+ bitmap_iterator bj;
+ tree tag;
mem_sym_stats_t ptr_stats, tag_stats;
/* If PTR has flow-sensitive points-to information, use
@@ -1339,8 +1348,9 @@ update_reference_counts (struct mem_ref_stats_d *mem_ref_stats)
TAG's alias set, add as many indirect references to ALIAS
as direct references there are for TAG. */
if (MTAG_ALIASES (tag))
- FOR_EACH_REFERENCED_VAR_IN_BITMAP (MTAG_ALIASES (tag), alias, ri)
+ EXECUTE_IF_SET_IN_BITMAP (MTAG_ALIASES (tag), 0, j, bj)
{
+ tree alias = referenced_var (j);
sym_stats = get_mem_sym_stats_for (alias);
/* All the direct references to TAG are indirect references
@@ -1360,8 +1370,9 @@ update_reference_counts (struct mem_ref_stats_d *mem_ref_stats)
/* Call-clobbered symbols are indirectly written at every
call/asm site. */
- FOR_EACH_REFERENCED_VAR_IN_BITMAP (gimple_call_clobbered_vars (cfun), sym, ri)
+ EXECUTE_IF_SET_IN_BITMAP (gimple_call_clobbered_vars (cfun), 0, i, bi)
{
+ tree sym = referenced_var (i);
sym_stats = get_mem_sym_stats_for (sym);
sym_stats->num_indirect_writes += mem_ref_stats->num_call_sites
+ mem_ref_stats->num_asm_sites;
@@ -1370,8 +1381,9 @@ update_reference_counts (struct mem_ref_stats_d *mem_ref_stats)
/* Addressable symbols are indirectly written at some ASM sites.
Since only ASM sites that clobber memory actually affect
addressable symbols, this is an over-estimation. */
- FOR_EACH_REFERENCED_VAR_IN_BITMAP (gimple_addressable_vars (cfun), sym, ri)
+ EXECUTE_IF_SET_IN_BITMAP (gimple_addressable_vars (cfun), 0, i, bi)
{
+ tree sym = referenced_var (i);
sym_stats = get_mem_sym_stats_for (sym);
sym_stats->num_indirect_writes += mem_ref_stats->num_asm_sites;
}
@@ -3470,12 +3482,14 @@ dump_may_aliases_for (FILE *file, tree var)
aliases = MTAG_ALIASES (var);
if (aliases)
{
- referenced_var_iterator ri;
+ bitmap_iterator bi;
+ unsigned int i;
tree al;
fprintf (file, "{ ");
- FOR_EACH_REFERENCED_VAR_IN_BITMAP (aliases, al, ri)
+ EXECUTE_IF_SET_IN_BITMAP (aliases, 0, i, bi)
{
+ al = referenced_var (i);
print_generic_expr (file, al, dump_flags);
fprintf (file, " ");
}