This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
GIMPLE pass - Assignment evaluation
- From: Sandeep K Chaudhary <babbusandy2006 at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 1 Jul 2013 23:24:28 -0400
- Subject: GIMPLE pass - Assignment evaluation
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.