To make consistent inline decisions between profile-gen and
profile-use, probably better to check these two:

flag_profile_arcs and flag_branch_probabilities.  -fprofile-use
enables profile-arcs, and value profiling is enabled only when
edge/branch profiling is enabled (so no need to be checked).

David


On Tue, May 17, 2011 at 10:50 PM, Mark Heffernan <meh...@google.com> wrote:
> This small patch greatly expands the function size limits for inlining with
> FDO/LIPO.  With profile information, the inliner is much more selective and
> precise and so the limits can be increased with less worry that functions
> and total code size will blow up.  This speeds up x86-64 internal benchmarks
> by about geomean 1.5% to 3% with LIPO (depending on microarch), and 1% to
> 1.5% with FDO.  Size increase is negligible (0.1% mean).
> Bootstrapped and regression tested on x86-64.
> Trunk testing to follow.
> Ok for google/main?
> Mark
>
> 2011-05-17  Mark Heffernan  <meh...@google.com>
>        * opts.c (finish_options): Increase inlining limits with profile
>        generate and use.
>
> Index: opts.c
> ===================================================================
> --- opts.c (revision 173666)
> +++ opts.c (working copy)
> @@ -828,6 +828,22 @@ finish_options (struct gcc_options *opts
>    opts->x_flag_split_stack = 0;
>   }
>      }
> +
> +  if (opts->x_flag_profile_use
> +      || opts->x_profile_arc_flag
> +      || opts->x_flag_profile_values)
> +    {
> +      /* With accurate profile information, inlining is much more
> + selective and makes better decisions, so increase the
> + inlining function size limits.  Changes must be added to both
> + the generate and use builds to avoid profile mismatches.  */
> +      maybe_set_param_value
> + (PARAM_MAX_INLINE_INSNS_SINGLE, 1000,
> + opts->x_param_values, opts_set->x_param_values);
> +      maybe_set_param_value
> + (PARAM_MAX_INLINE_INSNS_AUTO, 1000,
> + opts->x_param_values, opts_set->x_param_values);
> +    }
>  }
>

Reply via email to