Array SSA Form - Sarkar, Vivek; Knobe, Kathleen; Fink, Stephen (SSA-based Compiler Design, 2022)
In this chapter, we introduce an Array SSA form that captures element-level data-flow information for array variables and coincides with standard SSA form when applied to scalar variables. Any program with arbitrary control-flow structures and arbitrary array subscript expressions can be automatically converted to this Array SSA form, thereby making it applicable to structures, heap objects, and any other data structure that can be modelled as a logical array. A key extension over standard SSA form is the introduction of a definition-PHI function (denoted PHI-def) that is capable of merging values from distinct array definitions on an element-by-element basis. There are several potential applications of Array SSA form in compiler analysis and optimization of sequential and parallel programs. In this chapter, we focus on sequential programs and use constant propagation as an exemplar of a program analysis that can be extended to array variables using Array SSA form and redundant load elimination as an exemplar of a program optimization that can be extended to heap objects using Array SSA form.