Static Single Assignment

This document discusses Static Single Assignment (SSA) and other related intermediate forms. SSA is an intermediate representation that renames variables (registers, memory accesses and array accesses) such that a property of static single assignment holds. We assume that the program is represented as a control-flow graph of basic blocks and that these are built up of instructions.

Forms

Static Single Assignment (SSA)

Relation to other forms

New instruction nodes

φ (phi) nodes/instructions that represent a join of all the definitions of a variable if multiple definitions exist in the control-flow graph. Placed at the top of basic blocks.

Properties of intermediate form

Each variable is assigned to at most once.

Only flow dependencies exist, however this property doesn't hold for arrays or for pointers.

Related papers

Efficiently Computing Static Single Assignment Form and the Control Dependence Graph
Ron Cytron, Jeanne Ferrante, Barry K. Rosen, Mark N. Wegman, F. Kenneth Zadeck
ACM Transactions on Programming Languages and Systems
1991
Comprehensive overview
Constant propagation with conditional branches
Mark N. Wegman, F. Kenneth Zadeck
ACM Transactions on Programming Languages and Systems
1991
Application of SSA for constant propagation
Global value numbers and redundant computations
B. K. Rosen, M. N. Wegman, F. K. Zadeck
Proceeding of the 15th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
1988
Early application of SSA
Detecting equality of variables in programs
B. Alpern, M. N. Wegman, F. K. Zadeck
Proceedings of the 15th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
1988
Early application of SSA with phi_if, phi_entry, phi_exit nodes.

Gated Single Assignment

Relation to other forms

Control-flow extension to SSA

New instruction nodes

γ (gamma) nodes/instructions that replace φ-nodes and have an extra field for a condition operand.

Properties of intermediate form

Related papers

The program dependence web: a representation supporting control-, data-, and demand-driven interpretation of imperative languages
Robert A. Ballance, Arthur B. Maccabe, Karl J. Ottenstein
Proceedings of the ACM SIGPLAN 1990 Conference on Programming Language Design and Implementation
1990
Gated Single Assignment form is an intermediate representation on the way to calculating the full PDW form.
Efficient building and placing of gating functions
Peng Tu, David Padua
Proceedings of the ACM SIGPLAN 1995 Conference on Programming Language Design and Implementation
1995
Construction of Thinned Gated Single-Assignment Form
Paul Havlak
Workshop on Languages and Compilers for Parallel Computing
1993

Pointer analysis with SSA

Relation to other forms

Pointer analysis extension to SSA

New instruction nodes

Properties of intermediate form

Related papers

Efficient accommodation of may-alias information in SSA form
Ron Cytron, Reid Gershbein
Proceedings of the ACM SIGPLAN 1993 Conference on Programming Language Design and Implementation
1993
Effective Representation of Aliases and Indirect Memory Operations in SSA Form
Fred C. Chow, Sun Chan, Shin-Ming Liu, Raymond Lo, Mark Streich
Proceedings of the 6th International Conference on Compiler Construction
1996
Extended SSA Numbering: Introducing SSA Properties to Language with Multi-level Pointers
Christopher Lapkowski, Laurie J. Hendren
Proceedings of the 7th International Conference on Compiler Construction
1998

Static Single Use (SSU)

Relation to other forms

The inverse of SSA for uses

New instruction nodes

Λ (Lambda) nodes/instructions that represent a split of a value for subsequent uses.

Properties of intermediate form

Each variable is used at most once.

If used with SSA only flow dependencies will exist with one def-use chain. If not used with SSA then flow and anti dependences may be some what simpler.

SSU has been used for store elimination.

Related papers

Register promotion by sparse partial redundancy elimination of loads and stores
Raymond Lo, Fred Chow, Robert Kennedy, Shin-Ming Liu, Peng Tu
Proceedings of the ACM SIGPLAN 1998 Conference on Programming Language Design and Implementation
1998
Taming the IXP network processor
Lal George and Matthias Blume
Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation
2003
Optimization of Object-Oriented and Concurrent Programs
John Bradley Plevyack
PhD Thesis, University of Illinois at Urbana-Champaign
1996

Static Single Information (SSI)

Relation to other forms

SSA plus the inverse of SSA for defs

New instruction nodes

σ (sigma) nodes/instructions that take a variable and give a split that represents all future definitions. Placed at the end of basic blocks

Properties of intermediate form

σ nodes/instructions enable forward propagation of data.

Related papers

The Static Single Information Form
C. Scott Ananian
Master's Thesis, Massachusetts Institute of Technology
September 1999
A framework for virtual register renaming schemes
Jeremy Singer
Submitted to LDTA'04 (ETAPS satellite workshop)
2003

Array SSA

Relation to other forms

SSA with extensions for arrays

New instruction nodes

dφ and uφ nodes/instructions to represent definitions to a particular array or uses of a particular array.

Properties of intermediate form

Array SSA extends SSA so that it is useful for eliminating redundant loads and stores to arrays.

Related papers

Extended Array SSA

Relation to other forms

Array SSA with extensions for strongly typed languages.

Also extensions for bound check elimination.

New instruction nodes

Heap operands associated with instructions.

Π (Pi) instructions placed following comparisons.

Properties of intermediate form

Memory variables are said to exist in disjoint (non-aliasing) Heaps thereby reducing the number of potential dependencies.

Π instructions used to prove that particular use of a variable is within a given range.

Related papers

ABCD: Eliminating Bounds Checks on Demand
Rastislav Bodik, Rajiv Gupta, and Vivek Sarkar
ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation (PLDI 2000), Vancouver, British Columbia, Canada, June 17-21, 2000

Array (S)SA

Relation to other forms

Array SSA with extensions to specify index ranges

New instruction nodes

Heap operands to instructions with information on the indexs used

Properties of intermediate form

Knowing index information can reduce the number of dependencies.

Related papers

Linear naming

Relation to other forms

New instruction nodes

Copy nodes to produce unique copies of operands.

Properties of intermediate form

Variables are linearly named so that they are used at most once.

Scope exceeds SSU?

Related papers

Static Single Mention (SSM)

Relation to other forms

Linear naming with definitions being unique

New instruction nodes

Properties of intermediate form

dφ and uφ nodes/instructions used as in Array SSA

Related papers

Loop-Closed SSA

Relation to other forms

SSA with redundant (copying) φ nodes following loops.

New instruction nodes

Properties of intermediate form

Simplifies loop optimisations as definitions of escaping variables need only be added for phi nodes following the loop.

Related papers

Unsorted Papers

SSA in functional programming
Andrew W. Appel
ACM SIGPLAN Notices
1998
A correspondance between passing style and static single assignment form
Richard A. Kelsey
ACM SIGPLAN Notices
1995
A Functional Perspective on SSA Optimisation Algorithms
Manuel M.T. Chatravarty, Gabrielle Keller, Patryk Zadarnowsi
Proceedings of the 2nd International Workshop on Compiler Optimisations Meets Compiler Verification
2003

Valid XHTML 1.0!