public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* GIMPLE pass - Assignment evaluation
@ 2013-07-02  3:24 Sandeep K Chaudhary
  2013-07-02  5:44 ` Marc Glisse
  0 siblings, 1 reply; 10+ messages in thread
From: Sandeep K Chaudhary @ 2013-07-02  3:24 UTC (permalink / raw)
  To: gcc-help

Hi guys,

I am writing a GIMPLE pass in which I need to inspect the assignments.
For example, for the below statements, I need to find the value of the
second and third assignments which are '2' and '7'.

VAR1 = 1;
VAR1++;
VAR1 = VAR1 + 5;

But the GIMPLE IR only has the following statements i.e. no optimization.

  VAR1_2 = 1;
  VAR1_3 = VAR1_2 + 1;
  VAR1_4 = VAR1_3 + 5;

How can I make it perform calculations on RHS? Are there some flags
that I can enable?

Also, I thought of going with RTL passes but RTL IR seems too complex
for my use and also it's not suitable for high level optimizations.
Please suggest.

--
Thanks and regards,
Sandeep K Chaudhary.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* GIMPLE pass - Assignment evaluation
@ 2013-12-09 23:05 Sandeep K Chaudhary
  0 siblings, 0 replies; 10+ messages in thread
From: Sandeep K Chaudhary @ 2013-12-09 23:05 UTC (permalink / raw)
  To: gcc-help

Hi Guys,

I am writing a GIMPLE pass in which I need to inspect the assignments.
For example, for the below statements, I need to find the value of the
second and third assignments which are '2' and '7'.

VAR1 = 1;
VAR1++;
VAR1 = VAR1 + 5;

But the GIMPLE IR only has the following statements i.e. no optimization.

  VAR1_2 = 1;
  VAR1_3 = VAR1_2 + 1;
  VAR1_4 = VAR1_3 + 5;

How can I make it perform calculations on RHS? Are there some flags
that I can enable?

I tried -O1 and higher optimization levels but I don't see any
difference. This is how I am building and loading my plugin...

g++ -I`g++ -print-file-name=plugin`/include -fPIC -shared -O1
gimple_pass.c -o plugin.so
g++ -fplugin=/home/sandeep/myplugin/gimple/plugin.so -O1 -c test.c

Also, I thought of going with RTL passes but RTL IR seems too complex
for my use and also it's not suitable for high level optimizations.
Please suggest.

Thanks and regards,
Sandeep.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* GIMPLE pass - Assignment evaluation
@ 2013-12-16 21:10 Sandeep K Chaudhary
  2013-12-17  1:33 ` David Malcolm
  0 siblings, 1 reply; 10+ messages in thread
From: Sandeep K Chaudhary @ 2013-12-16 21:10 UTC (permalink / raw)
  To: gcc-help, gcc

Hi Guys,

I am writing a GIMPLE pass in which I need to inspect the assignments.
For example, for the below statements, I need to find the value of the
second and third assignments which are '2' and '7'.

VAR1 = 1;
VAR1++;
VAR1 = VAR1 + 5;

But the GIMPLE IR only has the following statements i.e. no optimization.

  VAR1_2 = 1;
  VAR1_3 = VAR1_2 + 1;
  VAR1_4 = VAR1_3 + 5;

How can I make it perform calculations on RHS? Are there some flags
that I can enable?

I tried -O1 and higher optimization levels but I don't see any
difference. This is how I am building and loading my plugin...

g++ -I`g++ -print-file-name=plugin`/include -fPIC -shared -O1
gimple_pass.c -o plugin.so
g++ -fplugin=/home/sandeep/myplugin/gimple/plugin.so -O1 -c test.c

Also, I thought of going with RTL passes but RTL IR seems too complex
for my use and also it's not suitable for high level optimizations.
Please suggest.

Thanks and regards,
Sandeep.

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

end of thread, other threads:[~2013-12-17  7:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-02  3:24 GIMPLE pass - Assignment evaluation Sandeep K Chaudhary
2013-07-02  5:44 ` Marc Glisse
2013-07-02 17:09   ` Sandeep K Chaudhary
2013-07-10  8:18     ` Sandeep K Chaudhary
2013-12-09 23:05 Sandeep K Chaudhary
2013-12-16 21:10 Sandeep K Chaudhary
2013-12-17  1:33 ` David Malcolm
2013-12-17  6:24   ` Sandeep K Chaudhary
2013-12-17  6:41     ` Uday P. Khedker
2013-12-17  7:26       ` Sandeep K Chaudhary

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