From fd4656a28afcf5953ae9dfeeb552d1fd951083db Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 14 Nov 2019 14:38:13 +0100 Subject: [PATCH] ipa-fnsummary.c (ipa_call_context::estimate_size_and_time, [...]): Micro optimize. * ipa-fnsummary.c (ipa_call_context::estimate_size_and_time, ipa_merge_fn_summary_after_inlining): Micro optimize. From-SVN: r278222 --- gcc/ChangeLog | 5 +++++ gcc/ipa-fnsummary.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 42758b10976..c96683b1d1b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-11-14 Jan Hubicka + + * ipa-fnsummary.c (ipa_call_context::estimate_size_and_time, + ipa_merge_fn_summary_after_inlining): Micro optimize. + 2019-11-14 Jan Hubicka * params.opt (max-inline-insns-single-O2): Set to 70 (instead of 30). diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c index 9d8e1a566e3..a88f300d67d 100644 --- a/gcc/ipa-fnsummary.c +++ b/gcc/ipa-fnsummary.c @@ -3353,7 +3353,10 @@ ipa_call_context::estimate_size_and_time (int *ret_size, m_inline_param_summary); gcc_checking_assert (prob >= 0); gcc_checking_assert (prob <= REG_BR_PROB_BASE); - time += e->time * prob / REG_BR_PROB_BASE; + if (prob == REG_BR_PROB_BASE) + time += e->time; + else + time += e->time * prob / REG_BR_PROB_BASE; } gcc_checking_assert (time >= 0); } @@ -3707,7 +3710,8 @@ ipa_merge_fn_summary_after_inlining (struct cgraph_edge *edge) sreal add_time = ((sreal)e->time * freq); int prob = e->nonconst_predicate.probability (callee_info->conds, clause, es->param); - add_time = add_time * prob / REG_BR_PROB_BASE; + if (prob != REG_BR_PROB_BASE) + add_time = add_time * prob / REG_BR_PROB_BASE; if (prob != REG_BR_PROB_BASE && dump_file && (dump_flags & TDF_DETAILS)) { -- 2.30.2