This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Lno branch merge part 3 -- ssa form updatingimprovements


On Mon, 2004-06-14 at 23:04, Zdenek Dvorak wrote:

> yes, although it would be relatively easy to avoid (the reason I did not
> do it is that you would need to somehow tell which of the definitions is
> "primary" one, which sometimes does not make much sense).
> 
Ah, see, this is a problem.  We need to never invalidate SSA information
for *any* variable.  Today, we have alias information.  In a few days we
will have value numbers, ranges, type information, etc.  In fact, after
jump threading is fixed to stay in SSA form, we will make it impossible
to call rewrite_into_ssa() more than once.

> With the patch, we just copy the header, obtaining
> 
> L0:
>   x_1 = phi (x_0)
>   if (x_1 > 100)
>     goto end;
> 
> L1:
>   x_2 = foo (x_1);
> 
> start:
>   x_1 = phi (x_2);
>   if (x_1 > 100)
>     goto end;
>   goto L1;
> end:;
> 
> x_1 now has multiple definitions.  Now the call to rewrite_ssa_into_ssa
> creates the new versions for it and the neccesary phi node at L1.
> 
Sounds like you are just inserting new definitions.  Ken Zadeck provided
a method for inserting definitions while keeping the SSA form.  I don't
know if he's got the slides online yet, though.  Is that the
transformation?  Replicate the header of a loop?


Diego.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]