aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-11-14 14:38:13 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2019-11-14 13:38:13 +0000
commitfd4656a28afcf5953ae9dfeeb552d1fd951083db (patch)
treea395f8c8546bc04cdc100e1c2fcae299081fe097
parent79f1d8521882de51480866fd7037199d670316bd (diff)
downloadgcc-fd4656a28afcf5953ae9dfeeb552d1fd951083db.zip
gcc-fd4656a28afcf5953ae9dfeeb552d1fd951083db.tar.gz
gcc-fd4656a28afcf5953ae9dfeeb552d1fd951083db.tar.bz2
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
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ipa-fnsummary.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 42758b1..c96683b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2019-11-14 Jan Hubicka <hubicka@ucw.cz>
+ * ipa-fnsummary.c (ipa_call_context::estimate_size_and_time,
+ ipa_merge_fn_summary_after_inlining): Micro optimize.
+
+2019-11-14 Jan Hubicka <hubicka@ucw.cz>
+
* params.opt (max-inline-insns-single-O2): Set to 70 (instead of 30).
2019-11-14 Jan Hubicka <hubicka@ucw.cz>
diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c
index 9d8e1a5..a88f300 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))
{