Graphs and Gating Functions - Stanier, James; Rastello, Fabrice (SSA-based Compiler Design, 2022)
Many compilers represent the input program as some form of graph in order to support analysis and transformation. Over time, a cornucopia of program graphs have been presented in the literature and subsequently implemented in real compilers. Many of these graphs use SSA concepts as the core principle of their representation, ranging from literal translations of SSA into graph form to more abstract graphs that are implicitly in SSA form. We aim to introduce a selection of program graphs that use these SSA concepts, and examine how they may be useful to a compiler writer. A well-known graph representation is the control-flow graph (CFG) that we encountered at the beginning of the book in the introduction to the core concept of SSA. The CFG models control flow in a program, but the graphs that we will study instead model data flow. This is useful as a large number of compiler optimizations are based on data-flow analysis. In fact, all graphs that we consider in this chapter are data-flow graphs. In this chapter, we will look at a number of SSA-based graph representations. An introduction to each graph will be given, along with diagrams to show how sample programs look when translated into that particular graph. Additionally, we will describe the techniques that each graph was created to solve, with references to the literature for further research.