public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Richard Biener <richard.guenther@gmail.com>,
	Qing Zhao <qing.zhao@oracle.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Jan Hubicka <hubicka@ucw.cz>
Subject: Re: [PATCH] IPA: support -flto + -flive-patching=inline-clone
Date: Thu, 6 Oct 2022 10:40:25 +0200	[thread overview]
Message-ID: <931252d4-e4d1-312a-a9dc-933f91f0eab9@suse.cz> (raw)
In-Reply-To: <CAFiYyc298v8XYPcn5yi802FO4Ticr-6VsHw-UN5NqS2P+rMGtg@mail.gmail.com>

On 10/6/22 10:29, Richard Biener wrote:
> On Wed, Oct 5, 2022 at 8:18 PM Qing Zhao via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
>>
>>
>>
>>> On Oct 5, 2022, at 1:36 PM, Martin Liška <mliska@suse.cz> wrote:
>>>
>>> On 10/5/22 16:50, Qing Zhao wrote:
>>>> I have two questions on this:
>>>
>>> Hello.
>>>
>>>>
>>>> 1.  What’s the motivation to enable -flive-patching with -flto? Is there any application that will try -flive-patching with -flto now?
>>>
>>> We're planning supporting GCC LTO Linux kernel support, so that's one motivation. And the second one is a possible
>>> use in user-space livepatching. Note majority of modern distros default to -flto (openSUSE, Fedora, Debian, Ubuntu, ...).
>>
>> Okay, I see. That’s reasonable.
>>>
>>>>
>>>> 2. Why only enable -flive-patching=inline-clone with -flto?
>>>
>>> Because the inline-only-static level (which you added/requested) would have to properly
>>> block inter-procedural inlining that happens in LTO (can_inline_edge_by_limits_p) and
>>> I'm not sure it would be properly blocked. So, feel free to extend my patch if you want?
>>
>> -flive-patching=inline-only-static
>>
>> Only enable static functions inlining,  all the inlining of external visible functions are blocked, So, LTO should be compatible with this naturally without any issue, I think.
>>
>> i.e, when "-flive-patching=inline-only-static -flto"  present together, all the inter-procedural inlining should be automatically blocked by -flive-patching=inline-only-static already.
>>
>> Do I miss anything here?
> 
> WPA will promote externally visible functions static when all accesses
> are from LTO IR, I don't think we preserve
> the "original" visibility for IPA inlining heuristics.

That said, can we go with my original patch?

> 
> OTOH inline-only-static could disable WPA inlining and do all inlining early ...

And this can be extended by Oracle folks if they are interested in -flive-patching=inline-only-static
combined with LTO.

Martin

> 
> Richard,
> 
>>
>> thanks.
>>
>> Qing
>>
>>>
>>> Martin
>>>
>>>>
>>>> thanks.
>>>
>>


  reply	other threads:[~2022-10-06  8:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05 11:41 Martin Liška
2022-10-05 14:50 ` Qing Zhao
2022-10-05 17:36   ` Martin Liška
2022-10-05 18:18     ` Qing Zhao
2022-10-06  8:29       ` Richard Biener
2022-10-06  8:40         ` Martin Liška [this message]
2022-10-06 13:18         ` Qing Zhao
2022-10-07  6:34           ` Richard Biener
2022-10-07 13:03             ` Jan Hubicka
2022-10-07 14:30               ` Qing Zhao
2022-10-07 14:43                 ` Jan Hubicka
2022-10-07 15:36                   ` Qing Zhao
2022-10-07 13:04             ` Qing Zhao
2022-10-07 13:50               ` Martin Liška

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=931252d4-e4d1-312a-a9dc-933f91f0eab9@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=qing.zhao@oracle.com \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).