SSA and implicit uses.

Sanjiv Kumar Gupta sanjivkumargupta@yahoo.com
Tue Nov 2 17:43:00 GMT 2004


--- Joe Buck <Joe.Buck@synopsys.COM> wrote:

> On Tue, Nov 02, 2004 at 06:40:35AM -0800, Sanjiv
> Kumar Gupta wrote:
> > For statements like;
> >   a = 0;
> >   a++;
> >   a++;
> > 
> > My compiler generates SSA form like below:
> >   r200 = 0;
> >   r201 = r200 + 1;
> >   r202 = r201 + 1;
> > 
> > now all of r200, r201 and r202 are independent
> live
> > ranges and may get assigned different hard regs.
> 
> Actually, the above will quickly be turned into
> 
>     r200 = 0;
>     r201 = 1;
>     r202 = 2;
> 
> and you'll end up not using *any* registers.  Of
> course, you
> could construct another example that would better
> illustrate
> your point.
> 
Okay. Consider initial value of 'a' as unknown.

The point is that, when a single var gets splitted
into mulitple live ranges (and different hard regs
consequently), the code generated is worse than
what could have been generated if the original
var was kept into a single hard reg.

--Sanjiv

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Gcc mailing list