Patchwork [Google] Recompute function frequency after calculating branch probability

login
register
mail settings
Submitter Dehao Chen
Date April 8, 2013, 3:07 a.m.
Message ID <CAO2gOZUDdJpoin+YPsE0WoXggYKq3JrOCQVVYbELsoeAzeH=WA@mail.gmail.com>
Download mbox | patch
Permalink /patch/234560/
State New
Headers show

Comments

Dehao Chen - April 8, 2013, 3:07 a.m.
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
Xinliang David Li - April 8, 2013, 6:11 a.m.
Ok.

thanks,

David

On Sun, Apr 7, 2013 at 8:07 PM, Dehao Chen <dehao@google.com> wrote:
> 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

Patch

--- 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