Patchwork [GOOGLE] Unrestrict early inline restrictions for AutoFDO

login
register
mail settings
Submitter Dehao Chen
Date June 4, 2013, 4:51 p.m.
Message ID <CAO2gOZXy+3YRJ2RaSGrJi0NhWKCoFA3ye4oZgpfn10RWj7QLWw@mail.gmail.com>
Download mbox | patch
Permalink /patch/248713/
State New
Headers show

Comments

Dehao Chen - June 4, 2013, 4:51 p.m.
Patch updated to set the iteration threshold to 10 for AutoFDO.
Performance test shows ok.

OK for google-4_8 branch?

Thanks,
Dehao
Xinliang David Li - June 4, 2013, 5 p.m.
ok.

David

On Tue, Jun 4, 2013 at 9:51 AM, Dehao Chen <dehao@google.com> wrote:
> Patch updated to set the iteration threshold to 10 for AutoFDO.
> Performance test shows ok.
>
> OK for google-4_8 branch?
>
> Thanks,
> Dehao
>
> Index: gcc/ipa-inline.c
> ===================================================================
> --- gcc/ipa-inline.c (revision 199593)
> +++ gcc/ipa-inline.c (working copy)
> @@ -2161,8 +2161,7 @@ early_inliner (void)
>      {
>        /* We iterate incremental inlining to get trivial cases of indirect
>   inlining.  */
> -      while ((flag_auto_profile
> -      || iterations < PARAM_VALUE (PARAM_EARLY_INLINER_MAX_ITERATIONS))
> +      while (iterations < PARAM_VALUE (PARAM_EARLY_INLINER_MAX_ITERATIONS)
>       && early_inline_small_functions (node))
>   {
>    timevar_push (TV_INTEGRATION);
> Index: gcc/opts.c
> ===================================================================
> --- gcc/opts.c (revision 199593)
> +++ gcc/opts.c (working copy)
> @@ -784,6 +784,10 @@ finish_options (struct gcc_options *opts, struct g
>       opts->x_param_values, opts_set->x_param_values);
>      }
>
> +  if (opts->x_flag_auto_profile)
> +    maybe_set_param_value (PARAM_EARLY_INLINER_MAX_ITERATIONS, 10,
> +   opts->x_param_values, opts_set->x_param_values);
> +
>    if (opts->x_flag_lto)
>      {
>  #ifdef ENABLE_LTO

Patch

Index: gcc/ipa-inline.c
===================================================================
--- gcc/ipa-inline.c (revision 199593)
+++ gcc/ipa-inline.c (working copy)
@@ -2161,8 +2161,7 @@  early_inliner (void)
     {
       /* We iterate incremental inlining to get trivial cases of indirect
  inlining.  */
-      while ((flag_auto_profile
-      || iterations < PARAM_VALUE (PARAM_EARLY_INLINER_MAX_ITERATIONS))
+      while (iterations < PARAM_VALUE (PARAM_EARLY_INLINER_MAX_ITERATIONS)
      && early_inline_small_functions (node))
  {
   timevar_push (TV_INTEGRATION);
Index: gcc/opts.c
===================================================================
--- gcc/opts.c (revision 199593)
+++ gcc/opts.c (working copy)
@@ -784,6 +784,10 @@  finish_options (struct gcc_options *opts, struct g
      opts->x_param_values, opts_set->x_param_values);
     }

+  if (opts->x_flag_auto_profile)
+    maybe_set_param_value (PARAM_EARLY_INLINER_MAX_ITERATIONS, 10,
+   opts->x_param_values, opts_set->x_param_values);
+
   if (opts->x_flag_lto)
     {
 #ifdef ENABLE_LTO