[PATCH][RFC] Param to options conversion (demo).
Martin Liška
mliska@suse.cz
Thu Oct 31 13:17:00 GMT 2019
On 10/31/19 2:16 PM, Martin Liška wrote:
> On 10/31/19 2:01 PM, Martin Liška wrote:
>> Hi.
>>
>> Based on the discussion with Honza and Richard I'm sending a proposal
>> for conversion of param machinery into the existing option machinery.
>> Our motivation for the change is to provide per function param values,
>> similarly what 'Optimization' keyword does for options.
>>
>> Right now, we support the following format:
>> gcc --param=lto-partitions=4 /tmp/main.c -c
>>
>> And so that I decided to name newly the params like:
>>
>> -param=ipa-sra-ptr-growth-factor=
>> Common Joined UInteger Var(param_ipa_sra_ptr_growth_factor) Init(2) Param Optimization
>> Maximum allowed growth of number and total size of new parameters
>> that ipa-sra replaces a pointer to an aggregate with.
>>
>> And I learnt decoder to parse '--param' 'name=value' as '--param=name=value'. Doing that
>> the transformation works. Help provides reasonable output as well:
>>
>> $ ./xgcc -B. --param predictable-branch-outcome=5 /tmp/main.c -c -Q --help=param
>> The --param option recognizes the following as parameters:
>> --param=ipa-sra-ptr-growth-factor= 2
>> --param=predictable-branch-outcome=<0,50> 5
>>
>> Thoughts?
>> Thanks,
>> Martin
>>
>> ---
>> gcc/common.opt | 18 +++++++++++-------
>> gcc/ipa-sra.c | 3 +--
>> gcc/opt-functions.awk | 3 ++-
>> gcc/opts-common.c | 9 +++++++++
>> gcc/opts.c | 36 ------------------------------------
>> gcc/params.def | 10 ----------
>> gcc/predict.c | 4 ++--
>> 7 files changed, 25 insertions(+), 58 deletions(-)
>>
>>
>
> I forgot to add gcc-patches to To.
>
> Martin
>
+ the patch.
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Param-to-options-conversion-demo.patch
Type: text/x-patch
Size: 6639 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191031/370fb157/attachment.bin>
More information about the Gcc-patches
mailing list