From 5cd4ec7f24ef2fca4e1e27836e5eee7b15b8abd8 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 28 Nov 2006 15:42:37 +0100 Subject: 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 --- gcc/tree-ssa-operands.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'gcc/tree-ssa-operands.c') diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 2c77683..a594d4d 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -1050,12 +1050,12 @@ access_can_touch_variable (tree ref, tree alias, HOST_WIDE_INT offset, /* If ALIAS is .GLOBAL_VAR then the memory reference REF must be using a call-clobbered memory tag. By definition, call-clobbered memory tags can always touch .GLOBAL_VAR. */ - if (alias == global_var) + if (alias == gimple_global_var (cfun)) return true; /* We cannot prune nonlocal aliases because they are not type specific. */ - if (alias == nonlocal_all) + if (alias == gimple_nonlocal_all (cfun)) return true; /* If ALIAS is an SFT, it can't be touched if the offset @@ -1317,7 +1317,7 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags, set on it, or else we will get the wrong answer on clobbers. */ if (none_added - && !updating_used_alone && aliases_computed_p + && !updating_used_alone && gimple_aliases_computed_p (cfun) && TREE_CODE (var) == SYMBOL_MEMORY_TAG) gcc_assert (SMT_USED_ALONE (var)); @@ -1552,9 +1552,10 @@ add_call_clobber_ops (tree stmt, tree callee) /* If we created .GLOBAL_VAR earlier, just use it. See compute_may_aliases for the heuristic used to decide whether to create .GLOBAL_VAR or not. */ - if (global_var) + if (gimple_global_var (cfun)) { - add_stmt_operand (&global_var, s_ann, opf_is_def); + tree var = gimple_global_var (cfun); + add_stmt_operand (&var, s_ann, opf_is_def); return; } @@ -1564,7 +1565,7 @@ add_call_clobber_ops (tree stmt, tree callee) not_read_b = callee ? ipa_reference_get_not_read_global (callee) : NULL; not_written_b = callee ? ipa_reference_get_not_written_global (callee) : NULL; /* Add a V_MAY_DEF operand for every call clobbered variable. */ - EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, u, bi) + EXECUTE_IF_SET_IN_BITMAP (gimple_call_clobbered_vars (cfun), 0, u, bi) { tree var = referenced_var_lookup (u); unsigned int escape_mask = var_ann (var)->escape_mask; @@ -1633,16 +1634,17 @@ add_call_read_ops (tree stmt, tree callee) /* if the function is not pure, it may reference memory. Add a VUSE for .GLOBAL_VAR if it has been created. See add_referenced_var for the heuristic used to decide whether to create .GLOBAL_VAR. */ - if (global_var) + if (gimple_global_var (cfun)) { - add_stmt_operand (&global_var, s_ann, opf_none); + tree var = gimple_global_var (cfun); + add_stmt_operand (&var, s_ann, opf_none); return; } not_read_b = callee ? ipa_reference_get_not_read_global (callee) : NULL; /* Add a VUSE for each call-clobbered variable. */ - EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, u, bi) + EXECUTE_IF_SET_IN_BITMAP (gimple_call_clobbered_vars (cfun), 0, u, bi) { tree var = referenced_var (u); tree real_var = var; @@ -1688,8 +1690,8 @@ get_call_expr_operands (tree stmt, tree expr) computed. By not bothering with virtual operands for CALL_EXPRs we avoid adding superfluous virtual operands, which can be a significant compile time sink (See PR 15855). */ - if (aliases_computed_p - && !bitmap_empty_p (call_clobbered_vars) + if (gimple_aliases_computed_p (cfun) + && !bitmap_empty_p (gimple_call_clobbered_vars (cfun)) && !(call_flags & ECF_NOVOPS)) { /* A 'pure' or a 'const' function never call-clobbers anything. @@ -1776,17 +1778,20 @@ get_asm_expr_operands (tree stmt) /* Clobber all call-clobbered variables (or .GLOBAL_VAR if we decided to group them). */ - if (global_var) - add_stmt_operand (&global_var, s_ann, opf_is_def); + if (gimple_global_var (cfun)) + { + tree var = gimple_global_var (cfun); + add_stmt_operand (&var, s_ann, opf_is_def); + } else - 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); add_stmt_operand (&var, s_ann, opf_is_def | opf_non_specific); } /* Now clobber all addressables. */ - EXECUTE_IF_SET_IN_BITMAP (addressable_vars, 0, i, bi) + EXECUTE_IF_SET_IN_BITMAP (gimple_addressable_vars (cfun), 0, i, bi) { tree var = referenced_var (i); -- cgit v1.1