From: Jan Hubicka Date: Sat, 9 Nov 2019 17:45:29 +0000 (+0100) Subject: ipa-fnsummary.c (ipa_call_context::estimate_size_and_time): Fix calculation of min_size. X-Git-Tag: upstream/12.2.0~20526 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e3bd08dde17aa654c1aecade0807251e082c702c;p=platform%2Fupstream%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0d6b35d..e2bef8b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 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 estimate_edge_devirt_benefit when not computing hints; do not compute time when not asked for. diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c index 569efdc..941e732 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); }