diff options
author | Martin Jambor <mjambor@suse.cz> | 2020-10-02 18:41:34 +0200 |
---|---|---|
committer | Martin Jambor <mjambor@suse.cz> | 2020-10-02 18:41:34 +0200 |
commit | 1e7fdc02cba43e646fb2389e3c79e7c4e5ff772e (patch) | |
tree | 14d201bd3435c921d401b8e08298cec1bf76ab59 /gcc/ipa-inline-analysis.c | |
parent | 7d2cb2755a14b95b1d71c3e52895d75954b4ec47 (diff) | |
download | gcc-1e7fdc02cba43e646fb2389e3c79e7c4e5ff772e.zip gcc-1e7fdc02cba43e646fb2389e3c79e7c4e5ff772e.tar.gz gcc-1e7fdc02cba43e646fb2389e3c79e7c4e5ff772e.tar.bz2 |
ipa: Bundle estimates of ipa_call_context::estimate_size_and_time
A subsequent patch adds another two estimates that the code in
ipa_call_context::estimate_size_and_time computes, and the fact that
the function has a special output parameter for each thing it computes
would make it have just too many. Therefore, this patch collapses all
those ouptut parameters into one output structure.
gcc/ChangeLog:
2020-09-02 Martin Jambor <mjambor@suse.cz>
* ipa-inline-analysis.c (do_estimate_edge_time): Adjusted to use
ipa_call_estimates.
(do_estimate_edge_size): Likewise.
(do_estimate_edge_hints): Likewise.
* ipa-fnsummary.h (struct ipa_call_estimates): New type.
(ipa_call_context::estimate_size_and_time): Adjusted declaration.
(estimate_ipcp_clone_size_and_time): Likewise.
* ipa-cp.c (hint_time_bonus): Changed the type of the second argument
to ipa_call_estimates.
(perform_estimation_of_a_value): Adjusted to use ipa_call_estimates.
(estimate_local_effects): Likewise.
* ipa-fnsummary.c (ipa_call_context::estimate_size_and_time): Adjusted
to return estimates in a single ipa_call_estimates parameter.
(estimate_ipcp_clone_size_and_time): Likewise.
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r-- | gcc/ipa-inline-analysis.c | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index b7af77f..acbf82e 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -208,16 +208,12 @@ do_estimate_edge_time (struct cgraph_edge *edge, sreal *ret_nonspec_time) && !opt_for_fn (callee->decl, flag_profile_partial_training) && !callee->count.ipa_p ()) { - sreal chk_time, chk_nonspec_time; - int chk_size, chk_min_size; - - ipa_hints chk_hints; - ctx.estimate_size_and_time (&chk_size, &chk_min_size, - &chk_time, &chk_nonspec_time, - &chk_hints); - gcc_assert (chk_size == size && chk_time == time - && chk_nonspec_time == nonspec_time - && chk_hints == hints); + ipa_call_estimates chk_estimates; + ctx.estimate_size_and_time (&chk_estimates); + gcc_assert (chk_estimates.size == size + && chk_estimates.time == time + && chk_estimates.nonspecialized_time == nonspec_time + && chk_estimates.hints == hints); } } else @@ -227,18 +223,28 @@ do_estimate_edge_time (struct cgraph_edge *edge, sreal *ret_nonspec_time) else node_context_cache_clear++; e->entry.ctx.release (); - ctx.estimate_size_and_time (&size, &min_size, - &time, &nonspec_time, &hints); + ipa_call_estimates estimates; + ctx.estimate_size_and_time (&estimates); + size = estimates.size; e->entry.size = size; + time = estimates.time; e->entry.time = time; + nonspec_time = estimates.nonspecialized_time; e->entry.nonspec_time = nonspec_time; + hints = estimates.hints; e->entry.hints = hints; e->entry.ctx.duplicate_from (ctx); } } else - ctx.estimate_size_and_time (&size, &min_size, - &time, &nonspec_time, &hints); + { + ipa_call_estimates estimates; + ctx.estimate_size_and_time (&estimates); + size = estimates.size; + time = estimates.time; + nonspec_time = estimates.nonspecialized_time; + hints = estimates.hints; + } /* When we have profile feedback, we can quite safely identify hot edges and for those we disable size limits. Don't do that when @@ -321,8 +327,9 @@ do_estimate_edge_size (struct cgraph_edge *edge) evaluate_properties_for_edge (edge, true, &clause, &nonspec_clause, &avals, true); ipa_call_context ctx (callee, clause, nonspec_clause, vNULL, &avals); - ctx.estimate_size_and_time (&size, NULL, NULL, NULL, NULL); - return size; + ipa_call_estimates estimates; + ctx.estimate_size_and_time (&estimates, false, false); + return estimates.size; } @@ -332,7 +339,6 @@ do_estimate_edge_size (struct cgraph_edge *edge) ipa_hints do_estimate_edge_hints (struct cgraph_edge *edge) { - ipa_hints hints; struct cgraph_node *callee; clause_t clause, nonspec_clause; @@ -341,7 +347,7 @@ do_estimate_edge_hints (struct cgraph_edge *edge) if (edge_growth_cache != NULL) { do_estimate_edge_time (edge); - hints = edge_growth_cache->get (edge)->hints; + ipa_hints hints = edge_growth_cache->get (edge)->hints; gcc_checking_assert (hints); return hints - 1; } @@ -354,8 +360,9 @@ do_estimate_edge_hints (struct cgraph_edge *edge) evaluate_properties_for_edge (edge, true, &clause, &nonspec_clause, &avals, true); ipa_call_context ctx (callee, clause, nonspec_clause, vNULL, &avals); - ctx.estimate_size_and_time (NULL, NULL, NULL, NULL, &hints); - hints |= simple_edge_hints (edge); + ipa_call_estimates estimates; + ctx.estimate_size_and_time (&estimates, false, true); + ipa_hints hints = estimates.hints | simple_edge_hints (edge); return hints; } |