public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Erick Ochoa <eochoa@gcc.gnu.org>
Cc: Jan Hubicka <hubicka@ucw.cz>, GCC Development <gcc@gcc.gnu.org>
Subject: Re: tree decl stored during LGEN does not map to a symtab_node during WPA
Date: Tue, 13 Jul 2021 11:41:16 +0200	[thread overview]
Message-ID: <CAFiYyc3OVpA9t3pcNQu__zJiSZoH74_-Aj-=FnBPTWk45FEBVw@mail.gmail.com> (raw)
In-Reply-To: <CAJ_nqziTtLpXAmFcYAGwO=MEOsO52=nNfWEmjDY=Qhj372sfnw@mail.gmail.com>

On Tue, Jul 13, 2021 at 11:21 AM Erick Ochoa <eochoa@gcc.gnu.org> wrote:
>
> Hi,
>
> Just to clarify a similar question: I am using stream_write_tree and
> looking at the comments it says that it is assumed that the tree T is
> already in the encoder cache. Does this mean that I have to use
> lto_symtab_encoder_t for all trees I want to store in summaries? I
> thought the encoder only works for trees which are stored on the
> symbol table. Would this mean that the only trees that can be written
> out to summaries are those that are declarations? Or are there any
> other encoders?
>
> I am trying to store SSA trees at LGEN and read them back during WPA.

There are entities, like SSA names and STRING_CSTs which are specially
encoded and if you stream those in your LGEN data you have to set up
appropriate encoders.  In general streaming arbitrary trees isn't the
best thing to do, usually you're interested in specific pieces only.  That's
especially true for things "local" to a function (like SSA names), I think
existing IPA passes only stream encoded references to global entities
(or parameters) and all "local" info is some pass specific data streamed
as raw data, not trees.

Why do you want to stream SSA trees for example?  There can be no
references to those from other IPA entities?

> Thanks! Any help is appreciated.
>
> On Mon, 12 Jul 2021 at 12:55, Erick Ochoa <eochoa@gcc.gnu.org> wrote:
> >
> > > I'm not too familiar with it but I think you're supposed to stream encoded
> > > symtab references during LGEN/WPA,
> >
> > Thanks Richard, this happened to be the solution. I am now using
> > lto_symtab_encoder_t to encode the declarations during LGEN and decode
> > them during WPA.
> >
> > Are there any more limitations of using stream_write_tree that one
> > should be aware of? Now I am looking into storing trees of the type
> > STRING_CST and I think this might be causing me a problem at WPA time.
> > I think it segfaults at the moment of creating the process, but I
> > still need more time to investigate. Perhaps you might know if storing
> > STRING_CST trees has to be handled in a special way? Not sure if it
> > also has something to do with LTO file sections. The tree is used to
> > initialize a global static variable.
> >
> > Thanks!

  reply	other threads:[~2021-07-13  9:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07  9:27 Erick Ochoa
2021-07-09  7:51 ` Erick Ochoa
2021-07-09  9:49   ` Richard Biener
2021-07-12 10:55     ` Erick Ochoa
2021-07-13  9:21       ` Erick Ochoa
2021-07-13  9:41         ` Richard Biener [this message]
2021-07-13 10:49           ` Erick Ochoa
2021-07-13 12:55             ` Richard Biener
2021-07-14 13:56               ` Erick Ochoa
2021-07-15  7:23                 ` Richard Biener
2021-07-21 16:55                   ` Erick Ochoa
2021-07-22 11:40                     ` Richard Biener
2021-07-22 12:04                       ` Erick Ochoa
2021-07-22 12:08                         ` Erick Ochoa
2021-07-22 12:23                         ` Richard Biener
2021-07-22 12:33                           ` Erick Ochoa
2021-07-22 12:48                             ` Richard Biener
2021-07-22 14:32                               ` Erick Ochoa
2021-07-28 10:35                                 ` Richard Biener
2021-07-13 11:56           ` Erick Ochoa

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='CAFiYyc3OVpA9t3pcNQu__zJiSZoH74_-Aj-=FnBPTWk45FEBVw@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=eochoa@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    /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).