This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patchv3] Control SRA and IPA-SRA by a param rather than MOVE_RATIO
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: James Greenhalgh <james dot greenhalgh at arm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Andrew Pinski <pinskia at gmail dot com>
- Date: Thu, 6 Nov 2014 15:10:41 +0100
- Subject: Re: [Patchv3] Control SRA and IPA-SRA by a param rather than MOVE_RATIO
- Authentication-results: sourceware.org; auth=none
- References: <CAFiYyc13eQP6ojm1aukkXwXiM9gExYGADSdgLa60XBiQAR7Hgg at mail dot gmail dot com> <1415274813-4036-1-git-send-email-james dot greenhalgh at arm dot com>
On Thu, Nov 6, 2014 at 12:53 PM, James Greenhalgh
<james.greenhalgh@arm.com> wrote:
>
> On Fri, Oct 31, 2014 at 10:46:12AM +0000, Richard Biener wrote:
>> On Wed, Oct 29, 2014 at 3:39 PM, James Greenhalgh wrote:
>> >> 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.
>>
>> Maybe instead of putting the code in opts.c put it right before we call
>> targetm.target_option.override () in toplev.c:process_options. With
>> a comment on why it cannot be in opts.c.
>
> Ah, that makes sense. The (much simplified) patch then looks like
> this...
>
> Bootstrapped on x86_64, ARM and AArch64 with no issues.
>
> OK?
Ok.
Thanks,
Richard.
> Thanks,
> James
>
> ---
> gcc/
>
> 2014-11-06 James Greenhalgh <james.greenhalgh@arm.com>
>
> * params.def (sra-max-scalarization-size-Ospeed): New.
> (sra-max-scalarization-size-Osize): Likewise.
> * doc/invoke.texi (sra-max-scalarization-size-Ospeed): Document.
> (sra-max-scalarization-size-Osize): Likewise.
> * toplev.c (process_options): Set default values for new
> parameters.
> * tree-sra.c (analyze_all_variable_accesses): Use new parameters.
> * targhooks.c (get_move_ratio): Remove static designator.
> * target.h (get_move_ratio): Declare.