Abstract
Liveness analysis is a standard compiler analysis, enabling several optimizations such as deadcode elimination. The SSA form is a popular compiler intermediate language allowing for simple and fast optimizations. Boissinot et al. [7] designed a fast liveness analysis by combining the specific properties of SSA with graph-theoretic ideas such as depth-first search and dominance. We formalize their approach in the Coq proof assistant, inside the CompCertSSA verified C compiler. We also compare experimentally this approach on CompCert’s benchmarks with respect to the classic data-flow-based liveness analysis, and observe performance gains.
Highlights
We focus on liveness checking, as presented in [7], from the point of view of formally verified compilation
(impl2) implements only partially, it only sorts the nodes in Tq by their preorder number in the dominance tree, while implements it fully, since it can skip a subtree of the dominance tree when a test fails
We have described the formalization and implementation in the CompCertSSA verified compiler of the liveness analysis described in [7]
Summary
In order to be precise, several important compiler analyses need to know the lifetime of variables This is the case with deadcode elimination and register allocation, and for instance with software pipelining and trace scheduling. Given a program and a variable, liveness analysis consists in determining the points of the program where this variable is needed, i.e. the points from which an execution can reach an instruction where this variable is used. One possible labeling is based on a DFS preorder numbering, the first integer of a node being its preorder number and the second one being the maximum preorder number in the subtree rooted at that node
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.