public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
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 10:45:42 +0530	[thread overview]
Message-ID: <CAAgBjMkhS5FQR6Qp=k=QpWMSUt9z=tSRbSx7LJafZXrEdLJ+vQ@mail.gmail.com> (raw)
In-Reply-To: <CAEQMQomFmXqo89qmQayNZSQaQYrM9KChxPPeE0+At=xOr1X+Rw@mail.gmail.com>

On Thu, 18 Feb 2021 at 08:39, Shuai Wang via Gcc <gcc@gcc.gnu.org> 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)".
>
> 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 can use SSA_NAME_VAR to get the "base" variable corresponding to ssa name,
and then check it against PARM_DECL.
Sth like:
is_param = TREE_CODE (SSA_NAME_VAR (ssa_name)) == PARM_DECL;

Thanks,
Prathamesh
>
> Thank you!
>
> Best,
> Shuai

  parent reply	other threads:[~2021-02-18  5:16 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 [this message]
2021-02-18 10:27 ` 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='CAAgBjMkhS5FQR6Qp=k=QpWMSUt9z=tSRbSx7LJafZXrEdLJ+vQ@mail.gmail.com' \
    --to=prathamesh.kulkarni@linaro.org \
    --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).