From: Qing Zhao <qing.zhao@oracle.com>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: Jason Merrill <jason@redhat.com>, Jeff Law <law@redhat.com>,
Richard Biener <rguenther@suse.de>,
gcc Patches <gcc-patches@gcc.gnu.org>,
Jakub Jelinek <jakub@redhat.com>,
Alexander Monakov <amonakov@ispras.ru>,
andrew Pinski <pinskia@gmail.com>,
martin Sebor <msebor@gmail.com>
Subject: Re: [PATCH][Middle-end][Version 4]Add a new option to control inlining only on static functions
Date: Wed, 26 Sep 2018 21:36:00 -0000 [thread overview]
Message-ID: <131EB12C-DC35-4B3C-9F89-40EBA5317261@oracle.com> (raw)
In-Reply-To: <20180926171642.GG61973@kam.mff.cuni.cz>
> On Sep 26, 2018, at 12:16 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
>
>>>
>>> On Sep 26, 2018, at 10:06 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
>>>
>>>> On Wed, Sep 26, 2018 at 10:45 AM, Jeff Law <law@redhat.com> wrote:
>>>>> On 9/26/18 7:38 AM, Jason Merrill wrote:
>>>>>> On Wed, Sep 26, 2018 at 9:24 AM, Richard Biener <rguenther@suse.de> wrote:
>>>>>>> IIRC he explicitely wanted 'static' not 'hidden' linkage. Not sure
>>>>>>> what 'internal' would mean in this context.
>>>>>>
>>>>>> I mean internal linkage as in the C and C++ standards.
>>>>
>>>>> Since this is primarily for kernel hot patching, I think we're looking
>>>>> to restrict inlining to functions that have visibility limited to a
>>>>> compilation unit.
>>>>
>>>> Right, which is internal linkage.
>>>>
>>>> C11: "Within one translation unit, each declaration of an identifier
>>>> with internal linkage denotes the same object or function."
>>>> C++17: "When a name has internal linkage, the entity it denotes can be
>>>> referred to by names from other scopes in the same translation unit."
>>>>
>>>> Or perhaps we want to say "not external linkage", i.e. !TREE_PUBLIC as
>>>> richi suggested.
>>>
>>> I am not quite sure if we can relate visibility flags we have at this stage
>>> to visibility in source languge in very coherent way. They change a lot with
>>> LTO and we may want to make this option incompatible with LTO, but even w/o
>>> we can turn function static that previously wasn’t.
>>
>> Looks like both LTO and whole_program need to be made incompatible with -finline-only-static.
>> from my study of the function “cgraph_externally_visible_p”, comdat functions can ONLY be turned into
>> static when either “in_lto_p” or “whole_program” is true.
>
> This is not quite the case, because, we can still clone them to static functions
> or derive fact about their side effects (such that information if they write/read
> memory, particular global var etc). All this inter-procedural propagation
> is guarded by get_availability predicate returning at least AVAILABLE.
Okay, I see.
>
> If you make this to be INTERPOSABLE (which means it can be replaced by different
> implementation by linker and that is probably what we want for live patching)
> then also inliner, ipa-sra and other optimization will give up on these.
do you suggest that to set the global function as AVAIL_INTERPOSABLE when -finline-only-static
is present? then we should avoid all issues?
Qing
> Honza
>>
>>
>>> For example comdat that was cloned by IPA-SRA. See can_be_local_p and
>>> comdat_can_be_unshared_p predicates. Similar problem happens to clones created
>>> by ipa-cp.
>>>
>>> I guess we want to disable localization and cloning in this case as well.
>>> I wonder what else.
>>
>> Yes, I think we should make -finline-only-static incompatible with cloning and tree-sra too.
>>
>> Qing
>>>
>>> Honza
next prev parent reply other threads:[~2018-09-26 21:36 UTC|newest]
Thread overview: 124+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-18 18:58 [PATCH][Middle-end][Version 3]Add " Qing Zhao
2018-09-18 23:18 ` Martin Sebor
2018-09-19 15:07 ` Qing Zhao
2018-09-21 15:19 ` [PATCH][Middle-end][Version 4]Add " Qing Zhao
2018-09-26 1:01 ` PING: " Qing Zhao
2018-09-26 11:20 ` Alexander Monakov
2018-09-26 12:49 ` Paolo Carlini
2018-09-26 14:43 ` Qing Zhao
2018-09-26 15:18 ` Alexander Monakov
2018-09-26 23:07 ` Qing Zhao
2018-09-26 23:54 ` Alexander Monakov
2018-09-27 5:16 ` Qing Zhao
2018-09-27 7:46 ` Richard Biener
2018-09-27 16:30 ` Qing Zhao
2018-09-27 8:55 ` Alexander Monakov
2018-09-27 8:58 ` Jan Hubicka
2018-09-27 11:12 ` Richard Biener
2018-09-26 13:24 ` Jason Merrill
2018-09-26 13:31 ` Richard Biener
2018-09-26 13:40 ` Jason Merrill
2018-09-26 14:46 ` Jeff Law
2018-09-26 14:58 ` Jason Merrill
2018-09-26 15:10 ` Jan Hubicka
2018-09-26 17:12 ` Qing Zhao
2018-09-26 17:22 ` Jan Hubicka
2018-09-26 21:36 ` Qing Zhao [this message]
2018-09-27 9:47 ` Jan Hubicka
2018-09-27 12:29 ` GCC options for kernel live-patching (Was: Add a new option to control inlining only on static functions) Martin Jambor
2018-09-27 16:40 ` Qing Zhao
2018-10-01 17:14 ` Qing Zhao
2018-10-02 8:38 ` Martin Jambor
2018-10-02 14:00 ` Qing Zhao
2018-10-02 14:11 ` Martin Liška
2018-10-02 14:55 ` Qing Zhao
2018-10-02 14:59 ` Martin Liška
2018-10-02 15:24 ` Qing Zhao
2018-10-02 17:16 ` Martin Liška
2018-10-02 18:34 ` Richard Biener
2018-10-02 21:25 ` Qing Zhao
2018-10-03 9:05 ` Martin Liška
2018-10-03 10:53 ` Martin Jambor
2018-10-03 16:11 ` Qing Zhao
2018-10-04 13:20 ` Richard Biener
2018-10-18 19:36 ` [RFC] GCC support for live-patching Qing Zhao
2018-10-19 8:53 ` Bernhard Reutner-Fischer
2018-10-19 18:33 ` Qing Zhao
2018-10-24 21:16 ` Alexandre Oliva
2018-10-19 14:25 ` Andi Kleen
2018-10-19 18:33 ` Qing Zhao
2018-10-20 6:47 ` Andi Kleen
2018-10-22 13:07 ` Martin Jambor
2018-10-22 17:59 ` Qing Zhao
2018-10-22 15:36 ` Miroslav Benes
2018-10-22 21:01 ` Qing Zhao
2018-10-23 9:37 ` Miroslav Benes
2018-10-23 19:54 ` Qing Zhao
2018-10-24 13:17 ` Miroslav Benes
2018-10-23 13:37 ` Nicolai Stange
2018-10-23 20:34 ` Qing Zhao
2018-10-23 21:18 ` Nicolai Stange
2018-10-24 17:19 ` Qing Zhao
2018-10-31 22:04 ` [RFC] [2nd version] " Qing Zhao
2018-10-31 22:08 ` [RFC] " Qing Zhao
2018-10-03 9:23 ` GCC options for kernel live-patching (Was: Add a new option to control inlining only on static functions) Jan Hubicka
2018-10-03 11:27 ` Martin Liška
2018-10-22 10:49 ` Martin Liška
[not found] ` <20181105095135.j3mnzox6rkktkoto@kam.mff.cuni.cz>
2018-11-05 22:26 ` Qing Zhao
2018-11-07 14:22 ` Martin Liška
2018-11-07 14:27 ` Jan Hubicka
2018-11-07 14:44 ` Martin Liška
2018-11-08 14:59 ` Jan Hubicka
2018-11-09 15:33 ` [PATCH][RFC] Come up with -flive-patching master option Martin Liška
2018-11-09 17:43 ` Qing Zhao
2018-11-10 8:51 ` Martin Liška
2018-11-12 2:28 ` Qing Zhao
2018-11-12 8:53 ` Martin Liška
2018-11-12 22:29 ` Qing Zhao
2018-11-13 17:49 ` Qing Zhao
2018-11-13 19:18 ` Miroslav Benes
2018-11-13 21:16 ` Qing Zhao
2018-11-14 15:03 ` Martin Liška
2018-11-14 17:54 ` Qing Zhao
2018-11-15 8:41 ` Martin Liška
2018-11-15 15:41 ` Qing Zhao
2018-11-16 1:36 ` [PATCH]Come " Qing Zhao
2018-11-16 15:26 ` Martin Liška
2018-11-16 15:51 ` Jan Hubicka
2018-11-16 16:25 ` Qing Zhao
2018-11-16 16:05 ` Qing Zhao
2018-11-19 8:12 ` Martin Liška
[not found] ` <F78B52B9-9F9A-4FA0-91BF-A33307D87AA8@oracle.c! ! om>
2018-11-19 15:53 ` Qing Zhao
2018-11-20 12:10 ` Martin Liška
2018-11-20 15:32 ` [PATCH][Version 3]Come " Qing Zhao
2018-11-26 15:54 ` PING: " Qing Zhao
2018-11-30 17:04 ` [wwwdocs] [PATCH]introduce new -flive-patching master option into gcc9 Qing Zhao
2018-11-30 18:29 ` Jeff Law
2018-11-30 20:44 ` Qing Zhao
2018-11-28 15:52 ` [PATCH][Version 3]Come up with -flive-patching master option Jan Hubicka
2018-11-28 20:25 ` Qing Zhao
2018-11-29 16:16 ` Qing Zhao
2018-12-05 23:16 ` Question on Disable no throw for " Qing Zhao
2019-01-02 11:47 ` Martin Liška
2019-01-09 11:28 ` Martin Liška
2018-12-07 13:07 ` [PATCH][Version 3]Come up with " Rainer Orth
2018-12-07 15:14 ` Qing Zhao
2019-04-10 14:46 ` Jonathan Wakely
2019-04-10 19:24 ` Qing Zhao
2019-04-10 20:01 ` Jonathan Wakely
2019-04-11 8:11 ` Richard Biener
2018-11-14 22:05 ` [PATCH][RFC] Come " Miroslav Benes
[not found] ` <20181110170343.g3k7j7rlydid3ahr@kam.mff.cuni.cz>
2018-11-12 9:29 ` Martin Liška
2018-11-09 18:38 ` Bernhard Reutner-Fischer
2018-11-10 8:48 ` Martin Liška
2018-10-03 12:18 ` GCC options for kernel live-patching (Was: Add a new option to control inlining only on static functions) Martin Jambor
2018-10-03 16:00 ` Qing Zhao
2018-10-23 12:34 ` Performance impact of disabling non-clone IPA optimizations for the Linux kernel (was: "GCC options for kernel live-patching") Nicolai Stange
2018-10-24 14:30 ` Jiri Kosina
2018-10-24 14:44 ` Miroslav Benes
2018-09-27 16:32 ` [PATCH][Middle-end][Version 4]Add a new option to control inlining only on static functions Qing Zhao
2018-09-26 22:42 ` Qing Zhao
2018-09-26 16:02 ` Qing Zhao
2018-09-26 15:52 ` Qing Zhao
2018-09-26 16:02 ` Jan Hubicka
2018-09-26 18:51 ` Qing Zhao
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=131EB12C-DC35-4B3C-9F89-40EBA5317261@oracle.com \
--to=qing.zhao@oracle.com \
--cc=amonakov@ispras.ru \
--cc=gcc-patches@gcc.gnu.org \
--cc=hubicka@ucw.cz \
--cc=jakub@redhat.com \
--cc=jason@redhat.com \
--cc=law@redhat.com \
--cc=msebor@gmail.com \
--cc=pinskia@gmail.com \
--cc=rguenther@suse.de \
/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).