From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id 9B97B387741B; Tue, 13 Jul 2021 12:55:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9B97B387741B Received: by mail-ej1-x62f.google.com with SMTP id he13so41228733ejc.11; Tue, 13 Jul 2021 05:55:24 -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=uB91GwPpvarLiNJ71K+/cSyTfcVBuVC7c0v2jzND7JY=; b=fpvJlXsBm57ZpB1udxvNY01xCr3yM6cCWAKQYZLmohtPcmm95pmuUAryYHUIDXXz+A 5t5WGr63d7dJ6rtakySV28BHIH57C0s8Ny7fp7PEHNMg9Cz5GA2M2Xi6xoJt22tbpbeM +UVrH6wsBx5O7qMQQL5DUcKecFaeZzpyZj4Qw9V9sc0cpXyuswaUH7OOSkCdNupJskBM JFLePn07dqVUF0jGh7QYUwCxNQKSC4BYMredY0H1LDyVO5i+GvmGNhgb2zYLxMYSseg7 0mkzdjBj2m/EG/IW/XWNJM7I+yQWRRpf0S8urzDETygTNqouhJok/MH9q76iIEGG9fXw rLkQ== X-Gm-Message-State: AOAM533pIS0zXOseMffflwLmEtk5GMz76/nPgdGDoc5foFT8CsmlLfaX jDLVHUkGTCKU7N7uD9uF7baCp9WKImbgQSjGlfR9LEmN X-Google-Smtp-Source: ABdhPJzNb0udw1hdTHc4KMVwMpHJcBJw3q9ZK/znWb4eIEKcYYWdyxTbhtNKE6u3228gUOQ9D3vCGzPKpkO8faIhMa8= X-Received: by 2002:a17:906:c29a:: with SMTP id r26mr5661058ejz.235.1626180923482; Tue, 13 Jul 2021 05:55:23 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Tue, 13 Jul 2021 14:55:12 +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.9 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 12:55:26 -0000 On Tue, Jul 13, 2021 at 12:50 PM Erick Ochoa wrote: > > > 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. > > Thanks! > > > > > Why do you want to stream SSA trees for example? > > > > I am working on a prototype for a points-to analysis where the > implementation is an IPA_PASS as opposed to a SIMPLE_IPA_PASS. It is > still somewhat early in the prototype implementation stages but I > would like to have SSA trees at WPA time as a way to map constraints > variables back to Gimple. The idea is to generate most constraints at > LGEN time (some will have to be updated) and solve them at WPA time. > > Do you have any other suggestions on how to map constraint variables > (similar to the index in the varinfo_t array) back to Gimple (but now > as an IPA_PASS)? We have had similar discussions before, but now I am > looking at things more concretely, from the point of view of: how > exactly does one map the analysis back to Gimple while staying within > what is possible in the LTO framework? I guess the way to encode SSA trees would be to use sth like a , SSA-version tuple much like PTA internally uses the varinfo array index as identifier for the variables in the constraints. For local decls (as opposed to SSA names) it's a bit more difficult - you'd have to devise your own encoding here. What you can rely on I think is that for local variables UID relations are preserved, so you could sort cfun->local_decls and use the position in this array as encoding (in fact I see local_decls is streamed literally, so you don't even need to sort that for the start - but we could likely do that without harm to make searching for a UID O(log n)). > I do have a pass-specific data structure, but it contains references > to trees. It is similar to varinfo_t, which has a decl. I also have > another tree for expressions (the concrete use case right now is > having a global variable being assigned to a string literal), and a > field for ssa variables, which was intended to store a reference to > the corresponding tree. Again, as a way to map back the constraint > variable to Gimple. > > > There can be no > > references to those from other IPA entities? > > I don't follow this question. I think this may be a statement and not > a question. Please clarify this for me, but perhaps the following > might answer: Since I am working on an interprocedural analysis, SSA > variables may point to abstract memory locations allocated in > different functions. So I need to have a link between SSA variables > and whatever memory locations they might point to. So as said above - you need to devise your own "encoder" then and at WPA time hopefully not need to look at the actual trees but can treat them as opaque entities, only mapping back the result at LTRANS time (and only for the interesting functions / globals). Richard.