Re: SSA without phi



Tommy Thorn <tommy.thorn@xxxxxxxxx> writes:

A common alternative representation of SSA distributes the arguments
into the predecessor blocks., ie instead of

B2:
v.2 = phi(v.0, v.1)
....

you'd have

B0:
...
jump B2(v.0)

B1:
...
jump B1(v.1)

B2(v.2):
...

This is strictly isomorphic to the traditional representation, but can
be easier to work with.


[...]

(*) This is also a bit of a philospohical opinion. I want my compiler
to behave in a way that a programmer would optimize code. SSA with phi
functions just isn't natural, while the idea of static assignment is
fundamental in functional programming and well understood.

What's "natural" is relative.

The alternative representation sketched above looks very much like
tail recursive function calls.

Indeed.

It might help if you'd look up some of the literature on the
correspondence between SSA and CPS. See, e.g., the papers by Kelsey
(1995) and Appel (1998), both in SIGPLAN Notices.

Matthias
.