diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-28 14:42:37 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-28 14:42:37 +0000 |
commit | 2d04fd8dddd64aae0c58fcbe0b5793dcd8854b2e (patch) | |
tree | 5e09813d89b6e045357e6ee37686e9b16cf2a1ec /gcc/tree-flow-inline.h | |
parent | b763e9983191134f98d404fc252aafee69ef806f (diff) | |
download | gcc-2d04fd8dddd64aae0c58fcbe0b5793dcd8854b2e.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119294 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-flow-inline.h')
-rw-r--r-- | gcc/tree-flow-inline.h | 81 |
1 files changed, 74 insertions, 7 deletions
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h index ceb1bc91869..ae937b1c9b9 100644 --- a/gcc/tree-flow-inline.h +++ b/gcc/tree-flow-inline.h @@ -25,6 +25,72 @@ Boston, MA 02110-1301, USA. */ /* Inline functions for manipulating various data structures defined in tree-flow.h. See tree-flow.h for documentation. */ +/* Return true when gimple SSA form was built. + gimple_in_ssa_p is queried by gimplifier in various early stages before SSA + infrastructure is initialized. Check for presence of the datastructures + at first place. */ +static inline bool +gimple_in_ssa_p (struct function *fun) +{ + return fun && fun->gimple_df && fun->gimple_df->in_ssa_p; +} + +/* 'true' after aliases have been computed (see compute_may_aliases). */ +static inline bool +gimple_aliases_computed_p (struct function *fun) +{ + gcc_assert (fun && fun->gimple_df); + return fun->gimple_df->aliases_computed_p; +} + +/* 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). */ +static inline bitmap +gimple_addressable_vars (struct function *fun) +{ + gcc_assert (fun && fun->gimple_df); + return fun->gimple_df->addressable_vars; +} + +/* Call clobbered variables in the function. If bit I is set, then + REFERENCED_VARS (I) is call-clobbered. */ +static inline bitmap +gimple_call_clobbered_vars (struct function *fun) +{ + gcc_assert (fun && fun->gimple_df); + return fun->gimple_df->call_clobbered_vars; +} + +/* Array of all variables referenced in the function. */ +static inline htab_t +gimple_referenced_vars (struct function *fun) +{ + if (!fun->gimple_df) + return NULL; + return fun->gimple_df->referenced_vars; +} + +/* Artificial variable used to model the effects of function calls. */ +static inline tree +gimple_global_var (struct function *fun) +{ + gcc_assert (fun && fun->gimple_df); + return fun->gimple_df->global_var; +} + +/* Artificial variable used to model the effects of nonlocal + variables. */ +static inline tree +gimple_nonlocal_all (struct function *fun) +{ + gcc_assert (fun && fun->gimple_df); + return fun->gimple_df->nonlocal_all; +} /* Initialize the hashtable iterator HTI to point to hashtable TABLE */ static inline void * @@ -79,7 +145,8 @@ first_referenced_var (referenced_var_iterator *iter) { struct int_tree_map *itm; itm = (struct int_tree_map *) first_htab_element (&iter->hti, - referenced_vars); + gimple_referenced_vars + (cfun)); if (!itm) return NULL; return itm->to; @@ -278,8 +345,8 @@ mark_stmt_modified (tree t) ann = stmt_ann (t); if (ann == NULL) ann = create_stmt_ann (t); - else if (noreturn_call_p (t)) - VEC_safe_push (tree, gc, modified_noreturn_calls, t); + else if (noreturn_call_p (t) && cfun->gimple_df) + VEC_safe_push (tree, gc, MODIFIED_NORETURN_CALLS (cfun), t); ann->modified = 1; } @@ -760,7 +827,7 @@ is_call_clobbered (tree var) if (!MTAG_P (var)) return DECL_CALL_CLOBBERED (var); else - return bitmap_bit_p (call_clobbered_vars, DECL_UID (var)); + return bitmap_bit_p (gimple_call_clobbered_vars (cfun), DECL_UID (var)); } /* Mark variable VAR as being clobbered by function calls. */ @@ -770,7 +837,7 @@ mark_call_clobbered (tree var, unsigned int escape_type) var_ann (var)->escape_mask |= escape_type; if (!MTAG_P (var)) DECL_CALL_CLOBBERED (var) = true; - bitmap_set_bit (call_clobbered_vars, DECL_UID (var)); + bitmap_set_bit (gimple_call_clobbered_vars (cfun), DECL_UID (var)); } /* Clear the call-clobbered attribute from variable VAR. */ @@ -783,7 +850,7 @@ clear_call_clobbered (tree var) MTAG_GLOBAL (var) = 0; if (!MTAG_P (var)) DECL_CALL_CLOBBERED (var) = false; - bitmap_clear_bit (call_clobbered_vars, DECL_UID (var)); + bitmap_clear_bit (gimple_call_clobbered_vars (cfun), DECL_UID (var)); } /* Mark variable VAR as being non-addressable. */ @@ -792,7 +859,7 @@ mark_non_addressable (tree var) { if (!MTAG_P (var)) DECL_CALL_CLOBBERED (var) = false; - bitmap_clear_bit (call_clobbered_vars, DECL_UID (var)); + bitmap_clear_bit (gimple_call_clobbered_vars (cfun), DECL_UID (var)); TREE_ADDRESSABLE (var) = 0; } |