Liveness
Résumé
The role of liveness analysis is to determine, for all variables, the set of program points where these variables are live, i.e., where their values are potentially used by subsequent operations. For strict SSA form programs, the live range of a variable has valuable properties that can be expressed in terms of the loop nesting forest of the CFG and its corresponding directed acyclic graph, the forward-CFG. A direct consequence of this property is the possible design of a data-flow algorithm that, as opposed to standard approaches, computes liveness sets without the requirement of any iteration to reach a fixed point: at most, two passes over the CFG are necessary. Another application of this property is the design of a simple liveness check algorithm, which in contrast to classical data-flow analysis, does not provide the set of variables live at a block, but provides a query system to answer questions such as “Is variable v live at location q?” After detailing the aforementioned property, this chapter illustrates how the use of strict SSA can both simplify and accelerate liveness analysis. For this purpose, several liveness set and liveness check algorithms are provided.