Re: GIMPLE pass - Assignment evaluation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 1 Jul 2013, Sandeep K Chaudhary wrote:

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?

-O1 (or higher) enables the CCP pass which propagates the constants. Note that only the last value will be left after that. If you need the intermediate ones for some reason, maybe you could look into the CCP pass and modify it for your needs?

--
Marc Glisse




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux