From e3bd08dde17aa654c1aecade0807251e082c702c Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sat, 9 Nov 2019 18:45:29 +0100 Subject: [PATCH] ipa-fnsummary.c (ipa_call_context::estimate_size_and_time): Fix calculation of min_size. * ipa-fnsummary.c (ipa_call_context::estimate_size_and_time): Fix calculation of min_size. (ipa_update_overall_fn_summary): Likewise. From-SVN: r278006 --- gcc/ChangeLog | 6 ++++++ gcc/ipa-fnsummary.c | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0d6b35def70..e2bef8bc2a0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-11-09 Jan Hubicka + + * ipa-fnsummary.c (ipa_call_context::estimate_size_and_time): Fix + calculation of min_size. + (ipa_update_overall_fn_summary): Likewise. + 2019-11-09 Jan Hubicka * ipa-fnsummary.c (estimate_edge_size_and_time): Do not call diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c index 569efdc794d..941e732359f 100644 --- a/gcc/ipa-fnsummary.c +++ b/gcc/ipa-fnsummary.c @@ -3243,6 +3243,7 @@ ipa_call_context::estimate_size_and_time (int *ret_size, sreal nonspecialized_time = time; + min_size += (*info->size_time_table)[0].size; for (i = 0; vec_safe_iterate (info->size_time_table, i, &e); i++) { bool exec = e->exec_predicate.evaluate (m_nonspec_possible_truths); @@ -3288,7 +3289,7 @@ ipa_call_context::estimate_size_and_time (int *ret_size, } gcc_checking_assert ((*info->size_time_table)[0].exec_predicate == true); gcc_checking_assert ((*info->size_time_table)[0].nonconst_predicate == true); - min_size = (*info->size_time_table)[0].size; + gcc_checking_assert (min_size >= 0); gcc_checking_assert (size >= 0); gcc_checking_assert (time >= 0); /* nonspecialized_time should be always bigger than specialized time. @@ -3685,12 +3686,13 @@ ipa_update_overall_fn_summary (struct cgraph_node *node) size_info->size += e->size; info->time += e->time; } + info->min_size = (*info->size_time_table)[0].size; estimate_calls_size_and_time (node, &size_info->size, &info->min_size, &info->time, NULL, ~(clause_t) (1 << predicate::false_condition), vNULL, vNULL, vNULL); - size_info->size = (size_info->size + ipa_fn_summary::size_scale / 2) - / ipa_fn_summary::size_scale; + size_info->size = RDIV (size_info->size, ipa_fn_summary::size_scale); + info->min_size = RDIV (info->min_size, ipa_fn_summary::size_scale); } -- 2.30.2