Standard Construction and Destruction Algorithms - Singer, Jeremy; Rastello, Fabrice (SSA-based Compiler Design, 2022)
This chapter describes the standard algorithms for construction and destruction of SSA form. SSA construction refers to the process of translating a non-SSA program into one that satisfies the SSA constraints. In general, this transformation occurs as one of the earliest phases in the middle-end of an optimizing compiler, when the program has been converted to three-address intermediate code. SSA destruction is sometimes called out-of-SSA translation. This step generally takes place in an optimizing compiler after all SSA optimizations have been performed, and prior to code generation. Note, however, that there are specialized code generation techniques that can work directly on SSA-based intermediate representations such as instruction selection, if-conversion, and register allocation. The algorithms presented in this chapter are based on material from the seminal research papers on SSA. These original algorithms are straightforward to implement and have acceptable efficiency. Therefore, such algorithms are widely implemented in current compilers. Note that more efficient, albeit more complex, alternative algorithms have been devised. These are described in further chapters.