From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22052 invoked by alias); 17 Jan 2020 09:40:25 -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 22043 invoked by uid 89); 17 Jan 2020 09:40:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=feet X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Jan 2020 09:40:14 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4B9A2113E; Fri, 17 Jan 2020 01:40:13 -0800 (PST) Received: from [10.2.80.62] (e120808-lin.cambridge.arm.com [10.2.80.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9DBA23F68E; Fri, 17 Jan 2020 01:40:12 -0800 (PST) Subject: Re: [PATCH][AARCH64] Set jump-align=4 for neoversen1 To: Wilco Dijkstra , GCC Patches , Richard Earnshaw , richard.sandiford@arm.com References: From: Kyrill Tkachov Message-ID: <2838f819-6d26-bd0f-39aa-289fd62cafa5@foss.arm.com> Date: Fri, 17 Jan 2020 11:12:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2020-01/txt/msg01027.txt.bz2 Hi Richard, Wilco, On 1/17/20 8:43 AM, Richard Sandiford wrote: > Wilco Dijkstra writes: > > Testing shows the setting of 32:16 for jump alignment has a > significant codesize > > cost, however it doesn't make a difference in performance. So set > jump-align > > to 4 to get 1.6% codesize improvement. > > I was leaving this to others in case it was obvious to them.  On the > basis that silence suggests it wasn't, :-) could you go into more details? > Is it expected on first principles that jump alignment doesn't matter > for Neoverse N1, or is this purely based on experimentation?  If it's > expected, are we sure that the other "32:16" entries are still worthwhile? > When you say it doesn't make a difference in performance, does that mean > that no individual test's performance changed significantly, or just that > the aggregate score didn't?  Did you experiment with anything inbetween > the current 32:16 and 4, such as 32:8 or even 32:4? Sorry for dragging my feet on this one, as I put in those numbers last year and I've been trying to recall my experiments from then. The Neoverse N1 Software Optimization guide recommends aligning branch targets to 32 bytes withing the bounds of code density requirements. From my benchmarking last year I do seem to remember function and loop alignment to matter. I probably added the jump alignment for completeness as it's a good idea from first principles. But if the code size hit is too large we could look to decrease it. I'd also be interested in seeing the impact of 32:8 and 32:4. Thanks, Kyrill > > The problem with applying the patch only with the explanation above is > that if someone in future has evidence that jump alignment can make a > difference for their testcase, it would be very hard for them to > reproduce the reasoning that led to this change. > > Thanks, > Richard > > > OK for commit? > > > > ChangeLog > > 2019-12-24  Wilco Dijkstra  > > > > * config/aarch64/aarch64.c (neoversen1_tunings): Set jump_align to 4. > > > > -- > > diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c > > index > 1646ed1d9a3de8ee2f0abff385a1ea145e234475..209ed8ebbe81104d9d8cff0df31946ab7704fb33 > 100644 > > --- a/gcc/config/aarch64/aarch64.c > > +++ b/gcc/config/aarch64/aarch64.c > > @@ -1132,7 +1132,7 @@ static const struct tune_params > neoversen1_tunings = > >    3, /* issue_rate  */ > >    (AARCH64_FUSE_AES_AESMC | AARCH64_FUSE_CMP_BRANCH), /* > fusible_ops  */ > >    "32:16",/* function_align.  */ > > -  "32:16",/* jump_align.  */ > > +  "4",/* jump_align.  */ > >    "32:16",/* loop_align.  */ > >    2,/* int_reassoc_width.  */ > >    4,/* fp_reassoc_width.  */