|Eliminating SSA variables email@example.com (Richard M.) (2005-07-28)|
|Re: Eliminating SSA variables firstname.lastname@example.org (Jeremy Singer) (2005-07-31)|
|Re: Eliminating SSA variables email@example.com (dz) (2005-07-31)|
|Re: Eliminating SSA variables firstname.lastname@example.org (Ali Al-Shabibi) (2005-07-31)|
|From:||Ali Al-Shabibi <email@example.com>|
|Date:||31 Jul 2005 00:48:54 -0400|
|Posted-Date:||31 Jul 2005 00:48:54 EDT|
Basically, what you want to do is avoid the copy of i2 to i1 on the last
iteration, to do this you must identify the critical edge and split it.
In your case the critiacal edge is the your goto top. So in your SSA
form you will move the assignment of i2 to i1 into another node and only
jump to that node in the case where the if (i2 < 10) is true.
Hope this is clear enough. This problem is called the lost-copy problem
and you can find very good resources about this on the web.
-- Ali Al-Shabibi (Aka Al-Hacker)
Richard M. wrote:
> Given a source program fragment like this:
> int i;
> for (i = 0; i < 10; i++)
> After SSA transformation and back, we have
> i = 0;
> i1 = i;
> i2 = i1+1;
> i1 = i2;
> if (i2 < 10) goto top;
> The problem now is that there are 2 variables inside the loop, i1 and i2
> with overlapping lifetimes, thus using more registers and causing extra
> register moves at code generation time. Is there something we can do to
> address this problem?
Return to the
Search the comp.compilers archives again.