SSA is Functional Programming
Abstract:
Static Single-Assignment (SSA) form is an intermediate language designed to make optimization clean and efficient for imperative-language (Fortran, C) compilers. Lambda-calculus is an intermediate language that makes optimization clean and efficient for functionallanguage (Scheme, ML, Haskell) compilers. The SSA community draws pictures of graphs with basic blocks and flow edges, and the functional-language community writes lexically nested functions, but (as Richard Kelsey recently pointed out [9]) they're both doing exactly the same thing in different notation. SSA form. Many dataflow analyses need to find the use-sites of each defined variable or the definition-sites of each variable used in an expression. The def-use chain is a data structure that makes this efficient: for each statement in the flow graph, the compiler can keep a list of pointers to all the use sites of variables defined there, and a list of pointers to all definition sites of the variables used there. But when a variable has N definitions and M uses, we might need N M pointers to connect them. The designers of SSA form were trying to make an improved form of def-use chains that didn't suffer from this problem. Also, they were concerned with "getting the right number of names: " the programmer might use some variable i for several unrelated purposes in the same procedure-- for example, as the loop counter for two different loops-- and we can do more optimization if we split i into different variables i 1 and i 2. In SSA, each variable in the program has only one definition-- it is assigned to only once. The assignment might be in a loop, which is executed many times; so singleassignment is a static property of the program text, not a dynamic property of program execution. a x + y a 1 x + y b a

