This is the mail archive of the
mailing list for the GCC project.
Re: New option to do fine grain control [on|off] of micro-arch specific features : -mtune-ctrl=....
- From: Xinliang David Li <davidxl at google dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Teresa Johnson <tejohnson at google dot com>
- Date: Wed, 7 Aug 2013 09:37:04 -0700
- Subject: Re: New option to do fine grain control [on|off] of micro-arch specific features : -mtune-ctrl=....
- References: <CAAkRFZLZh1q+p55O6kA3QSgyNERcPpAOW=tpWYye40Dzs+0KcA at mail dot gmail dot com> <CAAkRFZKZKQPqWQTX7sebXFy0KE8rxs7Yp9iMqK=1k+UqkYTL2w at mail dot gmail dot com> <20130807153738 dot GA4662 at kam dot mff dot cuni dot cz>
On Wed, Aug 7, 2013 at 8:37 AM, Jan Hubicka <email@example.com> wrote:
>> On Sat, Aug 3, 2013 at 12:36 PM, Xinliang David Li <firstname.lastname@example.org> wrote:
>> > Hi, GCC/i386 currently has about 73 boolean parameters/knobs (defined
>> > in ix86_tune_features, indexed by ix86_tune_indices) to perform
>> > micro-arch specific performance tuning. However such settings are hard
>> > coded (fixed with a given -mtune setting) and is very hard to do
>> > performance experiment.
>> > The attached patch fixes the problem. The patch introduces a new
>> > option -mtune-ctrl=. Its parameter is a comma separated list of
>> > feature names to turn on associated features. Feature name can be
>> > prefixed by ^ to do the opposite. For instance,
>> > -mtune-ctrl=prologue_using_move,epilogue_using_move,^pad_returns
>> > tells the compiler to use move instructions in prologue/epilogue
>> > (instead of push/pop), and *not* pad return instructions.
>> > To facilitate the change, the feature tuning enums defined in i386.h
>> > are moved to a new file x86-tune.def and this file can be used to
>> > generate both the enums and names of the features.
>> > Ok for trunk?
> Yes, this patch seems fine to me (as an undocumented option we should not
> be obliged to fix any ices from non-sential combinations of flags and in
> fact I do not really know of any).
> I wonder if we can't feed initial_ix86_tune_features so we get rid of
> two places that needs to be kept in sync when adding new knob?
Good concern -- the initial setting can be put into the def file too
to make sure they are always synced. I will do this in a follow up
>> > thanks,
>> > David
>> > 2013-08-03 Xinliang David Li <email@example.com>
>> > * config/i386/i386.opt: New option -mtune-ctrl=.
>> > * config/i386/x86-tune.def: New file.
>> > * config/i386/i386.h: include x86-tune.def.
>> > * config/i386/i386.c (ix86_option_override_internal):
>> > Parsing -mtune-ctrl= option and set tune features.