aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-02-25 15:10:34 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-02-25 15:10:34 +0000
commit7660c722d9ed749ad84a919169ad55cf3b30f102 (patch)
tree3d477af05abfc59dd9e5d4b0fe342069f48c796f /gcc/tree-ssa.c
parent2e4e39f615dacf0dbc8b02db27b1046f849c731d (diff)
downloadgcc-7660c722d9ed749ad84a919169ad55cf3b30f102.zip
gcc-7660c722d9ed749ad84a919169ad55cf3b30f102.tar.gz
gcc-7660c722d9ed749ad84a919169ad55cf3b30f102.tar.bz2
tree-flow.h (uid_decl_map_hash, [...]): Move ...
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. From-SVN: r132629
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c77
1 files changed, 23 insertions, 54 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 6c06df0..7b89e22 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -378,28 +378,23 @@ verify_flow_insensitive_alias_info (void)
FOR_EACH_REFERENCED_VAR (var, rvi)
{
- unsigned int j;
bitmap aliases;
tree alias;
- bitmap_iterator bi;
+ referenced_var_iterator ri;
if (!MTAG_P (var) || !MTAG_ALIASES (var))
continue;
aliases = MTAG_ALIASES (var);
- EXECUTE_IF_SET_IN_BITMAP (aliases, 0, j, bi)
- {
- alias = referenced_var (j);
-
- if (TREE_CODE (alias) != MEMORY_PARTITION_TAG
- && !may_be_aliased (alias))
- {
- error ("non-addressable variable inside an alias set");
- debug_variable (alias);
- goto err;
- }
- }
+ FOR_EACH_REFERENCED_VAR_IN_BITMAP (aliases, alias, ri)
+ if (TREE_CODE (alias) != MEMORY_PARTITION_TAG
+ && !may_be_aliased (alias))
+ {
+ error ("non-addressable variable inside an alias set");
+ debug_variable (alias);
+ goto err;
+ }
}
return;
@@ -486,20 +481,17 @@ err:
static void
verify_call_clobbering (void)
{
- unsigned int i;
- bitmap_iterator bi;
- tree var;
referenced_var_iterator rvi;
+ tree var;
/* At all times, the result of the call_clobbered flag should
match the result of the call_clobbered_vars bitmap. Verify both
that everything in call_clobbered_vars is marked
call_clobbered, and that everything marked
call_clobbered is in call_clobbered_vars. */
- EXECUTE_IF_SET_IN_BITMAP (gimple_call_clobbered_vars (cfun), 0, i, bi)
+ FOR_EACH_REFERENCED_VAR_IN_BITMAP (gimple_call_clobbered_vars (cfun),
+ var, rvi)
{
- var = referenced_var (i);
-
if (memory_partition (var))
var = memory_partition (var);
@@ -550,8 +542,8 @@ verify_memory_partitions (void)
for (i = 0; VEC_iterate (tree, mpt_table, i, mpt); i++)
{
- unsigned j;
- bitmap_iterator bj;
+ referenced_var_iterator ri;
+ tree var;
if (MPT_SYMBOLS (mpt) == NULL)
{
@@ -560,17 +552,14 @@ verify_memory_partitions (void)
goto err;
}
- EXECUTE_IF_SET_IN_BITMAP (MPT_SYMBOLS (mpt), 0, j, bj)
- {
- tree var = referenced_var (j);
- if (pointer_set_insert (partitioned_syms, var))
- {
- error ("Partitioned symbols should belong to exactly one "
- "partition");
- debug_variable (var);
- goto err;
- }
- }
+ FOR_EACH_REFERENCED_VAR_IN_BITMAP (MPT_SYMBOLS (mpt), var, ri)
+ if (pointer_set_insert (partitioned_syms, var))
+ {
+ error ("Partitioned symbols should belong to exactly one "
+ "partition");
+ debug_variable (var);
+ goto err;
+ }
}
pointer_set_destroy (partitioned_syms);
@@ -774,24 +763,6 @@ int_tree_map_hash (const void *item)
return ((const struct int_tree_map *)item)->uid;
}
-/* Return true if the DECL_UID in both trees are equal. */
-
-int
-uid_decl_map_eq (const void *va, const void *vb)
-{
- const_tree a = (const_tree) va;
- const_tree b = (const_tree) vb;
- return (a->decl_minimal.uid == b->decl_minimal.uid);
-}
-
-/* Hash a tree in a uid_decl_map. */
-
-unsigned int
-uid_decl_map_hash (const void *item)
-{
- return ((const_tree)item)->decl_minimal.uid;
-}
-
/* Return true if the uid in both int tree maps are equal. */
static int
@@ -835,8 +806,7 @@ void
init_tree_ssa (void)
{
cfun->gimple_df = GGC_CNEW (struct gimple_df);
- cfun->gimple_df->referenced_vars = htab_create_ggc (20, uid_decl_map_hash,
- uid_decl_map_eq, NULL);
+ cfun->gimple_df->referenced_vars = BITMAP_GGC_ALLOC ();
cfun->gimple_df->default_defs = htab_create_ggc (20, uid_ssaname_map_hash,
uid_ssaname_map_eq, NULL);
cfun->gimple_df->var_anns = htab_create_ggc (20, var_ann_hash,
@@ -893,7 +863,6 @@ delete_tree_ssa (void)
ggc_free (var->base.ann);
var->base.ann = NULL;
}
- htab_delete (gimple_referenced_vars (cfun));
cfun->gimple_df->referenced_vars = NULL;
fini_ssanames ();