From: Martin Jambor <mjambor@suse.cz>
To: Erick Ochoa <eochoa@gcc.gnu.org>
Cc: gcc@gcc.gnu.org
Subject: Re: Question about reading LTO function summaries
Date: Tue, 06 Apr 2021 14:07:16 +0200 [thread overview]
Message-ID: <ri6a6qbmxaj.fsf@suse.cz> (raw)
In-Reply-To: <CAJ_nqzj=BO1MJ6r6DDkyNO4qhDa1Nk4CV4v+j2wJ=THqKbbxOA@mail.gmail.com>
Hi,
On Fri, Mar 26 2021, Erick Ochoa via Gcc wrote:
> I already have some experience developing SIMPLE_IPA_PASSes, but I am
> looking to understand IPA_PASSes better. I have made a hello world ipa
> pass that stores "hello world $FUNCTION_NAME" in the function
> summaries; however, I am having trouble reading this information back.
> Can someone help me understand how to use these interfaces correctly?
>
> At the moment, it **seems** to be writing information correctly.
> (I.e., it doesn't segfault when attempting to write data.) However, in
> my read summary function (ipa_hello_world_read_summary (void)) the
> function `lto_get_summary_section_data (file_data,
> LTO_section_ipa_hello_world, &len);` always returns NULL and
> `file_data_vec` is of size 1. This means that at run time, there is
> only one call to `lto_get_summary_section_data` and it returns NULL.
I looked at the code you posted and compared it with streaming in
ipa-sra.c and did not spot any difference that could result in this
behavior.
I guess you have checked that the functions are called from proper
hooks? (I.e. from write_summary and read_summary or
write_optimization_summary and read_optimization_summary, depending on
what you are trying to do, and not some mixture of these combinations?)
You can try and send the whole patch (hopefully a hello world pass would
not be too large) and I can have a look.
Martin
next prev parent reply other threads:[~2021-04-06 12:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-26 12:49 Erick Ochoa
2021-03-30 8:18 ` Erick Ochoa
2021-04-01 12:04 ` Erick Ochoa
2021-04-06 12:07 ` Martin Jambor [this message]
2021-04-06 14:50 ` Erick Ochoa
2021-04-09 13:41 ` Martin Jambor
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=ri6a6qbmxaj.fsf@suse.cz \
--to=mjambor@suse.cz \
--cc=eochoa@gcc.gnu.org \
--cc=gcc@gcc.gnu.org \
/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).