This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Google] Recompute function frequency after calculating branch probability
- From: Dehao Chen <dehao at google dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: David Li <davidxl at google dot com>
- Date: Sun, 7 Apr 2013 20:07:03 -0700
- Subject: [Google] Recompute function frequency after calculating branch probability
Hi,
This patch updates the function frequency after calculating branch
probability. This is important because cold function could be promoted
to hot after ipa-inline.
Bootstrapped and passed gcc regression tests.
Okay for google-4_7?
Thanks,
Dehao
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -2877,7 +2877,10 @@ rebuild_frequencies (void)
else if (profile_status == PROFILE_READ)
{
if (flag_auto_profile)
- afdo_calculate_branch_prob ();
+ {
+ afdo_calculate_branch_prob ();
+ compute_function_frequency ();
+ }
counts_to_freqs ();
}
else