diff options
author | Martin Liska <mliska@suse.cz> | 2014-08-25 15:01:47 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2014-08-25 13:01:47 +0000 |
commit | 3dafb85c8e6ade82adc591fe97c116b193f8bb0d (patch) | |
tree | 6efa3ef534f8ca5761c35200d5cc61a819dde6f4 /gcc/ipa-cp.c | |
parent | 3749134042ab5f54d0c30af1ec336e7132ac9bc8 (diff) | |
download | gcc-3dafb85c8e6ade82adc591fe97c116b193f8bb0d.zip gcc-3dafb85c8e6ade82adc591fe97c116b193f8bb0d.tar.gz gcc-3dafb85c8e6ade82adc591fe97c116b193f8bb0d.tar.bz2 |
IPA C++ refactoring 4/N
* cgraph.h (symtab_node):
(bool needed_p (void)): created from decide_is_symbol_needed
(bool referred_to_p (void)): created from referred_to_p
(static cgraph_node *get_for_asmname (tree asmname)): created from symtab_node_for_asm
* cgraph.h (cgraph_node):
(void assemble_thunks_and_aliases (void)): created from assemble_thunks_and_aliases
(void expand (void)): created from expand_function
(static void finalize_function (tree, bool)): created from cgraph_finalize_function
(static cgraph_local_info *local_info (tree decl)): created from cgraph_local_info
(static cgraph_global_info *global_info (tree)): created from cgraph_global_info
(static cgraph_rtl_info *rtl_info (tree)): created from cgraph_rtl_info
* cgraph.h (varpool_node):
(static void add (tree decl): created from varpool_add_new_variable
* cgraph.h (cgraph_edge):
void remove (void);
(void remove_caller (void)): created from cgraph_edge_remove_caller
(void remove_callee (void)): created from cgraph_edge_remove_callee
(void set_call_stmt (gimple new_stmt, bool update_speculative = true)):
created from cgraph_set_call_stmt
(void redirect_callee (cgraph_node *n)): created from cgraph_redirect_edge_callee
(cgraph_edge *make_direct (cgraph_node *callee)): created from cgraph_make_edge_direct
(cgraph_edge *make_speculative (cgraph_node *n2, gcov_type direct_count,
gimple redirect_call_stmt_to_callee (void)): created from cgraph_turn_edge_to_speculative
(void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference)):
created from cgraph_speculative_call_info
(cgraph_edge * clone (cgraph_node *n, gimple call_stmt, unsigned stmt_uid, gcov_type count_scale,
int freq_scale, bool update_original)): created from cgraph_clone_edge
(cgraph_edge *resolve_speculation (tree callee_decl)): created from cgraph_resolve_speculation
(bool cannot_lead_to_return_p (void)): created from cannot_lead_to_return_p
(bool recursive_p (void)): created from cgraph_edge_recursive_p
(bool maybe_hot_p (void)): created from cgraph_maybe_hot_edge_p
(static unsigned int rebuild_edges (void)): created from rebuild_cgraph_edges
(static void rebuild_references (void)): created from cgraph_rebuild_references
* cgraph.h (symbol_table):
(create_reference): renamed from add_reference
(maybe_create_reference): renamed from maybe_add_reference
(void register_symbol (symtab_node *node)): new function
(void clear_asm_symbols (void)): new function
(void unregister (symtab_node *node)): new function
(void release_symbol (cgraph_node *node, int uid)): new function
(cgraph_node * allocate_cgraph_symbol (void)): new function
(void initialize (void)): created from cgraph_init
(symtab_node *first_symbol (void)):new function
(asm_node *first_asm_symbol (void)):new function
(symtab_node *first_defined_symbol (void)):new function
(varpool_node *first_variable (void)):new function
(varpool_node *next_variable (varpool_node *node)):new function
(varpool_node *first_static_initializer (void)):new function
(varpool_node *next_static_initializer (varpool_node *node)):new function
(varpool_node *first_defined_variable (void)):new function
(varpool_node *next_defined_variable (varpool_node *node)):new function
(cgraph_node *first_defined_function (void)):new function
(cgraph_node *next_defined_function (cgraph_node *node)):new function
(cgraph_node *first_function (void)):new function
(cgraph_node *next_function (cgraph_node *node)):new function
(cgraph_node *first_function_with_gimple_body (void)):new function
(asm_node *finalize_toplevel_asm (tree asm_str)): created from add_asm_node
(bool remove_unreachable_nodes (bool before_inlining_p, FILE *file)):
created from symtab_remove_unreachable_nodes
(void remove_unreferenced_decls (void)): created from varpool_remove_unreferenced_decls
(void process_new_functions (void)): created from cgraph_process_new_functions
(void process_same_body_aliases (void)): created from cgraph_process_same_body_aliases
(bool output_variables (void)): created from varpool_node::output_variables
(void output_asm_statements (void)): created from output_asm_statements
(void finalize_compilation_unit (void)): created from finalize_compilation_unit
(void compile (void)): created from compile
(void output_weakrefs (void)): created from output_weakrefs
(cgraph_node *create_empty (void)): created from cgraph_node::create_empty
(cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt,
gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_node::create_edge
(void free_edge (cgraph_edge *e)): created from cgraph_free_edge
(cgraph_node *next_function_with_gimple_body (cgraph_node *node)):
created from cgraph_next_function_with_gimple_body
(void remove_edge_removal_hook (cgraph_edge_hook_list *)):
created from cgraph_remove_edge_removal_hook
(cgraph_node_hook_list *add_cgraph_removal_hook (cgraph_node_hook, void *)):
created from cgraph_add_node_removal_hook
(void remove_cgraph_removal_hook (cgraph_node_hook_list *)):
created from cgraph_remove_node_removal_hook
(varpool_node_hook_list *add_varpool_removal_hook (varpool_node_hook, void *)):
created from varpool_add_node_removal_hook
(void remove_varpool_removal_hook (varpool_node_hook_list *)):
created from varpool_remove_node_removal_hook
(cgraph_node_hook_list *add_cgraph_insertion_hook (cgraph_node_hook, void *)):
created from cgraph_add_function_insertion_hook
(void remove_cgraph_insertion_hook (cgraph_node_hook_list *)):
created from cgraph_remove_function_insertion_hook
(varpool_node_hook_list *add_varpool_insertion_hook (varpool_node_hook, void *)):
created from varpool_add_variable_insertion_hook
(void remove_varpool_insertion_hook (varpool_node_hook_list *)):
created from varpool_remove_variable_insertion_hook
(cgraph_2edge_hook_list *add_edge_duplication_hook (cgraph_2edge_hook, void *)):
created from cgraph_add_edge_duplication_hook
(void remove_edge_duplication_hook (cgraph_2edge_hook_list *)):
created from cgraph_remove_edge_duplication_hook
(cgraph_2node_hook_list *add_cgraph_duplication_hook (cgraph_2node_hook, void *)):
created from cgraph_add_node_duplication_hook
(void remove_cgraph_duplication_hook (cgraph_2node_hook_list *)):
created from cgraph_remove_node_duplication_hook
(void call_edge_removal_hooks (cgraph_edge *e)):
created from cgraph_call_edge_removal_hooks
(void call_cgraph_insertion_hooks (cgraph_node *node)):
created from call_function_insertion_hooks
(void call_cgraph_removal_hooks (cgraph_node *node)):
created from cgraph_call_node_removal_hooks
(void call_cgraph_duplication_hooks (cgraph_node *node, cgraph_node *node2)):
created from cgraph_node::call_duplication_hooks
(void call_edge_duplication_hooks (cgraph_edge *cs1, cgraph_edge *cs2)):
created from cgraph_call_edge_duplication_hooks
(void call_varpool_removal_hooks (varpool_node *node)):
created from varpool_call_node_removal_hooks
(void call_varpool_insertion_hooks (varpool_node *node)):
created from varpool_call_variable_insertion_hooks
(void insert_to_assembler_name_hash (symtab_node *node, bool with_clones)):
created from insert_to_assembler_name_hash
(void unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)):
created from unlink_from_assembler_name_hash
(void symtab_prevail_in_asm_name_hash (symtab_node *node)):
created from symtab_prevail_in_asm_name_hash
(void symtab_initialize_asm_name_hash (void)):
created from symtab_initialize_asm_name_hash
(void change_decl_assembler_name (tree decl, tree name)):
created from change_decl_assembler_name
(void materialize_all_clones (void)): created from cgraph_materialize_all_clones
(static hashval_t decl_assembler_name_hash (const_tree asmname)):
created from decl_assembler_name_hash
(static bool decl_assembler_name_equal (tree decl, const_tree asmname)):
created from decl_assembler_name_equal
(static hashval_t hash_node_by_assembler_name (const void *p)):
created from hash_node_by_assembler_name
(static int eq_assembler_name (const void *p1, const void *p2)):
created from eq_assembler_name
From-SVN: r214422
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r-- | gcc/ipa-cp.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 8d3d6ed..44d4c9a 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -498,7 +498,7 @@ gather_caller_stats (struct cgraph_node *node, void *data) stats->count_sum += cs->count; stats->freq_sum += cs->frequency; stats->n_calls++; - if (cgraph_maybe_hot_edge_p (cs)) + if (cs->maybe_hot_p ()) stats->n_hot_calls ++; } return false; @@ -585,8 +585,9 @@ struct topo_info static void build_toporder_info (struct topo_info *topo) { - topo->order = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes); - topo->stack = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes); + topo->order = XCNEWVEC (struct cgraph_node *, symtab->cgraph_count); + topo->stack = XCNEWVEC (struct cgraph_node *, symtab->cgraph_count); + topo->stack_top = 0; topo->nnodes = ipa_reduced_postorder (topo->order, true, true, NULL); } @@ -2284,7 +2285,7 @@ propagate_effects (void) for (val = base; val; val = val->scc_next) for (src = val->sources; src; src = src->next) if (src->val - && cgraph_maybe_hot_edge_p (src->cs)) + && src->cs->maybe_hot_p ()) { src->val->prop_time_benefit = safe_add (time, src->val->prop_time_benefit); @@ -2415,11 +2416,11 @@ static inline void grow_edge_clone_vectors (void) { if (next_edge_clone.length () - <= (unsigned) cgraph_edge_max_uid) - next_edge_clone.safe_grow_cleared (cgraph_edge_max_uid + 1); + <= (unsigned) symtab->edges_max_uid) + next_edge_clone.safe_grow_cleared (symtab->edges_max_uid + 1); if (prev_edge_clone.length () - <= (unsigned) cgraph_edge_max_uid) - prev_edge_clone.safe_grow_cleared (cgraph_edge_max_uid + 1); + <= (unsigned) symtab->edges_max_uid) + prev_edge_clone.safe_grow_cleared (symtab->edges_max_uid + 1); } /* Edge duplication hook to grow the appropriate linked list in @@ -2555,7 +2556,7 @@ get_info_about_necessary_edges (struct ipcp_value *val, int *freq_sum, count++; freq += cs->frequency; cnt += cs->count; - hot |= cgraph_maybe_hot_edge_p (cs); + hot |= cs->maybe_hot_p (); } cs = get_next_cgraph_edge_clone (cs); } @@ -2805,7 +2806,7 @@ create_specialized_node (struct cgraph_node *node, args_to_skip, "constprop"); ipa_set_node_agg_value_chain (new_node, aggvals); for (av = aggvals; av; av = av->next) - new_node->maybe_add_reference (av->value, IPA_REF_ADDR, NULL); + new_node->maybe_create_reference (av->value, IPA_REF_ADDR, NULL); if (dump_file && (dump_flags & TDF_DETAILS)) { @@ -3366,7 +3367,7 @@ perhaps_add_new_callers (struct cgraph_node *node, struct ipcp_value *val) xstrdup (val->spec_node->name ()), val->spec_node->order); - cgraph_redirect_edge_callee (cs, val->spec_node); + cs->redirect_callee (val->spec_node); redirected_sum += cs->count; } } @@ -3687,9 +3688,9 @@ ipcp_driver (void) ipa_check_create_edge_args (); grow_edge_clone_vectors (); edge_duplication_hook_holder = - cgraph_add_edge_duplication_hook (&ipcp_edge_duplication_hook, NULL); + symtab->add_edge_duplication_hook (&ipcp_edge_duplication_hook, NULL); edge_removal_hook_holder = - cgraph_add_edge_removal_hook (&ipcp_edge_removal_hook, NULL); + symtab->add_edge_removal_hook (&ipcp_edge_removal_hook, NULL); ipcp_values_pool = create_alloc_pool ("IPA-CP values", sizeof (struct ipcp_value), 32); @@ -3716,8 +3717,8 @@ ipcp_driver (void) /* Free all IPCP structures. */ free_toporder_info (&topo); next_edge_clone.release (); - cgraph_remove_edge_removal_hook (edge_removal_hook_holder); - cgraph_remove_edge_duplication_hook (edge_duplication_hook_holder); + symtab->remove_edge_removal_hook (edge_removal_hook_holder); + symtab->remove_edge_duplication_hook (edge_duplication_hook_holder); ipa_free_all_structures_after_ipa_cp (); if (dump_file) fprintf (dump_file, "\nIPA constant propagation end\n"); |