public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* A working GIMPLE simple IPA case to run?
@ 2021-02-17  4:21 Shuai Wang
  2021-02-17  8:04 ` Martin Liška
  0 siblings, 1 reply; 4+ messages in thread
From: Shuai Wang @ 2021-02-17  4:21 UTC (permalink / raw)
  To: GCC Development

Hello,

I am writing to inquire if there was any working example of GIMPLE
SIMPLE_IPA_PASS that I can follow and extend. I am familiar with doing
GIMPLE_PASS for intra-procedural analysis.

I tried to follow these threads:

https://www.cse.iitb.ac.in/grc/gcc-workshop-10/sources/slides/gccw10-gimple-rtl.pdf

https://gcc.gcc.gnu.narkive.com/BhNCSxDW/problem-with-ssa-form-usign-cgraph-nodes-and-push-cfun

However, it is really hard for me to somehow work out a "working example"
first. I find the regulations and definitions are generally hard to
comprehend.

Could anyone shed some light on this? Thank you very much!

Best,
Shuai

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A working GIMPLE simple IPA case to run?
  2021-02-17  4:21 A working GIMPLE simple IPA case to run? Shuai Wang
@ 2021-02-17  8:04 ` Martin Liška
  2021-02-20  8:15   ` Shuai Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Liška @ 2021-02-17  8:04 UTC (permalink / raw)
  To: Shuai Wang, GCC Development

On 2/17/21 5:21 AM, Shuai Wang via Gcc wrote:
> Could anyone shed some light on this? Thank you very much!

Hello.

I would recommend looking at any of the existing passes:
$ git grep SIMPLE_IPA_PASS
...

One reasonable example can be gcc/tree-profile.c.

Cheers,
Martin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A working GIMPLE simple IPA case to run?
  2021-02-17  8:04 ` Martin Liška
@ 2021-02-20  8:15   ` Shuai Wang
  2021-02-22 10:53     ` Martin Liška
  0 siblings, 1 reply; 4+ messages in thread
From: Shuai Wang @ 2021-02-20  8:15 UTC (permalink / raw)
  To: Martin Liška; +Cc: GCC Development

Thank you very much! Just a follow-up question regarding IPA.

Currently I can follow the tree-profile.c sample to perform IPA. However,
my analysis is limited to all functions within one .c file. Is it possible
for me to do cross- .c file analysis? That is, suppose there is a function
foo in source1.c called function bar in source2.c. How can I cross analyze
foo then bar?

Thank you!

Best,
Shuai



On Wed, Feb 17, 2021 at 4:04 PM Martin Liška <mliska@suse.cz> wrote:

> On 2/17/21 5:21 AM, Shuai Wang via Gcc wrote:
> > Could anyone shed some light on this? Thank you very much!
>
> Hello.
>
> I would recommend looking at any of the existing passes:
> $ git grep SIMPLE_IPA_PASS
> ...
>
> One reasonable example can be gcc/tree-profile.c.
>
> Cheers,
> Martin
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A working GIMPLE simple IPA case to run?
  2021-02-20  8:15   ` Shuai Wang
@ 2021-02-22 10:53     ` Martin Liška
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Liška @ 2021-02-22 10:53 UTC (permalink / raw)
  To: Shuai Wang; +Cc: GCC Development

On 2/20/21 9:15 AM, Shuai Wang wrote:
> Thank you very much! Just a follow-up question regarding IPA.
> 
> Currently I can follow the tree-profile.c sample to perform IPA. However, my analysis is limited to all functions within one .c file. Is it possible for me to do cross- .c file analysis? That is, suppose there is a function foo in source1.c called function bar in source2.c. How can I cross analyze foo then bar?

Hello.

Then you will need a write a proper IPA pass:
https://gcc.gnu.org/onlinedocs/gccint/IPA.html#IPA

or for testing purpose you can use -flto -flto-partition=one

Martin

> 
> Thank you!
> 
> Best,
> Shuai
> 
> 
> 
> On Wed, Feb 17, 2021 at 4:04 PM Martin Liška <mliska@suse.cz <mailto:mliska@suse.cz>> wrote:
> 
>     On 2/17/21 5:21 AM, Shuai Wang via Gcc wrote:
>      > Could anyone shed some light on this? Thank you very much!
> 
>     Hello.
> 
>     I would recommend looking at any of the existing passes:
>     $ git grep SIMPLE_IPA_PASS
>     ...
> 
>     One reasonable example can be gcc/tree-profile.c.
> 
>     Cheers,
>     Martin
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-22 10:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-17  4:21 A working GIMPLE simple IPA case to run? Shuai Wang
2021-02-17  8:04 ` Martin Liška
2021-02-20  8:15   ` Shuai Wang
2021-02-22 10:53     ` Martin Liška

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).