From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32286 invoked by alias); 29 Oct 2014 14:39:24 -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 32272 invoked by uid 89); 29 Oct 2014 14:39:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: cam-smtp0.cambridge.arm.com Received: from fw-tnat.cambridge.arm.com (HELO cam-smtp0.cambridge.arm.com) (217.140.96.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 29 Oct 2014 14:39:21 +0000 Received: from arm.com (e106375-lin.cambridge.arm.com [10.1.203.34]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id s9TEdIHg022025; Wed, 29 Oct 2014 14:39:18 GMT Date: Wed, 29 Oct 2014 14:39:00 -0000 From: James Greenhalgh To: Richard Biener Cc: GCC Patches , Richard Earnshaw , Marcus Shawcroft , Andrew Pinski Subject: Re: [Patchv2 3/4] Control SRA and IPA-SRA by a param rather than MOVE_RATIO Message-ID: <20141029143917.GA25850@arm.com> References: <1411657056-24865-1-git-send-email-james.greenhalgh@arm.com> <1411657056-24865-4-git-send-email-james.greenhalgh@arm.com> <20141001163812.GA5945@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141001163812.GA5945@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg03087.txt.bz2 On Wed, Oct 01, 2014 at 05:38:12PM +0100, James Greenhalgh wrote: > On Fri, Sep 26, 2014 at 10:11:13AM +0100, Richard Biener wrote: > > On Thu, Sep 25, 2014 at 4:57 PM, James Greenhalgh > > wrote: > > Given the special value to note the default for the new --params is > > zero a user cannot disable scalarization that way. > > > > I still somehow dislike that you need a target hook to compute the > > default. Why doesn't it work to do, in opts.c:default_options_optimization > > > > maybe_set_param_value > > (PARAM_SRA_MAX_SCALARIZATION_SIZE_SPEED, > > get_move_ratio (speed_p) * MOVE_MAX_PIECES, > > opts->x_param_values, opts_set->x_param_values); > > > > and override that default in targets option_override hook the same way? > > The problem I am having is getting "get_move_ratio" right, without breaking > the modular design. > > default_options_optimization, and the rest of opts.c is going to end up in > libcommon-target.a, so we are not going to have access to any > backend-specific symbols. > > An early draft of this patch used the MOVE_RATIO macro to set the default > value. This worked fine for AArch64 and ARM targets (which both use a > simple C expression for MOVE_RATIO), but failed for x86_64 which defines > MOVE_RATIO as so: > > #define MOVE_RATIO(speed) ((speed) ? ix86_cost->move_ratio : 3) > > Dealing with that ix86_cost symbol is what causes us the pain. > > It seems reasonable that a target might want to define MOVE_RATIO > as some function of their tuning parameters, so I don't want to > disallow that usage. > > This inspired me to try turning this in to a target hook, but this > doesn't help as opts.c only gets access to common-target.def target > hooks. These suffer the same problem, they don't have access to any > backend symbols. > > I suppose I could port any target with a definition of MOVE_RATIO to > override the default parameter value in their option overriding code, > but that makes this a very large patch set (many targets define > MOVE_RATIO). > > Is this an avenue worth exploring? I agree the very special target > hook is not ideal. Hi, Did you have any further thoughts on this? I'm still unable to come up with a way to set these parameters which allows them to default to their current (MOVE_RATIO derived) values. If the only way to make this work is to add code to TARGET_OPTION_OVERRIDE for all targets that define MOVE_RATIO, then I suppose I can do that, but I'd prefer a neater way to make it work, if you can think of one. Thanks, James