From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90608 invoked by alias); 24 Sep 2015 17:22:50 -0000 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 Received: (qmail 90589 invoked by uid 89); 24 Sep 2015 17:22:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,MIME_QP_LONG_LINE,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f45.google.com Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com) (209.85.220.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 24 Sep 2015 17:22:48 +0000 Received: by padhy16 with SMTP id hy16so78703372pad.1 for ; Thu, 24 Sep 2015 10:22:46 -0700 (PDT) X-Received: by 10.68.57.197 with SMTP id k5mr988257pbq.142.1443115366094; Thu, 24 Sep 2015 10:22:46 -0700 (PDT) Received: from [172.20.3.157] ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id qa5sm14630444pbc.70.2015.09.24.10.22.44 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Sep 2015 10:22:44 -0700 (PDT) References: Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: Cc: "gcc-patches@gcc.gnu.org" , Jan Hubicka , Xinliang David Li From: pinskia@gmail.com Subject: Re: [PATCH] Disable -fno-reorder-blocks-and-partition if no -fprofile-use to avoid unnecessary overhead Date: Thu, 24 Sep 2015 19:02:00 -0000 To: Teresa Johnson X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg01889.txt.bz2 > On Sep 24, 2015, at 10:16 AM, Teresa Johnson wrote: >=20 > This patch unsets -freorder-blocks-and-partition when -fprofile-use > is not specified. Function splitting was not actually being performed > in that case, as probably_never_executed_bb_p does not distinguish > any basic blocks as being cold vs hot when there is no profile data. >=20 > Leaving it enabled, however, causes the assembly code generator to create > (empty) cold sections and labels, leading to unnecessary size overhead. >=20 > Bootstrapped and tested on x86-64-unknown-linux-gnu. Ok for trunk? This might be ok for now but there is a notion to enable it for non profile= case.=20 Thanks, Andrew >=20 > Thanks, > Teresa >=20 > 2015-09-24 Teresa Johnson >=20 > * opts.c (finish_options): Unset -freorder-blocks-and-partition > if not using profile. >=20 > 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 (revision 228062) > +++ opts.c (working copy) > @@ -821,7 +821,17 @@ finish_options (struct gcc_options *opts, struct g > opts->x_flag_reorder_blocks =3D 1; > } >=20 > + /* Disable -freorder-blocks-and-partition when -fprofile-use is not in > + effect. Function splitting was not actually being performed in that= case, > + as probably_never_executed_bb_p does not distinguish any basic bloc= ks as > + being cold vs hot when there is no profile data. Leaving it enabled, > + however, causes the assembly code generator to create (empty) cold > + sections and labels, leading to unnecessary size overhead. */ > if (opts->x_flag_reorder_blocks_and_partition > + && !opts_set->x_flag_profile_use) > + opts->x_flag_reorder_blocks_and_partition =3D 0; > + > + if (opts->x_flag_reorder_blocks_and_partition > && !opts_set->x_flag_reorder_functions) > opts->x_flag_reorder_functions =3D 1; >=20 >=20 > --=20 > Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413