From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29380 invoked by alias); 18 May 2011 18:34:21 -0000 Received: (qmail 29222 invoked by uid 22791); 18 May 2011 18:34:20 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 May 2011 18:34:05 +0000 Received: from wpaz33.hot.corp.google.com (wpaz33.hot.corp.google.com [172.24.198.97]) by smtp-out.google.com with ESMTP id p4IIY4AQ008685 for ; Wed, 18 May 2011 11:34:04 -0700 Received: from gwj21 (gwj21.prod.google.com [10.200.10.21]) by wpaz33.hot.corp.google.com with ESMTP id p4IIXsKU004392 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 18 May 2011 11:34:03 -0700 Received: by gwj21 with SMTP id 21so751261gwj.30 for ; Wed, 18 May 2011 11:34:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.205.5 with SMTP id h5mr1318478anq.81.1305743643256; Wed, 18 May 2011 11:34:03 -0700 (PDT) Received: by 10.101.107.5 with HTTP; Wed, 18 May 2011 11:34:03 -0700 (PDT) In-Reply-To: References: Date: Wed, 18 May 2011 19:41:00 -0000 Message-ID: Subject: Re: [google] Increase inlining limits with FDO/LIPO From: Mark Heffernan To: Xinliang David Li Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg01311.txt.bz2 On Wed, May 18, 2011 at 10:52 AM, Xinliang David Li wr= ote: > 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 wrot= e: >> On Tue, May 17, 2011 at 11:34 PM, Xinliang David Li >> 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. =C2=A0-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 indicate= d). >> =C2=A0Verified identical binaries are generated. >> OK as updated? >> >> Mark >> 2011-05-18 =C2=A0Mark Heffernan =C2=A0 >> * opts.c (set_profile_parameters): New function. >> Index: opts.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- opts.c =C2=A0 =C2=A0 =C2=A0(revision 173666) >> +++ opts.c =C2=A0 =C2=A0 =C2=A0(working copy) >> @@ -1209,6 +1209,25 @@ print_specific_help (unsigned int includ >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0opts->x_help_columns, opts, lang_mask); >> =C2=A0} >> >> + >> +/* Set parameters to more appropriate values when profile information >> + =C2=A0 is available. =C2=A0*/ >> +static void >> +set_profile_parameters (struct gcc_options *opts, >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 struct gcc_options *opts_set) >> +{ >> + =C2=A0/* With accurate profile information, inlining is much more >> + =C2=A0 =C2=A0 selective and makes better decisions, so increase the >> + =C2=A0 =C2=A0 inlining function size limits. =C2=A0*/ >> + =C2=A0maybe_set_param_value >> + =C2=A0 =C2=A0(PARAM_MAX_INLINE_INSNS_SINGLE, 1000, >> + =C2=A0 =C2=A0 opts->x_param_values, opts_set->x_param_values); >> + =C2=A0maybe_set_param_value >> + =C2=A0 =C2=A0(PARAM_MAX_INLINE_INSNS_AUTO, 1000, >> + =C2=A0 =C2=A0 opts->x_param_values, opts_set->x_param_values); >> +} >> + >> + >> =C2=A0/* Handle target- and language-independent options. =C2=A0Return z= ero to >> =C2=A0 =C2=A0 generate an "unknown option" message. =C2=A0Only options t= hat need >> =C2=A0 =C2=A0 extra handling need to be listed here; if you simply want >> @@ -1560,6 +1579,7 @@ common_handle_option (struct gcc_options >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 opts->x_flag_unswitch_loops =3D value; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!opts_set->x_flag_gcse_after_reload) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 opts->x_flag_gcse_after_reload =3D value; >> + =C2=A0 =C2=A0 =C2=A0set_profile_parameters (opts, opts_set); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0break; >> >> =C2=A0 =C2=A0 =C2=A0case OPT_fprofile_generate_: >> @@ -1580,6 +1600,7 @@ common_handle_option (struct gcc_options >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is done. =C2=A0*/ >> =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!opts_set->x_flag_ipa_reference && in_lto= _p) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0opts->x_flag_ipa_reference =3D false; >> + =C2=A0 =C2=A0 =C2=A0set_profile_parameters (opts, opts_set); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0break; >> >> =C2=A0 =C2=A0 =C2=A0case OPT_fshow_column: >> >