On Wed, May 18, 2011 at 10:52 AM, Xinliang David Li <davi...@google.com> wrote: > The new change won't help those. Your original place will be ok if you > test profile_arcs and branch_probability flags.
Ah, yes. I see your point now. Reverted to the original change with condition profile_arc_flag and flag_branch_probabilities. Mark > > David > > > On Wed, May 18, 2011 at 10:39 AM, Mark Heffernan <meh...@google.com> wrote: >> On Tue, May 17, 2011 at 11:34 PM, Xinliang David Li <davi...@google.com> >> wrote: >>> >>> 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). >> >> I changed the location where these parameters are set to someplace more >> appropriate (to where the flags are set when profile gen/use is indicated). >> Verified identical binaries are generated. >> OK as updated? >> >> Mark >> 2011-05-18 Mark Heffernan <meh...@google.com> >> * opts.c (set_profile_parameters): New function. >> Index: opts.c >> =================================================================== >> --- opts.c (revision 173666) >> +++ opts.c (working copy) >> @@ -1209,6 +1209,25 @@ print_specific_help (unsigned int includ >> opts->x_help_columns, opts, lang_mask); >> } >> >> + >> +/* Set parameters to more appropriate values when profile information >> + is available. */ >> +static void >> +set_profile_parameters (struct gcc_options *opts, >> + struct gcc_options *opts_set) >> +{ >> + /* With accurate profile information, inlining is much more >> + selective and makes better decisions, so increase the >> + inlining function size limits. */ >> + 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); >> +} >> + >> + >> /* Handle target- and language-independent options. Return zero to >> generate an "unknown option" message. Only options that need >> extra handling need to be listed here; if you simply want >> @@ -1560,6 +1579,7 @@ common_handle_option (struct gcc_options >> opts->x_flag_unswitch_loops = value; >> if (!opts_set->x_flag_gcse_after_reload) >> opts->x_flag_gcse_after_reload = value; >> + set_profile_parameters (opts, opts_set); >> break; >> >> case OPT_fprofile_generate_: >> @@ -1580,6 +1600,7 @@ common_handle_option (struct gcc_options >> is done. */ >> if (!opts_set->x_flag_ipa_reference && in_lto_p) >> opts->x_flag_ipa_reference = false; >> + set_profile_parameters (opts, opts_set); >> break; >> >> case OPT_fshow_column: >> >