skip to main content
10.1145/2892208.2892222acmconferencesArticle/Chapter ViewAbstractPublication PagesccConference Proceedingsconference-collections
research-article

Mechanizing conventional SSA for a verified destruction with coalescing

Published: 17 March 2016 Publication History

Abstract

Modern optimizing compilers rely on the Static Single Assignment (SSA) form to make optimizations fast and simpler to implement. From a semantic perspective, the SSA form is nowadays fairly well understood, as witnessed by recent advances in the field of formally verified compilers. The destruction of the SSA form, however, remains a difficult problem, even in a non-verified environment. In fact, the out-of-SSA transformation has been revisited, for correctness and performance issues, up until recently. Unsurprisingly, state-of-the-art compiler formalizations thus either completely ignore, only partially handle, or implement naively the SSA destruction. This paper reports on the implementation of such a destruction within a verified compiler. We formally define and prove the properties of the generation of Conventional SSA (CSSA) which make its destruction simple to implement and prove. Second, we implement and prove correct a coalescing destruction of CSSA, a la Boissinot et al., where variables can be coalesced according to a refined notion of interference. This formalization work extends the CompCertSSA compiler, whose correctness proof is mechanized in the Coq proof assistant. Our CSSA-based, coalescing destruction removes, on average, more than 99% of introduced copies, and leads to encouraging results concerning spilling during post-SSA register allocation.

References

[1]
G. Barthe, D. Demange, and D. Pichardie. Formal verification of an SSA-based middle-end for CompCert. ACM TOPLAS, 36(1):4:1–4:35, Mar. 2014. ISSN 0164-0925.
[2]
S. Blazy, D. Demange, and D. Pichardie. Validating dominator trees for a fast, verified dominance test. In Proc. of the 6th International Conference on Interactive Theorem Proving (ITP 2015), LNCS. Springer, 2015.
[3]
J. Blech, S. Glesner, J. Leitner, and S. Mülling. Optimizing code generation from SSA form: A comparison between two formal correctness proofs in Isabelle/HOL. In COCV’05, ENTCS, pages 33–51. Elsevier, 2005.
[4]
B. Boissinot, S. Hack, D. Grund, B. Dupont de Dine hin, and F. Rastello. Fast liveness checking for SSA-form programs. In Proc. of CGO ’08, pages 35–44. ACM, 2008. ISBN 978-1-59593-978-4.
[5]
B. Boissinot, A. Darte, F. Rastello, B. Dupont de Dinechin, and C. Guillon. Revisiting Out-of-SSA Translation for Correctness, Code Quality and Efficiency. In Proc. of CGO’09, pages 114–125. IEEE Computer Society, 2009. ISBN 978-0-7695-3576-0.
[6]
M. Braun, S. Buchwald, S. Hack, R. Leißa, C. Mallon, and A. Zwinkau. Simple and efficient construction of static single assignment form. In Compiler Construction, volume 7791 of LNCS, pages 102–122. Springer Berlin Heidelberg, 2013.
[7]
P. Briggs, K. Cooper, and L. Simpson. Value numbering. SPE, 27(6): 701–724, 1997.
[8]
P. Briggs, K. D. Cooper, T. J. Harvey, and L. T. Simpson. Practical improvements to the construction and destruction of static single assignment form. Softw. Pract. Exper., 28(8):859–881, July 1998. ISSN 0038-0644.
[9]
S. Buchwald, D. Lohner, and S. Ullrich. Verified Construction of Static Single Assignment Form. In A. Zaks and M. Hermenegildo, editors, Proceedings of the 25th International Conference on Compiler Construction, pages 67–76. ACM, 2016.
[10]
G. J. Chaitin, M. A. Auslander, A. K. Chandra, J. Cocke, M. E. Hopkins, and P. W. Markstein. Register allocation via coloring. Computer Languages, 6(1):47 – 57, 1981. ISSN 0096-0551.
[11]
R. Cytron, J. Ferrante, B. Rosen, M. Wegman, and F. Zadeck. Efficiently computing static single assignment form and the control dependence graph. ACM TOPLAS, 13(4):451–490, 1991.
[12]
D. Demange, L. Stefanesco, and D. Pichardie. Verifying Fast and Sparse SSA-based Optimizations in Coq. In Proc. of CC’15, volume 9031 of LNCS, pages 233–252, 2015.
[13]
B. Dupont de Dinechin. Using the SSA-form in a code generator. In Compiler Construction, volume 8409 of LNCS, pages 1–17. Springer Berlin Heidelberg, 2014.
[14]
S. Hack, D. Grund, and G. Goos. Register allocation for programs in SSA form. In CC, LNCS, pages 247–262. Springer-Verlag, 2006.
[15]
X. Leroy. A formally verified compiler back-end. JAR, 43(4):363– 446, 2009.
[16]
L. Rideau, B. Serpette, and X. Leroy. Tilting at windmills with Coq: Formal verification of a compilation algorithm for parallel moves. JAR, 40(4):307–326, 2008.
[17]
V. Sreedhar, R. Ju, D. Gillies, and V. Santhanam. Translating out of static single assignment form. In SAS’99, pages 194–210. Springer-Verlag, 1999.
[18]
J. Zhao, S. Zdancewic, S. Nagarakatte, and M. Martin. Formalizing the LLVM intermediate representation for verified program transformation. In POPL’12, pages 427–440. ACM, 2012.
[19]
J. Zhao, S. Nagarakatte, M. Martin, and S. Zdancewic. Formal verification of SSA-based optimizations for LLVM. In PLDI’13, pages 175–186. ACM, 2013.

