diff options
author | Jan Hubicka <jh@suse.cz> | 2006-11-28 15:42:37 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2006-11-28 14:42:37 +0000 |
commit | 5cd4ec7f24ef2fca4e1e27836e5eee7b15b8abd8 (patch) | |
tree | 5e09813d89b6e045357e6ee37686e9b16cf2a1ec /gcc/tree-ssa-alias.c | |
parent | 3faa49284198625952a4420b889d5139710dab81 (diff) | |
download | gcc-5cd4ec7f24ef2fca4e1e27836e5eee7b15b8abd8.zip gcc-5cd4ec7f24ef2fca4e1e27836e5eee7b15b8abd8.tar.gz gcc-5cd4ec7f24ef2fca4e1e27836e5eee7b15b8abd8.tar.bz2 |
Privatize SSA variables into gimple_df.
* tree-flow-inline.h
(gimple_in_ssa_p, gimple_aliases_computed_p, gimple_addressable_vars,
gimple_call_clobbered_vars, gimple_referenced_vars, gimple_global_var,
gimple_nonlocal_all): New accessors.
(first_referenced_var): Update.
(mark_stmt_modified): Update.
(is_call_clobbered): Update.
(mark_call_clobbered): Update.
(clear_call_clobbered): Update.
(mark_non_addressable): Update.
* tree-vrp.c (get_value_range): Update.
* tree-into-ssa.c (in_ssa_p): Kill.
(get_default_def_for): Update.
(rewrite_into_ssa): Update.
* tree-complex.c (init_parameter_lattice_values): Update.
(update_complex_assignment): Update.
(update_parameter_components): Update.
(expand_complex_libcall): Update.
(expand_complex_operations_1): Update.
* tree-tailcall.c (arg_needs_copy_p): Update.
(add_virtual_phis): Update.
(tree_optimize_tail_calls_1): Update.
* tree-ssa-dse.c (memory_ssa_name_same): Update.
* tree-ssa-copyrename.c
(copy_rename_partition_coalesce): Update.
* tree-ssa-math-opts.c (execute_cse_reciprocals): Update.
* tree-ssa-propagate.c (set_rhs): Update.
* tree-ssa-alias.c (aliases_computed_p, call_clobbered_vars,
addressable_vars, global_var):Kill.
(set_initial_properties): Update.
(init_alias_info): Update.
(finalize_ref_all_pointers): Update.
(setup_pointers_and_addressables): Update.
(maybe_create_global_var): Update.
(create_global_var): Update.
(dump_points_to_info): Update.
* function.h (struct gimple_df): Forward declare.
(struct function): Add GIMPLE_DF field.
* gimplify.c (force_gimple_operand): Update.
* tree-dfa.c (referenced_vars, default_defs): KIll.
(make_rename_temp): Update.
(dump_variable): Update.
(referenced_var_lookup): Update.
(referenced_var_check_and_insert): Update.
(default_def): Rename to ...
(gimple_default_def): ... this one; accept cfun argument.
(set_default_def): Update.
* tree-cfgcleanup.c (modified_noreturn_calls): Kill.
(cleanup_control_flow): Update.
* tree-ssa-pre.c (compute_avail): Update
* tree-ssa-live.c (calculate_live_on_entry): Update.
* tree-ssa.c (verify_use): Update.
(verify_call_clobbering): Update.
(verify_call_clobbering): Update.
(init_tree_ssa): Update.
(delete_tree_ssa): Update.
* tree-outof-ssa.c (coalesce_ssa_name): Update.
(rewrite_out_of_ssa): Update.
* tree-flow.h (gimple_df): New structure collecting dataflow variables.
(FREE_SSANAMES, SSANAMES, MODIFIED_NORETURN_CALLS, DEFAULT_DEFS): New
private accessors.
(in_ssa_p, modified_noreturn_calls, referenced_vars, default_defs,
ssa_names, global_var, nonlocal_all, call_clobbered_vars,
addressable_vars, aliases_computed_p): Kill.
(default_def): Rename to...
(gimple_default_def): ... this one.
(defaule_def_fn): Kill.
(num_referenced_vars, ssa_names, num_ssa_names): Update.
* tree-ssa-structalias.c (nonlocal_all): Kill.
(get_constraint_exp_from_ssa_var): Update.
(create_nonlocal_var): Update.
(get_constraint_for): Update.
(update_alias_info): Update.
(find_global_initializers): Update.
(intra_create_variable_infos): Update.
(intra_create_variable_infos):
(find_what_p_points_to): Update.
(init_alias_heapvars): Update.
* tree-cfg.c (remove_bb): Update.
(gimplify_val): Update.
* tree-ssa-reassoc.c (get_rank): Update.
(init_reassoc): Update.
* tree-ssanames.c: Do not include gt-tree-ssanames.h
(ssa_names, free_ssanames): Kill.
(init_ssanames): Update.
(make_ssa_name): Update.
(release_ssa_name): Update.
(release_defs): Update.
(replace_ssa_name_symbol): Update.
* tree-ssa-operands.c (access_can_touch_variable): Update.
(add_virtual_operand): Update.
(add_call_clobber_ops): Update.
(add_call_read_ops): Update.
(get_call_expr_operands): Update.
(get_asm_expr_operands): Update.
From-SVN: r119294
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 59 |
1 files changed, 19 insertions, 40 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index a12dca2..65a8417 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -52,9 +52,6 @@ Boston, MA 02110-1301, USA. */ aliasing */ static bitmap_obstack alias_obstack; -/* 'true' after aliases have been computed (see compute_may_aliases). */ -bool aliases_computed_p; - /* Structure to map a variable to its alias set and keep track of the virtual operands that will be needed to represent it. */ struct alias_map_d @@ -117,26 +114,6 @@ static void set_pt_anything (tree ptr); /* Global declarations. */ -/* Call clobbered variables in the function. If bit I is set, then - REFERENCED_VARS (I) is call-clobbered. */ -bitmap call_clobbered_vars; - -/* Addressable variables in the function. If bit I is set, then - REFERENCED_VARS (I) has had its address taken. Note that - CALL_CLOBBERED_VARS and ADDRESSABLE_VARS are not related. An - addressable variable is not necessarily call-clobbered (e.g., a - local addressable whose address does not escape) and not all - call-clobbered variables are addressable (e.g., a local static - variable). */ -bitmap addressable_vars; - -/* When the program has too many call-clobbered variables and call-sites, - this variable is used to represent the clobbering effects of function - calls. In these cases, all the call clobbered variables in the program - are forced to alias this variable. This reduces compile times by not - having to keep track of too many V_MAY_DEF expressions at call sites. */ -tree global_var; - /* qsort comparison function to sort type/name tags by DECL_UID. */ static int @@ -327,10 +304,10 @@ set_initial_properties (struct alias_info *ai) mark_call_clobbered (var, ESCAPE_IS_GLOBAL); } else if (TREE_CODE (var) == PARM_DECL - && default_def (var) + && gimple_default_def (cfun, var) && POINTER_TYPE_P (TREE_TYPE (var))) { - tree def = default_def (var); + tree def = gimple_default_def (cfun, var); get_ptr_info (def)->value_escapes_p = 1; get_ptr_info (def)->escape_mask |= ESCAPE_IS_PARM; } @@ -883,14 +860,14 @@ init_alias_info (void) ai->dereferenced_ptrs_load = BITMAP_ALLOC (&alias_obstack); /* If aliases have been computed before, clear existing information. */ - if (aliases_computed_p) + if (gimple_aliases_computed_p (cfun)) { unsigned i; /* Similarly, clear the set of addressable variables. In this case, we can just clear the set because addressability is only computed here. */ - bitmap_clear (addressable_vars); + bitmap_clear (gimple_addressable_vars (cfun)); /* Clear flow-insensitive alias information from each symbol. */ FOR_EACH_REFERENCED_VAR (var, rvi) @@ -945,7 +922,7 @@ init_alias_info (void) } /* Next time, we will need to reset alias information. */ - aliases_computed_p = true; + cfun->gimple_df->aliases_computed_p = true; return ai; } @@ -1341,8 +1318,8 @@ finalize_ref_all_pointers (struct alias_info *ai) { size_t i; - if (global_var) - add_may_alias (ai->ref_all_symbol_mem_tag, global_var); + if (gimple_global_var (cfun)) + add_may_alias (ai->ref_all_symbol_mem_tag, gimple_global_var (cfun)); else { /* First add the real call-clobbered variables. */ @@ -1761,7 +1738,7 @@ setup_pointers_and_addressables (struct alias_info *ai) cleanup passes. */ if (TREE_ADDRESSABLE (var)) { - if (!bitmap_bit_p (addressable_vars, DECL_UID (var)) + if (!bitmap_bit_p (gimple_addressable_vars (cfun), DECL_UID (var)) && TREE_CODE (var) != RESULT_DECL && !is_global_var (var)) { @@ -1781,7 +1758,8 @@ setup_pointers_and_addressables (struct alias_info *ai) for (sv = svars; sv; sv = sv->next) { - if (bitmap_bit_p (addressable_vars, DECL_UID (sv->var))) + if (bitmap_bit_p (gimple_addressable_vars (cfun), + DECL_UID (sv->var))) okay_to_mark = false; mark_sym_for_renaming (sv->var); } @@ -1902,11 +1880,11 @@ maybe_create_global_var (struct alias_info *ai) bitmap_iterator bi; /* No need to create it, if we have one already. */ - if (global_var == NULL_TREE) + if (gimple_global_var (cfun) == NULL_TREE) { /* Count all the call-clobbered variables. */ n_clobbered = 0; - EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i, bi) + EXECUTE_IF_SET_IN_BITMAP (gimple_call_clobbered_vars (cfun), 0, i, bi) { n_clobbered++; } @@ -1949,16 +1927,16 @@ maybe_create_global_var (struct alias_info *ai) /* Mark all call-clobbered symbols for renaming. Since the initial rewrite into SSA ignored all call sites, we may need to rename .GLOBAL_VAR and the call-clobbered variables. */ - EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i, bi) + EXECUTE_IF_SET_IN_BITMAP (gimple_call_clobbered_vars (cfun), 0, i, bi) { tree var = referenced_var (i); /* If the function has calls to clobbering functions and .GLOBAL_VAR has been created, make it an alias for all call-clobbered variables. */ - if (global_var && var != global_var) + if (gimple_global_var (cfun) && var != gimple_global_var (cfun)) { - add_may_alias (var, global_var); + add_may_alias (var, gimple_global_var (cfun)); gcc_assert (!get_subvars_for_var (var)); } @@ -2398,8 +2376,8 @@ get_tmt_for (tree ptr, struct alias_info *ai) static void create_global_var (void) { - global_var = build_decl (VAR_DECL, get_identifier (".GLOBAL_VAR"), - void_type_node); + tree global_var = build_decl (VAR_DECL, get_identifier (".GLOBAL_VAR"), + void_type_node); DECL_ARTIFICIAL (global_var) = 1; TREE_READONLY (global_var) = 0; DECL_EXTERNAL (global_var) = 1; @@ -2413,6 +2391,7 @@ create_global_var (void) mark_call_clobbered (global_var, ESCAPE_UNKNOWN); add_referenced_var (global_var); mark_sym_for_renaming (global_var); + cfun->gimple_df->global_var = global_var; } @@ -2622,7 +2601,7 @@ dump_points_to_info (FILE *file) { if (POINTER_TYPE_P (TREE_TYPE (var))) { - tree def = default_def (var); + tree def = gimple_default_def (cfun, var); if (def) dump_points_to_info_for (file, def); } |