Tue Aug 2 17:31:35 CEST 2011


CPS has well-defined binding structure and parallel assignment.  In
SSA[1] this seems to be somewhat looser.  Is there a real difference
here?  (Context: for me the point is to make _really fast code_ that
goes straight onto a DSP or FPGA.)

The WP article on SSA[1] mentions that SSA has non-local control
flow[2] while CPS has none.  (With this is meant things like
exceptions and continuations, so that's not relevant for me.)

Let's look for something that compares CPS and SSA[3][4], and not to
forget ANF[4].  The interesting bit about SSA is the Phi functions,
which are placed at control-flow joins.  Wingo cites the
interpretation that each basic block is a function, and that a Phi
function indicates that the basic block has an argument.

Wingo goes on to say that SSA is really for first-order programs and
aggressive optimization of loops, while CPS is for higher-order

[1] http://en.wikipedia.org/wiki/Static_single_assignment_form
[2] http://en.wikipedia.org/wiki/Control_flow#Structured_non-local_control_flow
[3] http://lambda-the-ultimate.org/node/3467
[4] http://wingolog.org/archives/2011/07/12/static-single-assignment-for-functional-programmers