|SSA without phi Nicolas.Capens@gmail.com (2007-04-20)|
|Re: SSA without phi firstname.lastname@example.org (Tommy Thorn) (2007-04-23)|
|Re: SSA without phi email@example.com (2007-04-23)|
|SSA without phi firstname.lastname@example.org (Inderaj Bains) (2007-04-23)|
|Re: SSA without phi cfc@shell01.TheWorld.com (Chris F Clark) (2007-04-23)|
|Re: SSA without phi email@example.com (Matthias Blume) (2007-04-26)|
|Re: SSA without phi Nicolas.Capens@gmail.com (2007-04-29)|
|Re: SSA without phi firstname.lastname@example.org (Tommy Thorn) (2007-05-04)|
|[4 later articles]|
|From:||Tommy Thorn <email@example.com>|
|Date:||23 Apr 2007 07:50:56 -0400|
|Posted-Date:||23 Apr 2007 07:50:56 EDT|
On Apr 20, 7:25 am, Nicolas.Cap...@gmail.com wrote:
> I'm wondering whether it is possible to get (part of) the benefits of
> SSA by using it only per basic block. This way I could avoid all the
> complexity of phi functions.
Which part of the complexity?
> The problem with phi functions is that they're not executable.
Sure they are(**). The "execution" just have to know how phi arguments
relate to the CFG edge and track where branches (and fall-through)
A common alternative representation of SSA distributes the arguments
into the predecessor blocks., ie instead of
v.2 = phi(v.0, v.1)
This is strictly isomorphic to the traditional representation, but can
be easier to work with.
Of course, you could also look into Gated Single-Assignment.
> I would
> prefer keeping my intermediate code executable at all time. This would
> make it easier to reason about optimizations and follow every step
> (*). It's also fairly complex (almost convoluted in my opinion) to
> correctly compute where to insert phi functions, especially when
> trying to keep their number low.
If you don't care about efficiency, reducing the number of phi-nodes
> (*) 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.
(**): SSA is wildly cited in literature as being "non-executable". Go
Return to the
Search the comp.compilers archives again.