diff options
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r-- | gcc/ipa-inline-analysis.c | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index 02deeb47a38..38f56d2fcd5 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -758,9 +758,8 @@ edge_set_predicate (struct cgraph_edge *e, struct predicate *predicate) { struct cgraph_node *callee = !e->inline_failed ? e->callee : NULL; - cgraph_redirect_edge_callee (e, - cgraph_node::get_create - (builtin_decl_implicit (BUILT_IN_UNREACHABLE))); + e->redirect_callee (cgraph_node::get_create + (builtin_decl_implicit (BUILT_IN_UNREACHABLE))); e->inline_failed = CIF_UNREACHABLE; if (callee) callee->remove_symbol_and_inline_clones (); @@ -961,21 +960,21 @@ inline_summary_alloc (void) { if (!node_removal_hook_holder) node_removal_hook_holder = - cgraph_add_node_removal_hook (&inline_node_removal_hook, NULL); + symtab->add_cgraph_removal_hook (&inline_node_removal_hook, NULL); if (!edge_removal_hook_holder) edge_removal_hook_holder = - cgraph_add_edge_removal_hook (&inline_edge_removal_hook, NULL); + symtab->add_edge_removal_hook (&inline_edge_removal_hook, NULL); if (!node_duplication_hook_holder) node_duplication_hook_holder = - cgraph_add_node_duplication_hook (&inline_node_duplication_hook, NULL); + symtab->add_cgraph_duplication_hook (&inline_node_duplication_hook, NULL); if (!edge_duplication_hook_holder) edge_duplication_hook_holder = - cgraph_add_edge_duplication_hook (&inline_edge_duplication_hook, NULL); + symtab->add_edge_duplication_hook (&inline_edge_duplication_hook, NULL); - if (vec_safe_length (inline_summary_vec) <= (unsigned) cgraph_max_uid) - vec_safe_grow_cleared (inline_summary_vec, cgraph_max_uid + 1); - if (inline_edge_summary_vec.length () <= (unsigned) cgraph_edge_max_uid) - inline_edge_summary_vec.safe_grow_cleared (cgraph_edge_max_uid + 1); + if (vec_safe_length (inline_summary_vec) <= (unsigned) symtab->cgraph_max_uid) + vec_safe_grow_cleared (inline_summary_vec, symtab->cgraph_max_uid + 1); + if (inline_edge_summary_vec.length () <= (unsigned) symtab->edges_max_uid) + inline_edge_summary_vec.safe_grow_cleared (symtab->edges_max_uid + 1); if (!edge_predicate_pool) edge_predicate_pool = create_alloc_pool ("edge predicates", sizeof (struct predicate), 10); @@ -1291,10 +1290,10 @@ inline_edge_removal_hook (struct cgraph_edge *edge, void initialize_growth_caches (void) { - if (cgraph_edge_max_uid) - edge_growth_cache.safe_grow_cleared (cgraph_edge_max_uid); - if (cgraph_max_uid) - node_growth_cache.safe_grow_cleared (cgraph_max_uid); + if (symtab->edges_max_uid) + edge_growth_cache.safe_grow_cleared (symtab->edges_max_uid); + if (symtab->cgraph_max_uid) + node_growth_cache.safe_grow_cleared (symtab->cgraph_max_uid); } @@ -3019,7 +3018,7 @@ estimate_edge_size_and_time (struct cgraph_edge *e, int *size, int *min_size, if (!e->callee && estimate_edge_devirt_benefit (e, &call_size, &call_time, known_vals, known_binfos, known_aggs) - && hints && cgraph_maybe_hot_edge_p (e)) + && hints && e->maybe_hot_p ()) *hints |= INLINE_HINT_indirect_call; cur_size = call_size * INLINE_SIZE_SCALE; *size += cur_size; @@ -3633,7 +3632,7 @@ simple_edge_hints (struct cgraph_edge *edge) ? edge->caller->global.inlined_to : edge->caller); if (inline_summary (to)->scc_no && inline_summary (to)->scc_no == inline_summary (edge->callee)->scc_no - && !cgraph_edge_recursive_p (edge)) + && !edge->recursive_p ()) hints |= INLINE_HINT_same_scc; if (to->lto_file_data && edge->callee->lto_file_data @@ -3677,7 +3676,7 @@ do_estimate_edge_time (struct cgraph_edge *edge) edges and for those we disable size limits. Don't do that when probability that caller will call the callee is low however, since it may hurt optimization of the caller's hot path. */ - if (edge->count && cgraph_maybe_hot_edge_p (edge) + if (edge->count && edge->maybe_hot_p () && (edge->count * 2 > (edge->caller->global.inlined_to ? edge->caller->global.inlined_to->count : edge->caller->count))) @@ -3694,7 +3693,7 @@ do_estimate_edge_time (struct cgraph_edge *edge) { inline_summary (edge->callee)->min_size = min_size; if ((int) edge_growth_cache.length () <= edge->uid) - edge_growth_cache.safe_grow_cleared (cgraph_edge_max_uid); + edge_growth_cache.safe_grow_cleared (symtab->edges_max_uid); edge_growth_cache[edge->uid].time = time + (time >= 0); edge_growth_cache[edge->uid].size = size + (size >= 0); @@ -3888,7 +3887,7 @@ do_estimate_growth (struct cgraph_node *node) if (node_growth_cache.exists ()) { if ((int) node_growth_cache.length () <= node->uid) - node_growth_cache.safe_grow_cleared (cgraph_max_uid); + node_growth_cache.safe_grow_cleared (symtab->cgraph_max_uid); node_growth_cache[node->uid] = d.growth + (d.growth >= 0); } return d.growth; @@ -4015,7 +4014,7 @@ inline_generate_summary (void) return; function_insertion_hook_holder = - cgraph_add_function_insertion_hook (&add_new_function, NULL); + symtab->add_cgraph_insertion_hook (&add_new_function, NULL); ipa_register_cgraph_hooks (); inline_free_summary (); @@ -4199,7 +4198,7 @@ inline_read_summary (void) ipa_prop_read_jump_functions (); } function_insertion_hook_holder = - cgraph_add_function_insertion_hook (&add_new_function, NULL); + symtab->add_cgraph_insertion_hook (&add_new_function, NULL); } @@ -4332,19 +4331,19 @@ inline_free_summary (void) if (!node->alias) reset_inline_summary (node); if (function_insertion_hook_holder) - cgraph_remove_function_insertion_hook (function_insertion_hook_holder); + symtab->remove_cgraph_insertion_hook (function_insertion_hook_holder); function_insertion_hook_holder = NULL; if (node_removal_hook_holder) - cgraph_remove_node_removal_hook (node_removal_hook_holder); + symtab->remove_cgraph_removal_hook (node_removal_hook_holder); node_removal_hook_holder = NULL; if (edge_removal_hook_holder) - cgraph_remove_edge_removal_hook (edge_removal_hook_holder); + symtab->remove_edge_removal_hook (edge_removal_hook_holder); edge_removal_hook_holder = NULL; if (node_duplication_hook_holder) - cgraph_remove_node_duplication_hook (node_duplication_hook_holder); + symtab->remove_cgraph_duplication_hook (node_duplication_hook_holder); node_duplication_hook_holder = NULL; if (edge_duplication_hook_holder) - cgraph_remove_edge_duplication_hook (edge_duplication_hook_holder); + symtab->remove_edge_duplication_hook (edge_duplication_hook_holder); edge_duplication_hook_holder = NULL; vec_free (inline_summary_vec); inline_edge_summary_vec.release (); |