diff options
author | Martin Liska <mliska@suse.cz> | 2018-06-08 14:11:48 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-06-08 12:11:48 +0000 |
commit | 99353fcfe4f50d131fae9978ce9cd19bcaf243cf (patch) | |
tree | fbbefc6f259347afb53703958f7a24081975a0cd /gcc/ipa-inline.c | |
parent | 2a281178f70c38d796c8ec77e049f8139e1110fc (diff) | |
download | gcc-99353fcfe4f50d131fae9978ce9cd19bcaf243cf.zip gcc-99353fcfe4f50d131fae9978ce9cd19bcaf243cf.tar.gz gcc-99353fcfe4f50d131fae9978ce9cd19bcaf243cf.tar.bz2 |
Rename get methods in symbol-summary.h to get_create.
2018-06-08 Martin Liska <mliska@suse.cz>
* config/i386/i386.c (ix86_can_inline_p): Use get_create instead
of get.
* hsa-common.c (hsa_summary_t::link_functions): Likewise.
(hsa_register_kernel): Likewise.
* hsa-common.h (hsa_gpu_implementation_p): Likewise.
* hsa-gen.c (hsa_get_host_function): Likewise.
(get_brig_function_name): Likewise.
(generate_hsa): Likewise.
(pass_gen_hsail::execute): Likewise.
* ipa-cp.c (ipcp_cloning_candidate_p): Likewise.
(devirtualization_time_bonus): Likewise.
(ipcp_propagate_stage): Likewise.
* ipa-fnsummary.c (redirect_to_unreachable): Likewise.
(edge_set_predicate): Likewise.
(evaluate_conditions_for_known_args): Likewise.
(evaluate_properties_for_edge): Likewise.
(ipa_fn_summary::reset): Likewise.
(ipa_fn_summary_t::duplicate): Likewise.
(dump_ipa_call_summary): Likewise.
(ipa_dump_fn_summary): Likewise.
(analyze_function_body): Likewise.
(compute_fn_summary): Likewise.
(estimate_edge_devirt_benefit): Likewise.
(estimate_edge_size_and_time): Likewise.
(estimate_calls_size_and_time): Likewise.
(estimate_node_size_and_time): Likewise.
(inline_update_callee_summaries): Likewise.
(remap_edge_change_prob): Likewise.
(remap_edge_summaries): Likewise.
(ipa_merge_fn_summary_after_inlining): Likewise.
(ipa_update_overall_fn_summary): Likewise.
(read_ipa_call_summary): Likewise.
(inline_read_section): Likewise.
(write_ipa_call_summary): Likewise.
(ipa_fn_summary_write): Likewise.
(ipa_free_fn_summary): Likewise.
* ipa-hsa.c (process_hsa_functions): Likewise.
(ipa_hsa_write_summary): Likewise.
(ipa_hsa_read_section): Likewise.
* ipa-icf.c (sem_function::merge): Likewise.
* ipa-inline-analysis.c (simple_edge_hints): Likewise.
(do_estimate_edge_time): Likewise.
(estimate_size_after_inlining): Likewise.
(estimate_growth): Likewise.
(growth_likely_positive): Likewise.
* ipa-inline-transform.c (clone_inlined_nodes): Likewise.
(inline_call): Likewise.
* ipa-inline.c (caller_growth_limits): Likewise.
(can_inline_edge_p): Likewise.
(can_inline_edge_by_limits_p): Likewise.
(compute_uninlined_call_time): Likewise.
(compute_inlined_call_time): Likewise.
(want_inline_small_function_p): Likewise.
(edge_badness): Likewise.
(update_caller_keys): Likewise.
(update_callee_keys): Likewise.
(recursive_inlining): Likewise.
(inline_small_functions): Likewise.
(inline_to_all_callers_1): Likewise.
(dump_overall_stats): Likewise.
(early_inline_small_functions): Likewise.
(early_inliner): Likewise.
* ipa-inline.h (estimate_edge_growth): Likewise.
* ipa-profile.c (ipa_propagate_frequency_1): Likewise.
* ipa-prop.c (ipa_make_edge_direct_to_target): Likewise.
* ipa-prop.h (IPA_NODE_REF): Likewise.
(IPA_EDGE_REF): Likewise.
* ipa-pure-const.c (malloc_candidate_p): Likewise.
(propagate_malloc): Likewise.
* ipa-split.c (execute_split_functions): Likewise.
* symbol-summary.h: Rename get to get_create.
(get): Likewise.
(get_create): Likewise.
* tree-sra.c (ipa_sra_preliminary_function_checks): Likewise.
2018-06-08 Martin Liska <mliska@suse.cz>
* lto-partition.c (add_symbol_to_partition_1): Use get_create instead
of get.
(undo_partition): Likewise.
(lto_balanced_map): Likewise.
From-SVN: r261309
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r-- | gcc/ipa-inline.c | 72 |
1 files changed, 37 insertions, 35 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 1d524a9..ffde9b9 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -150,7 +150,8 @@ caller_growth_limits (struct cgraph_edge *e) int newsize; int limit = 0; HOST_WIDE_INT stack_size_limit = 0, inlined_stack; - ipa_fn_summary *info, *what_info, *outer_info = ipa_fn_summaries->get (to); + ipa_fn_summary *info, *what_info; + ipa_fn_summary *outer_info = ipa_fn_summaries->get_create (to); /* Look for function e->caller is inlined to. While doing so work out the largest function body on the way. As @@ -162,7 +163,7 @@ caller_growth_limits (struct cgraph_edge *e) too much in order to prevent compiler from exploding". */ while (true) { - info = ipa_fn_summaries->get (to); + info = ipa_fn_summaries->get_create (to); if (limit < info->self_size) limit = info->self_size; if (stack_size_limit < info->estimated_self_stack_size) @@ -173,7 +174,7 @@ caller_growth_limits (struct cgraph_edge *e) break; } - what_info = ipa_fn_summaries->get (what); + what_info = ipa_fn_summaries->get_create (what); if (limit < what_info->self_size) limit = what_info->self_size; @@ -363,7 +364,7 @@ can_inline_edge_p (struct cgraph_edge *e, bool report, e->inline_failed = CIF_TARGET_OPTION_MISMATCH; inlinable = false; } - else if (!ipa_fn_summaries->get (callee)->inlinable) + else if (!ipa_fn_summaries->get_create (callee)->inlinable) { e->inline_failed = CIF_FUNCTION_NOT_INLINABLE; inlinable = false; @@ -425,8 +426,8 @@ can_inline_edge_by_limits_p (struct cgraph_edge *e, bool report, (DECL_DISREGARD_INLINE_LIMITS (callee->decl) && lookup_attribute ("always_inline", DECL_ATTRIBUTES (callee->decl))); - ipa_fn_summary *caller_info = ipa_fn_summaries->get (caller); - ipa_fn_summary *callee_info = ipa_fn_summaries->get (callee); + ipa_fn_summary *caller_info = ipa_fn_summaries->get_create (caller); + ipa_fn_summary *callee_info = ipa_fn_summaries->get_create (callee); /* Until GCC 4.9 we did not check the semantics alterning flags bellow and inline across optimization boundry. @@ -529,7 +530,7 @@ can_inline_edge_by_limits_p (struct cgraph_edge *e, bool report, > opt_for_fn (caller->decl, optimize))) { if (estimate_edge_time (e) - >= 20 + ipa_call_summaries->get (e)->call_stmt_time) + >= 20 + ipa_call_summaries->get_create (e)->call_stmt_time) { e->inline_failed = CIF_OPTIMIZATION_MISMATCH; inlinable = false; @@ -679,7 +680,7 @@ compute_uninlined_call_time (struct cgraph_edge *edge, else uninlined_call_time = uninlined_call_time >> 11; - sreal caller_time = ipa_fn_summaries->get (caller)->time; + sreal caller_time = ipa_fn_summaries->get_create (caller)->time; return uninlined_call_time + caller_time; } @@ -693,7 +694,7 @@ compute_inlined_call_time (struct cgraph_edge *edge, cgraph_node *caller = (edge->caller->global.inlined_to ? edge->caller->global.inlined_to : edge->caller); - sreal caller_time = ipa_fn_summaries->get (caller)->time; + sreal caller_time = ipa_fn_summaries->get_create (caller)->time; sreal freq = edge->sreal_frequency (); if (freq > 0) @@ -703,7 +704,7 @@ compute_inlined_call_time (struct cgraph_edge *edge, /* This calculation should match one in ipa-inline-analysis.c (estimate_edge_size_and_time). */ - time -= (sreal)ipa_call_summaries->get (edge)->call_stmt_time * freq; + time -= (sreal)ipa_call_summaries->get_create (edge)->call_stmt_time * freq; time += caller_time; if (time <= 0) time = ((sreal) 1) >> 8; @@ -755,8 +756,8 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report) MAX_INLINE_INSNS_SINGLE 16-fold for inline functions. */ else if ((!DECL_DECLARED_INLINE_P (callee->decl) && (!e->count.ipa ().initialized_p () || !e->maybe_hot_p ())) - && ipa_fn_summaries->get (callee)->min_size - - ipa_call_summaries->get (e)->call_stmt_size + && ipa_fn_summaries->get_create (callee)->min_size + - ipa_call_summaries->get_create (e)->call_stmt_size > MAX (MAX_INLINE_INSNS_SINGLE, MAX_INLINE_INSNS_AUTO)) { e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_LIMIT; @@ -764,8 +765,8 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report) } else if ((DECL_DECLARED_INLINE_P (callee->decl) || e->count.ipa ().nonzero_p ()) - && ipa_fn_summaries->get (callee)->min_size - - ipa_call_summaries->get (e)->call_stmt_size + && ipa_fn_summaries->get_create (callee)->min_size + - ipa_call_summaries->get_create (e)->call_stmt_size > 16 * MAX_INLINE_INSNS_SINGLE) { e->inline_failed = (DECL_DECLARED_INLINE_P (callee->decl) @@ -1017,7 +1018,7 @@ edge_badness (struct cgraph_edge *edge, bool dump) int growth; sreal edge_time, unspec_edge_time; struct cgraph_node *callee = edge->callee->ultimate_alias_target (); - struct ipa_fn_summary *callee_info = ipa_fn_summaries->get (callee); + struct ipa_fn_summary *callee_info = ipa_fn_summaries->get_create (callee); ipa_hints hints; cgraph_node *caller = (edge->caller->global.inlined_to ? edge->caller->global.inlined_to @@ -1130,7 +1131,7 @@ edge_badness (struct cgraph_edge *edge, bool dump) && (!DECL_DECLARED_INLINE_P (edge->callee->decl) || DECL_DECLARED_INLINE_P (caller->decl))))) { - struct ipa_fn_summary *caller_info = ipa_fn_summaries->get (caller); + ipa_fn_summary *caller_info = ipa_fn_summaries->get_create (caller); int caller_growth = caller_info->growth; /* Only apply the penalty when caller looks like inline candidate, @@ -1189,7 +1190,7 @@ edge_badness (struct cgraph_edge *edge, bool dump) of functions fully inlined in program. */ else { - int nest = MIN (ipa_call_summaries->get (edge)->loop_depth, 8); + int nest = MIN (ipa_call_summaries->get_create (edge)->loop_depth, 8); badness = growth; /* Decrease badness if call is nested. */ @@ -1332,7 +1333,7 @@ update_caller_keys (edge_heap_t *heap, struct cgraph_node *node, struct cgraph_edge *edge; struct ipa_ref *ref; - if ((!node->alias && !ipa_fn_summaries->get (node)->inlinable) + if ((!node->alias && !ipa_fn_summaries->get_create (node)->inlinable) || node->global.inlined_to) return; if (!bitmap_set_bit (updated_nodes, node->uid)) @@ -1391,7 +1392,7 @@ update_callee_keys (edge_heap_t *heap, struct cgraph_node *node, don't need updating. */ if (e->inline_failed && (callee = e->callee->ultimate_alias_target (&avail, e->caller)) - && ipa_fn_summaries->get (callee)->inlinable + && ipa_fn_summaries->get_create (callee)->inlinable && avail >= AVAIL_AVAILABLE && !bitmap_bit_p (updated_nodes, callee->uid)) { @@ -1558,10 +1559,10 @@ recursive_inlining (struct cgraph_edge *edge, fprintf (dump_file, "\n Inlined %i times, " "body grown from size %i to %i, time %f to %f\n", n, - ipa_fn_summaries->get (master_clone)->size, - ipa_fn_summaries->get (node)->size, - ipa_fn_summaries->get (master_clone)->time.to_double (), - ipa_fn_summaries->get (node)->time.to_double ()); + ipa_fn_summaries->get_create (master_clone)->size, + ipa_fn_summaries->get_create (node)->size, + ipa_fn_summaries->get_create (master_clone)->time.to_double (), + ipa_fn_summaries->get_create (node)->time.to_double ()); /* Remove master clone we used for inlining. We rely that clones inlined into master clone gets queued just before master clone so we don't @@ -1763,7 +1764,7 @@ inline_small_functions (void) && (node->has_gimple_body_p () || node->thunk.thunk_p) && opt_for_fn (node->decl, optimize)) { - struct ipa_fn_summary *info = ipa_fn_summaries->get (node); + struct ipa_fn_summary *info = ipa_fn_summaries->get_create (node); struct ipa_dfs_info *dfs = (struct ipa_dfs_info *) node->aux; /* Do not account external functions, they will be optimized out @@ -1785,7 +1786,7 @@ inline_small_functions (void) n2 = ((struct ipa_dfs_info *) n2->aux)->next_cycle) if (opt_for_fn (n2->decl, optimize)) { - struct ipa_fn_summary *info2 = ipa_fn_summaries->get (n2); + ipa_fn_summary *info2 = ipa_fn_summaries->get_create (n2); if (info2->scc_no) break; info2->scc_no = id; @@ -1944,7 +1945,7 @@ inline_small_functions (void) fprintf (dump_file, "\nConsidering %s with %i size\n", callee->dump_name (), - ipa_fn_summaries->get (callee)->size); + ipa_fn_summaries->get_create (callee)->size); fprintf (dump_file, " to be inlined into %s in %s:%i\n" " Estimated badness is %f, frequency %.2f.\n", @@ -2070,13 +2071,14 @@ inline_small_functions (void) if (dump_file) { + ipa_fn_summary *s = ipa_fn_summaries->get_create (edge->caller); fprintf (dump_file, " Inlined %s into %s which now has time %f and size %i, " "net change of %+i.\n", xstrdup_for_dump (edge->callee->name ()), xstrdup_for_dump (edge->caller->name ()), - ipa_fn_summaries->get (edge->caller)->time.to_double (), - ipa_fn_summaries->get (edge->caller)->size, + s->time.to_double (), + s->size, overall_size - old_size); } if (min_size > overall_size) @@ -2211,11 +2213,11 @@ inline_to_all_callers_1 (struct cgraph_node *node, void *data, fprintf (dump_file, "\nInlining %s size %i.\n", node->name (), - ipa_fn_summaries->get (node)->size); + ipa_fn_summaries->get_create (node)->size); fprintf (dump_file, " Called once from %s %i insns.\n", node->callers->caller->name (), - ipa_fn_summaries->get (node->callers->caller)->size); + ipa_fn_summaries->get_create (node->callers->caller)->size); } /* Remember which callers we inlined to, delaying updating the @@ -2226,7 +2228,7 @@ inline_to_all_callers_1 (struct cgraph_node *node, void *data, fprintf (dump_file, " Inlined into %s which now has %i size\n", caller->name (), - ipa_fn_summaries->get (caller)->size); + ipa_fn_summaries->get_create (caller)->size); if (!(*num_calls)--) { if (dump_file) @@ -2267,7 +2269,7 @@ dump_overall_stats (void) if (!node->global.inlined_to && !node->alias) { - sreal time = ipa_fn_summaries->get (node)->time; + sreal time = ipa_fn_summaries->get_create (node)->time; sum += time; if (node->count.ipa ().initialized_p ()) sum_weighted += time * node->count.ipa ().to_gcov_type (); @@ -2646,7 +2648,7 @@ early_inline_small_functions (struct cgraph_node *node) for (e = node->callees; e; e = e->next_callee) { struct cgraph_node *callee = e->callee->ultimate_alias_target (); - if (!ipa_fn_summaries->get (callee)->inlinable + if (!ipa_fn_summaries->get_create (callee)->inlinable || !e->inline_failed) continue; @@ -2756,7 +2758,7 @@ early_inliner (function *fun) statements that don't have inline parameters computed. */ for (edge = node->callees; edge; edge = edge->next_callee) { - struct ipa_call_summary *es = ipa_call_summaries->get (edge); + ipa_call_summary *es = ipa_call_summaries->get_create (edge); es->call_stmt_size = estimate_num_insns (edge->call_stmt, &eni_size_weights); es->call_stmt_time @@ -2781,7 +2783,7 @@ early_inliner (function *fun) for (edge = node->callees; edge; edge = edge->next_callee) { /* We have no summary for new bound store calls yet. */ - struct ipa_call_summary *es = ipa_call_summaries->get (edge); + ipa_call_summary *es = ipa_call_summaries->get_create (edge); es->call_stmt_size = estimate_num_insns (edge->call_stmt, &eni_size_weights); es->call_stmt_time |