From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128491 invoked by alias); 25 Sep 2015 14:14:45 -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 128475 invoked by uid 89); 25 Sep 2015 14:14:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f169.google.com Received: from mail-ig0-f169.google.com (HELO mail-ig0-f169.google.com) (209.85.213.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 25 Sep 2015 14:14:43 +0000 Received: by igbkq10 with SMTP id kq10so10774997igb.0 for ; Fri, 25 Sep 2015 07:14:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=OrkeUUC8n2dA2B/6wo+S5d+S0Sh8S7RiyKeWbm+XkEY=; b=lVbj3ydHd63KVSOv1Wb1DgP+QGk60gXswxBnwuroA/SPqwSVmFC70HJFQJ66REBe7L 4s7djCrBG6SF03qtq5k/7Fm5CQ5ofFC8D0tChK0yvlm/oGsM7eOsSXO5ipTT/FSTL/JU kLQA8iZZl4JaYEyfvFjjlDv4J8Lf9QKDRyFGaAUD7+ytCL4BJdh7LNmOLDj0GvKNseTz EoXiBZeFqTAFkIou0KAN8kVbQ72tmpNdke0OoUO+dCHAI6hI494TBNdY8/TbnQiXuBBn SFZ14XsyDA8//vnFIZUv9c231uy3UKCXI2w6GCaMKXWjXo7i89xkkYysEclNRPLgFMbO NsuQ== X-Gm-Message-State: ALoCoQl2ORH413dPYjbaluMiHwE91jGfTXltwz6LPp0RD+TxmUQ3QBlpDdOZhby0hodoa4RfqgAw MIME-Version: 1.0 X-Received: by 10.50.3.104 with SMTP id b8mr3059904igb.15.1443190481408; Fri, 25 Sep 2015 07:14:41 -0700 (PDT) Received: by 10.107.34.203 with HTTP; Fri, 25 Sep 2015 07:14:41 -0700 (PDT) In-Reply-To: <56055316.6080901@redhat.com> References: <56055316.6080901@redhat.com> Date: Fri, 25 Sep 2015 14:26:00 -0000 Message-ID: Subject: Re: [PATCH] Disable -fno-reorder-blocks-and-partition if no -fprofile-use to avoid unnecessary overhead From: Teresa Johnson To: Bernd Schmidt Cc: "gcc-patches@gcc.gnu.org" , Jan Hubicka , Xinliang David Li Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg01962.txt.bz2 On Fri, Sep 25, 2015 at 6:58 AM, Bernd Schmidt wrote: > On 09/24/2015 07:16 PM, Teresa Johnson wrote: >> >> 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. >> >> Leaving it enabled, however, causes the assembly code generator to create >> (empty) cold sections and labels, leading to unnecessary size overhead. >> >> Bootstrapped and tested on x86-64-unknown-linux-gnu. Ok for trunk? >> >> Thanks, >> Teresa >> >> 2015-09-24 Teresa Johnson >> >> * opts.c (finish_options): Unset -freorder-blocks-and-partition >> if not using profile. > > > Hmm, I'd noticed I was getting that enabled by default. It looks like you > added this default with: > > 2013-11-19 Teresa Johnson > > * common/config/i386/i386-common.c: Enable > -freorder-blocks-and-partition at -O2 and up for x86. > * doc/invoke.texi: Update -freorder-blocks-and-partition default. > * opts.c (finish_options): Only warn if -freorder-blocks-and- > partition was set on command line. > > (Note that this ChangeLog entry should have mentioned > ix86_option_optimization_table as the variable that was changed). Yeah, looks like I accidentally left the function name out of the i386-common.c entry. I can fix the ChangeLog entry. > > What has changed between then and now? Also, do we not use > estimates/heuristics when not using a profile? Nothing has changed - splitting effectively never kicked in without a profile. Honza and I had discussed the idea that static profile heuristics could eventually be used to distinguish hot vs cold bbs, but that hasn't happened. What I didn't notice until recently was the size increase in the .o files from varasm adding in unnecessary sections and labels when this option was on. Unless and until static heuristics are used to distinguish cold bbs in probably_never_executed_bb_p, I don't think it makes sense to do anything finer grained that just disabling the option. Teresa > > > Bernd -- Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413