From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id 53743394D8A0; Tue, 13 Jul 2021 09:41:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 53743394D8A0 Received: by mail-ed1-x52d.google.com with SMTP id ca14so15441128edb.2; Tue, 13 Jul 2021 02:41:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Nz6vL2izwxkWOOcJEBlGy9eaqbDjiv5B7K4ss2WQSQ8=; b=H3zfC16Ecs1N4fmchVZ4gkxHbUSH+ZY6WMRgtTX7JWhEW1puuLGpWEuA3TnO8ttMyQ Grqk8EEdZBpIfjKSY4NFMpiQJO+8nMDwM5iLDrLbsTL6z4R/7Ld7uW8HX9rAR6Vn5s20 n7e8eDzY5WF/7ngAy+AunfMLNu49JnCmziJtKlvobbGAgk8HGXzfUgaRwabQPtKuJbku GNvzTh7Ua7yazGUCOx8IpBLUHfdX9dfdJZVJqd7wk7d33YcisPDtJKMGYEZnsg8hzlI/ nTKVw8QKVtrfdQs4yGoxn1jy4W6TniiDyJ/6APS+jWZKKsQXF0n1u8JY8xDlL8Moy+/S o54g== X-Gm-Message-State: AOAM5309+XVYKWa/VKLM/1WwNLL3ZcVq4gXzuhdKSJWogNV5jhpS+qKZ dNRyyanZqdpvjRk6NPYpGD6Ls544zaqEAF0qjJl8elNa X-Google-Smtp-Source: ABdhPJwjBRH9NVd4PyItVQUHo7TWeDUaMVxjWxaURjHZI8f5QAgcKpAdHyxW4MYj4xENhnXfSOpe4uy7pNZBCC2qnTc= X-Received: by 2002:a05:6402:31a6:: with SMTP id dj6mr4679635edb.248.1626169287182; Tue, 13 Jul 2021 02:41:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Tue, 13 Jul 2021 11:41:16 +0200 Message-ID: Subject: Re: tree decl stored during LGEN does not map to a symtab_node during WPA To: Erick Ochoa Cc: Jan Hubicka , GCC Development Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jul 2021 09:41:29 -0000 On Tue, Jul 13, 2021 at 11:21 AM Erick Ochoa 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 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!