public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Jambor <mjambor@suse.cz>
To: Shuai Wang <wangshuai901@gmail.com>
Cc: GCC Development <gcc@gcc.gnu.org>
Subject: Re: Performing inter-procedural dataflow analysis
Date: Thu, 18 Feb 2021 11:27:11 +0100	[thread overview]
Message-ID: <ri68s7lpt6o.fsf@suse.cz> (raw)
In-Reply-To: <CAEQMQomFmXqo89qmQayNZSQaQYrM9KChxPPeE0+At=xOr1X+Rw@mail.gmail.com>

Hi,

On Thu, Feb 18 2021, Shuai Wang via Gcc wrote:
> Hello,
>
> I am doing interprocedural dataflow analysis and countered the following
> issue. Suppose I have an GIMPLE IR code as follows, which is after the
> "simdclone" pass while before my own SIMPLE IPA pass:
>
>
> foo (int a, int b)
> {
>   int c;
>   int d;
>   int D.2425;
>   int _5;
>
>   <bb 2> :
> *  c_4 = a_2(D) + b_3(D);  *
> *  _5 = c_4;*
>   ....
>
> As you can see, while propagating certain dataflow facts among local
> variables are smooth (e.g., from c_4 --> c_4 --> _5), I can hardly somehow
> "link" function parameter "a" (or "b") with its first local usage "a_2(D)"
> or "b_3(D)".

are you perhaps looking for function ssa_default_def (defined in tree-dfa.c)?

>
> So my question is, when traversing the GIMPLE statements and encounter SSA
> variables like "a_2(D)" or "b_3(D)", how do I know they originate from
> parameter "a" and "b"?

You check that SSA_NAME_IS_DEFAULT_DEF is true (and that their
SSA_NAME_VAR is the PARM_DECL you are after).

Martin

      parent reply	other threads:[~2021-02-18 10:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18  3:09 Shuai Wang
2021-02-18  3:12 ` Shuai Wang
2021-02-18  5:15 ` Prathamesh Kulkarni
2021-02-18 10:27 ` Martin Jambor [this message]

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=ri68s7lpt6o.fsf@suse.cz \
    --to=mjambor@suse.cz \
    --cc=gcc@gcc.gnu.org \
    --cc=wangshuai901@gmail.com \
    /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).