From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14876 invoked by alias); 4 Sep 2017 16:52:56 -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 14840 invoked by uid 89); 4 Sep 2017 16:52:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: foss.arm.com Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 04 Sep 2017 16:52:51 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F2C1580D; Mon, 4 Sep 2017 09:52:48 -0700 (PDT) Received: from [10.2.207.77] (e100706-lin.cambridge.arm.com [10.2.207.77]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 327283F3E1; Mon, 4 Sep 2017 09:52:48 -0700 (PDT) Message-ID: <59AD84DE.20601@foss.arm.com> Date: Mon, 04 Sep 2017 16:52:00 -0000 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Wilco Dijkstra , GCC Patches CC: nd , Richard Earnshaw Subject: Re: [PATCH][ARM] Improve max_insns_skipped logic References: ,, In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-09/txt/msg00198.txt.bz2 On 27/06/17 16:38, Wilco Dijkstra wrote: > > > ping > > > From: Wilco Dijkstra > Sent: 10 November 2016 17:19 > To: GCC Patches > Cc: nd > Subject: [PATCH][ARM] Improve max_insns_skipped logic > > Improve the logic when setting max_insns_skipped. Limit the maximum > size of IT > to MAX_INSN_PER_IT_BLOCK as otherwise multiple IT instructions are needed, > increasing codesize. Given 4 works well for Thumb-2, use the same > limit for ARM > for consistency. > > ChangeLog: > 2016-11-04 Wilco Dijkstra > > * config/arm/arm.c (arm_option_params_internal): Improve > setting of > max_insns_skipped. > -- > > diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c > index > f046854e9665d54911616fc1c60fee407188f7d6..29e8d1d07d918fbb2a627a653510dfc8587ee01a > 100644 > --- a/gcc/config/arm/arm.c > +++ b/gcc/config/arm/arm.c > @@ -2901,20 +2901,12 @@ arm_option_params_internal (void) > targetm.max_anchor_offset = TARGET_MAX_ANCHOR_OFFSET; > } > > - if (optimize_size) > - { > - /* If optimizing for size, bump the number of instructions that we > - are prepared to conditionally execute (even on a StrongARM). */ > - max_insns_skipped = 6; > + /* Increase the number of conditional instructions with -Os. */ > + max_insns_skipped = optimize_size ? 4 : > current_tune->max_insns_skipped; > > - /* For THUMB2, we limit the conditional sequence to one IT > block. */ > - if (TARGET_THUMB2) > - max_insns_skipped = arm_restrict_it ? 1 : 4; > - } > - else > - /* When -mrestrict-it is in use tone down the if-conversion. */ > - max_insns_skipped = (TARGET_THUMB2 && arm_restrict_it) > - ? 1 : current_tune->max_insns_skipped; > + /* For THUMB2, we limit the conditional sequence to one IT block. */ > + if (TARGET_THUMB2) > + max_insns_skipped = MIN (max_insns_skipped, MAX_INSN_PER_IT_BLOCK); I like the simplifications in the selection logic here :) However, changing the value for ARM from 6 to 4 looks a bit arbitrary to me. There's probably a reason why default values for ARM and Thumb-2 are different (maybe not a good one) and I'd rather not change it without some code size data measurements. So I'd rather not let that hold this cleanup patch though, so this is ok (assuming a normal bootstrap and testing cycle) without changing the 6 to a 4 and you can propose a change to 4 as a separate patch that can be discussed on its own. Thanks, Kyrill > } > > /* True if -mflip-thumb should next add an attribute for the default >