From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 9A5953857C41 for ; Fri, 24 Jul 2020 22:09:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9A5953857C41 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=segher@kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 06OM9Wfm019033; Fri, 24 Jul 2020 17:09:32 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 06OM9UbK019017; Fri, 24 Jul 2020 17:09:30 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 24 Jul 2020 17:09:30 -0500 From: Segher Boessenkool To: Andrea Corallo Cc: gcc-patches@gcc.gnu.org, nd@arm.com, Richard Earnshaw Subject: Re: [PATCH 2/2] Aarch64: Add branch diluter pass Message-ID: <20200724220930.GT32057@gate.crashing.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, TXREP, T_SPF_HELO_PERMERROR, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2020 22:09:40 -0000 Hi! [ Btw, the mailing list archive will not show your attachments (just lets me download them); naming the files *.txt probably works, but you can also use a sane mime type (like, text/plain) ]. On Wed, Jul 22, 2020 at 12:09:08PM +0200, Andrea Corallo wrote: > this second patch implements the AArch64 specific back-end pass > 'branch-dilution' controllable by the followings command line options: > > -mbranch-dilution > > --param=aarch64-branch-dilution-granularity={num} > > --param=aarch64-branch-dilution-max-branches={num} That sounds like something that would be useful generically, even? Targets that do not want to use it can just skip it (that probably should be the default then), via setting the granularity to 0 for example. > Observed performance improvements on Neoverse N1 SPEC CPU 2006 where > up to ~+3% (xalancbmk) and ~+1.5% (sjeng). Average code size increase > for all the testsuite proved to be ~0.4%. Can you share a geomean improvement as well? Also something like 0.4% is sounds like, or is it more? > - Unconditional branches must be the end of a basic block, and nops > cannot be outside of a basic block. Thus the need for FILLER_INSN, > which allows placement outside of a basic block But the new rtx class is recognised in just one location, so it could recognise it on any other characteristic easily. > --- /dev/null > +++ b/gcc/testsuite/gcc.target/aarch64/branch-dilution-off.c > @@ -0,0 +1,57 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O1 -mcpu=cortex-a72 --param case-values-threshold=50" } */ > +/* { dg-final { scan-assembler-not "\\s*b.*\n\\snop\n" } } */ You can write this simpler as /* { dg-final { scan-assembler-not {\s*b.*\n\snop\n} } } */ which shows a problem in this more clearly: . will match newlines as well. Also, starting a RE with (anything)* does nothing, "anything" is allowed to match 0 times after all. You probably meant the "b" should start a mnemonic? /* { dg-final { scan-assembler-not {(?n)\mb.*\n\snop\n} } } */ (\m is a zero-width start-of-word match, like \< in grep; (?n) means . does not match newlines (if you know Perl, it turns /m on and /s off -- the opposite of the defaults for Tcl). (or you could do [^\n]* or even just \S* , no (?n) needed then). Segher