public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Question about semantics of cgraph_node::prevailing_p
@ 2021-10-13 17:52 Erick Ochoa
  2021-10-14  7:40 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Erick Ochoa @ 2021-10-13 17:52 UTC (permalink / raw)
  To: gcc

Hi,

My current understanding of LTO is that the callgraph is very dynamic
(i.e., optimizations might add or remove cgraph_nodes). A while back I
encountered an issue where I couldn't print the cgraph_node::name of a
function during the execute stage in LTO. I found that the only thing
different was that these cgraph_nodes had a prevailing_p () returning
false. There's only a few other places in the GCC sources that look at
prevailing_p (ipa-fnsummary.c and ipa-prop.c) and both of them seem to
drop information if the cgraph_node is not prevailing.

I took this as guidance and in my optimization I dropped information
from non-prevailing cgraph_nodes. (I figured out it must be something
similar to the remove cgraph_hooks.) However, I am now revisiting
whether this interpretation was correct or not. Can someone tell me
what does cgraph_node::prevailing_p actually means?

Also, is there a way to code an LTO test where a specific
cgraph_node's prevailing_p returns false? That way I could probably
verify the correctness of my analysis in the presence of
non-prevailing_p cgraph_nodes.

Thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question about semantics of cgraph_node::prevailing_p
  2021-10-13 17:52 Question about semantics of cgraph_node::prevailing_p Erick Ochoa
@ 2021-10-14  7:40 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2021-10-14  7:40 UTC (permalink / raw)
  To: Erick Ochoa; +Cc: GCC Development

On Wed, Oct 13, 2021 at 7:54 PM Erick Ochoa via Gcc <gcc@gcc.gnu.org> wrote:
>
> Hi,
>
> My current understanding of LTO is that the callgraph is very dynamic
> (i.e., optimizations might add or remove cgraph_nodes). A while back I
> encountered an issue where I couldn't print the cgraph_node::name of a
> function during the execute stage in LTO. I found that the only thing
> different was that these cgraph_nodes had a prevailing_p () returning
> false. There's only a few other places in the GCC sources that look at
> prevailing_p (ipa-fnsummary.c and ipa-prop.c) and both of them seem to
> drop information if the cgraph_node is not prevailing.
>
> I took this as guidance and in my optimization I dropped information
> from non-prevailing cgraph_nodes. (I figured out it must be something
> similar to the remove cgraph_hooks.) However, I am now revisiting
> whether this interpretation was correct or not. Can someone tell me
> what does cgraph_node::prevailing_p actually means?
>
> Also, is there a way to code an LTO test where a specific
> cgraph_node's prevailing_p returns false? That way I could probably
> verify the correctness of my analysis in the presence of
> non-prevailing_p cgraph_nodes.

Try a C++ template instantiation used from two TUs you link together.

Richard.

>
> Thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-14  7:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 17:52 Question about semantics of cgraph_node::prevailing_p Erick Ochoa
2021-10-14  7:40 ` Richard Biener

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).