diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-02 08:14:54 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-02 08:14:54 +0000 |
commit | b03e5397ebfc144f07ed98d5f2483fe4652b1f1f (patch) | |
tree | 2d5192c2c186651200e37d636c85698c0eb873d5 /gcc/tree-dfa.c | |
parent | 26f0a6e0fce19aa0d749889b6810d12b2d15507a (diff) | |
download | gcc-b03e5397ebfc144f07ed98d5f2483fe4652b1f1f.tar.gz |
2012-08-02 Richard Guenther <rguenther@suse.de>
* tree-dfa.c (referenced_var_lookup): Remove.
(find_referenced_vars): Remove.
(pass_referenced_vars): Likewise.
(make_rename_temp): Do not add referenced vars.
(dump_referenced_vars): Remove.
(debug_referenced_vars): Likewise.
(dump_dfa_stats): Do not dump referenced var stats.
(find_vars_r): Remove.
(find_referenced_vars_in): Likewise.
(referenced_var_check_and_insert): Likewise.
(add_referenced_var_1): Likewise.
(remove_referenced_var): Likewise.
* tree-flow.h (referenced_var_lookup): Likewise.
(struct gimple_df): Remove referenced_vars member.
(typedef referenced_var_iterator): Remove.
(FOR_EACH_REFERENCED_VAR): Likewise.
(num_referenced_vars): Likewise.
(debug_referenced_vars, dump_referenced_vars): Likewise.
(add_referenced_var_1, add_referenced_var): Likewise.
(remove_referenced_var): Likewise.
(find_referenced_vars_in): Likewise.
* tree-flow-inline.h (gimple_referenced_vars): Remove.
(first_referenced_var): Likewise.
(end_referenced_vars_p): Likewise.
(next_referenced_var): Likewise.
* cfgexpand.c (update_alias_info_with_stack_vars): Remove assert.
* gimple-pretty-print.c (pp_points_to_solution): Dump UIDs
unconditionally.
* tree-into-ssa.c (dump_decl_set): Likewise.
(pass_build_ssa): Do not require PROP_referenced_vars.
* tree-ssa.c (target_for_debug_bind): Virtual operands are
not suitable, but all register type vars are.
(init_tree_ssa): Do not allocate referenced vars.
(delete_tree_ssa): Do not free referenced vars.
* cgraphunit.c (init_lowered_empty_function): Do not set
PROP_referenced_vars.
(assemble_thunk): Do not add referenced vars.
* gimple-fold.c (canonicalize_constructor_val): Likewise.
(gimplify_and_update_call_from_tree): Likewise.
* gimple-streamer-in.c (input_bb): Likewise.
* passes.c (init_optimization_passes): Do not run
pass_referenced_vars.
(dump_properties): Do not dump PROP_referenced_vars.
* tree-inline.c (remap_decl): Do not add referenced vars.
(remap_gimple_op_r): Likewise.
(copy_tree_body_r): Likewise.
(copy_bb): Likewise.
(setup_one_parameter): Likewise.
(declare_return_variable): Likewise.
(copy_decl_for_dup_finish): Likewise.
(copy_arguments_for_versioning): Likewise.
(tree_function_versioning): Likewise.
* tree-pass.h (PROP_referenced_vars): Remove.
(pass_referenced_vars): Likewise.
* tree-profile.c (gimple_gen_edge_profiler): Do not add referenced vars.
(gimple_gen_interval_profiler): Likewise.
(gimple_gen_pow2_profiler): Likewise.
(gimple_gen_one_value_profiler): Likewise.
(gimple_gen_ic_profiler): Likewise.
(gimple_gen_average_profiler): Likewise.
(gimple_gen_ior_profiler): Likewise.
* tree-ssa-live.c (remove_unused_locals): Do not touch referenced vars.
* tree-cfg.c (replace_ssa_name): Do not add referenced vars.
(move_stmt_op): Likewise.
* tree-ssa-operands.c (create_vop_var): Likewise.
* gimple-low.c (record_vars_into): Likewise.
* gimplify.c (gimple_regimplify_operands): Likewise.
(force_gimple_operand_1): Likewise.
* omp-low.c (expand_omp_for_generic): Likewise.
(expand_omp_for_static_chunk): Likewise.
(expand_omp_atomic_pipeline): Likewise.
* graphite-clast-to-gimple.c (graphite_create_new_loop): Likewise.
(translate_clast_assignment): Likewise.
* graphite-sese-to-poly.c (create_zero_dim_array): Likewise.
(handle_scalar_deps_crossing_scop_limits): Likewise.
* ipa-prop.c (ipa_modify_formal_parameters): Likewise.
* ipa-split.c (split_function): Likewise.
* matrix-reorg.c (transform_access_sites): Likewise.
* trans-mem.c (tm_log_add): Likewise.
(ipa_tm_insert_gettmclone_call): Likewise.
* tree-complex.c (create_one_component_var): Likewise.
* tree-if-conv.c (ifc_temp_var): Likewise.
* tree-parloops.c (take_address_of): Likewise.
(initialize_reductions): Likewise.
(separate_decls_in_region_name): Likewise.
(create_call_for_reduction_1): Likewise.
(separate_decls_in_region): Likewise.
* tree-predcom.c (predcom_tmp_var): Likewise.
(reassociate_to_the_same_stmt): Likewise.
* tree-sra.c (build_ref_for_offset): Likewise.
(create_access_replacement): Likewise.
(get_replaced_param_substitute): Likewise.
(sra_ipa_reset_debug_stmts): Likewise.
* tree-ssa-loop-im.c (rewrite_reciprocal): Likewise.
(rewrite_bittest): Likewise.
* tree-ssa-loop-ivopts.c (create_new_iv): Likewise.
* tree-ssa-loop-manip.c (create_iv): Likewise.
(tree_transform_and_unroll_loop): Likewise.
* tree-ssa-math-opts.c (powi_as_mults): Likewise.
(build_and_insert_call): Likewise.
(gimple_expand_builtin_cabs): Likewise.
(execute_optimize_bswap): Likewise.
* tree-ssa-phiopt.c (conditional_replacement): Likewise.
(abs_replacement): Likewise.
(cond_store_replacement): Likewise.
(cond_if_else_store_replacement_1): Likewise.
* tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
* tree-ssa-pre.c (get_representative_for): Likewise.
(create_expression_by_pieces): Likewise.
(insert_into_preds_of_block): Likewise.
* tree-ssa-propagate.c (update_call_from_tree): Likewise.
* tree-ssa-reassoc.c (undistribute_ops_list): Likewise.
(eliminate_redundant_comparison): Likewise.
(rewrite_expr_tree_parallel): Likewise.
(get_reassoc_pow_ssa_name): Likewise.
* tree-ssa-strlen.c (get_string_length): Likewise.
* tree-switch-conversion.c (emit_case_bit_tests): Likewise.
(build_arrays): Likewise.
* tree-tailcall.c (adjust_return_value_with_ops): Likewise.
(create_tailcall_accumulator): Likewise.
* tree-vect-data-refs.c (vect_get_new_vect_var): Likewise.
(vect_create_addr_base_for_vector_ref): Likewise.
(vect_permute_store_chain): Likewise.
(vect_permute_load_chain): Likewise.
* tree-vect-generic.c (expand_vector_divmod): Likewise.
* tree-vect-loop-manip.c (set_prologue_iterations): Likewise.
(vect_build_loop_niters): Likewise.
(vect_generate_tmps_on_preheader): Likewise.
(vect_update_ivs_after_vectorizer): Likewise.
(vect_gen_niters_for_prolog_loop): Likewise.
(vect_do_peeling_for_alignment): Likewise.
(vect_create_cond_for_align_checks): Likewise.
* tree-vect-patterns.c (vect_recog_temp_ssa_var): Likewise.
(vect_handle_widen_op_by_const): Likewise.
(vect_operation_fits_smaller_type): Likewise.
(vect_recog_over_widening_pattern): Likewise.
* tree-vect-stmts.c (vect_init_vector): Likewise.
* gcc.dg/torture/pta-callused-1.c: Adjust.
* gcc.dg/torture/pta-ptrarith-3.c: Likewise.
* gcc.dg/torture/ssa-pta-fn-1.c: Likewise.
* gcc.dg/tree-ssa/alias-19.c: Likewise.
* gcc.dg/tree-ssa/pta-escape-1.c: Likewise.
* gcc.dg/tree-ssa/pta-escape-2.c: Likewise.
* gcc.dg/tree-ssa/pta-escape-3.c: Likewise.
* gcc.dg/tree-ssa/pta-ptrarith-1.c: Likewise.
* gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190067 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r-- | gcc/tree-dfa.c | 227 |
1 files changed, 1 insertions, 226 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 38c4aea44c4..39555ce4bac 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -63,56 +63,6 @@ static void collect_dfa_stats (struct dfa_stats_d *); /*--------------------------------------------------------------------------- Dataflow analysis (DFA) routines ---------------------------------------------------------------------------*/ -/* Find all the variables referenced in the function. This function - builds the global arrays REFERENCED_VARS and CALL_CLOBBERED_VARS. - - Note that this function does not look for statement operands, it simply - determines what variables are referenced in the program and detects - various attributes for each variable used by alias analysis and the - optimizer. */ - -static unsigned int -find_referenced_vars (void) -{ - basic_block bb; - gimple_stmt_iterator si; - - FOR_EACH_BB (bb) - { - for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si)) - { - gimple stmt = gsi_stmt (si); - if (is_gimple_debug (stmt)) - continue; - find_referenced_vars_in (gsi_stmt (si)); - } - - for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si)) - find_referenced_vars_in (gsi_stmt (si)); - } - - return 0; -} - -struct gimple_opt_pass pass_referenced_vars = -{ - { - GIMPLE_PASS, - "*referenced_vars", /* name */ - NULL, /* gate */ - find_referenced_vars, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_FIND_REFERENCED_VARS, /* tv_id */ - PROP_gimple_leh | PROP_cfg, /* properties_required */ - PROP_referenced_vars, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - 0 /* todo_flags_finish */ - } -}; - /* Renumber all of the gimple stmt uids. */ @@ -169,12 +119,7 @@ renumber_gimple_stmt_uids_in_blocks (basic_block *blocks, int n_blocks) tree make_rename_temp (tree type, const char *prefix) { - tree t = create_tmp_reg (type, prefix); - - if (gimple_referenced_vars (cfun)) - add_referenced_var (t); - - return t; + return create_tmp_reg (type, prefix); } @@ -182,36 +127,6 @@ make_rename_temp (tree type, const char *prefix) /*--------------------------------------------------------------------------- Debugging functions ---------------------------------------------------------------------------*/ -/* Dump the list of all the referenced variables in the current function to - FILE. */ - -void -dump_referenced_vars (FILE *file) -{ - tree var; - referenced_var_iterator rvi; - - fprintf (file, "\nReferenced variables in %s: %u\n\n", - get_name (current_function_decl), (unsigned) num_referenced_vars); - - FOR_EACH_REFERENCED_VAR (cfun, var, rvi) - { - fprintf (file, "Variable: "); - dump_variable (file, var); - } - - fprintf (file, "\n"); -} - - -/* Dump the list of all the referenced variables to stderr. */ - -DEBUG_FUNCTION void -debug_referenced_vars (void) -{ - dump_referenced_vars (stderr); -} - /* Dump variable VAR and its may-aliases to FILE. */ @@ -297,11 +212,6 @@ dump_dfa_stats (FILE *file) fprintf (file, fmt_str, "", " instances ", "used "); fprintf (file, "---------------------------------------------------------\n"); - size = num_referenced_vars * sizeof (tree); - total += size; - fprintf (file, fmt_str_1, "Referenced variables", (unsigned long)num_referenced_vars, - SCALE (size), LABEL (size)); - size = dfa_stats.num_uses * sizeof (tree *); total += size; fprintf (file, fmt_str_1, "USE operands", dfa_stats.num_uses, @@ -397,97 +307,6 @@ collect_dfa_stats (struct dfa_stats_d *dfa_stats_p ATTRIBUTE_UNUSED) /*--------------------------------------------------------------------------- Miscellaneous helpers ---------------------------------------------------------------------------*/ -/* Callback for walk_tree. Used to collect variables referenced in - the function. */ - -static tree -find_vars_r (tree *tp, int *walk_subtrees, void *data) -{ - struct function *fn = (struct function *) data; - - /* If we are reading the lto info back in, we need to rescan the - referenced vars. */ - if (TREE_CODE (*tp) == SSA_NAME) - add_referenced_var_1 (SSA_NAME_VAR (*tp), fn); - - /* If T is a regular variable that the optimizers are interested - in, add it to the list of variables. */ - else if ((TREE_CODE (*tp) == VAR_DECL - && !is_global_var (*tp)) - || TREE_CODE (*tp) == PARM_DECL - || TREE_CODE (*tp) == RESULT_DECL) - add_referenced_var_1 (*tp, fn); - - /* Type, _DECL and constant nodes have no interesting children. - Ignore them. */ - else if (IS_TYPE_OR_DECL_P (*tp) || CONSTANT_CLASS_P (*tp)) - *walk_subtrees = 0; - - return NULL_TREE; -} - -/* Find referenced variables in STMT. */ - -void -find_referenced_vars_in (gimple stmt) -{ - size_t i; - - if (gimple_code (stmt) != GIMPLE_PHI) - { - for (i = 0; i < gimple_num_ops (stmt); i++) - walk_tree (gimple_op_ptr (stmt, i), find_vars_r, cfun, NULL); - } - else - { - walk_tree (gimple_phi_result_ptr (stmt), find_vars_r, cfun, NULL); - - for (i = 0; i < gimple_phi_num_args (stmt); i++) - { - tree arg = gimple_phi_arg_def (stmt, i); - walk_tree (&arg, find_vars_r, cfun, NULL); - } - } -} - - -/* Lookup UID in the referenced_vars hashtable and return the associated - variable. */ - -tree -referenced_var_lookup (struct function *fn, unsigned int uid) -{ - tree h; - struct tree_decl_minimal in; - in.uid = uid; - h = (tree) htab_find_with_hash (gimple_referenced_vars (fn), &in, uid); - return h; -} - -/* Check if TO is in the referenced_vars hash table and insert it if not. - Return true if it required insertion. */ - -static bool -referenced_var_check_and_insert (tree to, struct function *fn) -{ - tree *loc; - struct tree_decl_minimal in; - unsigned int uid = DECL_UID (to); - - in.uid = uid; - loc = (tree *) htab_find_slot_with_hash (gimple_referenced_vars (fn), - &in, uid, INSERT); - if (*loc) - { - /* DECL_UID has already been entered in the table. Verify that it is - the same entry as TO. See PR 27793. */ - gcc_assert (*loc == to); - return false; - } - - *loc = to; - return true; -} /* Lookup VAR UID in the default_defs hashtable and return the associated variable. */ @@ -536,50 +355,6 @@ set_default_def (tree var, tree def) SSA_NAME_IS_DEFAULT_DEF (def) = true; } -/* Add VAR to the list of referenced variables if it isn't already there. */ - -bool -add_referenced_var_1 (tree var, struct function *fn) -{ - gcc_checking_assert (TREE_CODE (var) == VAR_DECL - || TREE_CODE (var) == PARM_DECL - || TREE_CODE (var) == RESULT_DECL); - - gcc_checking_assert ((TREE_CODE (var) == VAR_DECL - && VAR_DECL_IS_VIRTUAL_OPERAND (var)) - || !is_global_var (var)); - - /* Insert VAR into the referenced_vars hash table if it isn't present - and allocate its var-annotation. */ - if (referenced_var_check_and_insert (var, fn)) - return true; - - return false; -} - -/* Remove VAR from the list of referenced variables and clear its - var-annotation. */ - -void -remove_referenced_var (tree var) -{ - struct tree_decl_minimal in; - void **loc; - unsigned int uid = DECL_UID (var); - - gcc_checking_assert (TREE_CODE (var) == VAR_DECL - || TREE_CODE (var) == PARM_DECL - || TREE_CODE (var) == RESULT_DECL); - - gcc_checking_assert (!is_global_var (var)); - - in.uid = uid; - loc = htab_find_slot_with_hash (gimple_referenced_vars (cfun), &in, uid, - NO_INSERT); - if (loc) - htab_clear_slot (gimple_referenced_vars (cfun), loc); -} - /* If EXP is a handled component reference for a structure, return the base variable. The access range is delimited by bit positions *POFFSET and |