[PATCH][Middle-end]Add a new option to finer control inlining based on function's visibility

Qing Zhao qing.zhao@oracle.com
Wed Sep 12 16:13:00 GMT 2018


> On Sep 12, 2018, at 9:33 AM, Richard Biener <rguenther@suse.de> wrote:
> 
> On Wed, 12 Sep 2018, Qing Zhao wrote:
> 
>> 
>>> On Sep 12, 2018, at 2:46 AM, Alexander Monakov <amonakov@ispras.ru> wrote:
>>> 
>>> On Tue, 11 Sep 2018, Qing Zhao wrote:
>>>> no immediate use case for -finline-visibility=extern right now. But I guess
>>>> that GCC developers might use this option to control inlining scope for
>>>> debugging or development purpose in the future.
>>> 
>>> In that case I'd recommend to simplify the patch by implementing only the
>>> part to suppress inlining of non-static functions. No need to overengineer.
>> 
>> the current design is trying to make the functionality more general although the part of disable inlining of
>> static functions does not have immediate use case. 
>> 
>> the additional implementation for the disabling inlining of static functions is very trivial and minimal. 
>> 
>> Personally I’d like to keep the current design.
>> 
>> However, I am flexible on this.
>> 
>>> 
>>>> thanks for the suggestion, how about -finline-linkage=[all|extern|static]?
>>> 
>>> I would suggest -finline-only-static. Note however that I do not have the
>>> authority to review this: you still need an opinion from an appropriate
>>> maintainer.
>> 
>> understand, thanks a lot for your comments and suggestions. 
> 
> With LTO "static" is too blurry - would -finline-only-hidden be OK
> with you?

the new inlining control is mainly to control inlining based on: whether this function is declared with “static” keyword or not at the source code level,
i.e, whether this function can ONLY be accessed inside the file or can be accessed from other files. 

As my understanding, even non-“static” functions can be “hidden” during the linking time, so, I think that “hidden” is not good for this purpose.

Qing
> 
>> thanks.
>> 
>> Qing
>>> 
>>> Alexander
>> 
>> 
> 
> -- 
> Richard Biener <rguenther@suse.de <mailto:rguenther@suse.de>>
> SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)



More information about the Gcc-patches mailing list