Cited By

View all
  • (2023)Formally Verifying Optimizations with Block SimulationsProceedings of the ACM on Programming Languages10.1145/36227997:OOPSLA2(59-88)Online publication date: 16-Oct-2023
  • (2023)Lazy Code Transformations in a Formally Verified CompilerProceedings of the 18th ACM International Workshop on Implementation, Compilation, Optimization of OO Languages, Programs and Systems10.1145/3605158.3605848(3-14)Online publication date: 17-Jul-2023
  • (2020)A Fast Verified Liveness Analysis in SSA FormAutomated Reasoning10.1007/978-3-030-51054-1_19(324-340)Online publication date: 1-Jul-2020
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
CC '16: Proceedings of the 25th International Conference on Compiler Construction
March 2016
270 pages
ISBN:9781450342414
DOI:10.1145/2892208
  • General Chair:
  • Ayal Zaks,
  • Program Chair:
  • Manuel Hermenegildo
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

In-Cooperation

  • IEEE-CS: Computer Society

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 17 March 2016

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Verified compilers
  2. coalescing
  3. conventional SSA

Qualifiers

  • Research-article

Funding Sources

Conference

CGO '16

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)7
  • Downloads (Last 6 weeks)3
Reflects downloads up to 03 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2023)Formally Verifying Optimizations with Block SimulationsProceedings of the ACM on Programming Languages10.1145/36227997:OOPSLA2(59-88)Online publication date: 16-Oct-2023
  • (2023)Lazy Code Transformations in a Formally Verified CompilerProceedings of the 18th ACM International Workshop on Implementation, Compilation, Optimization of OO Languages, Programs and Systems10.1145/3605158.3605848(3-14)Online publication date: 17-Jul-2023
  • (2020)A Fast Verified Liveness Analysis in SSA FormAutomated Reasoning10.1007/978-3-030-51054-1_19(324-340)Online publication date: 1-Jul-2020
  • (2018)Semantic reasoning about the sea of nodesProceedings of the 27th International Conference on Compiler Construction10.1145/3178372.3179503(163-173)Online publication date: 24-Feb-2018
  • (2017)Static optimization in PHP 7Proceedings of the 26th International Conference on Compiler Construction10.1145/3033019.3033026(65-75)Online publication date: 5-Feb-2017
  • (2016)Verified construction of static single assignment formProceedings of the 25th International Conference on Compiler Construction10.1145/2892208.2892211(67-76)Online publication date: 17-Mar-2016

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media