Abstract
The Static Single Assignment (SSA) form is a predominant technology in modern compilers, enabling powerful and fast program optimizations. Despite its great success in the implementation of production compilers, it is only very recently that this technique has been introduced in verified compilers. As of today, few evidence exist on that, in this context, it also allows faster and simpler optimizations. This work builds on the CompCertSSA verified compiler (an SSA branch of the verified CompCert C compiler). We implement and verify two prevailing SSA optimizations: Sparse Conditional Constant Propagation and Global Value Numbering. For both transformations, we mechanically prove their soundness in the Coq proof assistant. Both optimization proofs are embedded in a single sparse optimization framework, factoring out many of the dominance-based reasoning steps required in proofs of SSA-based optimizations. Our experimental evaluations indicate both a better precision, and a significant compilation time speedup.
This work was supported by Agence Nationale de la Recherche, grant number ANR-14-CE28-0004 DISCOVER.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Alpern, B., Wegman, M.N., Zadeck, F.K.: Detecting Equality of Variables in Programs. In: Proc. of POPL 1988, pp. 1–11. ACM, San Diego (1988) ISBN: 0-89791-252-7
Barthe, G., Demange, D., Pichardie, D.: Formal Verification of an SSA- Based Middle-End for CompCert. ACM TOPLAS 36(1), 4:1–4:35 (2014) ISSN: 0164-0925
Blech, J., et al.: Optimizing Code Generation from SSA Form: A Comparison Between Two Formal Correctness Proofs in Isabelle/HOL. In: COCV 2005. ENTCS, pp. 33–51. Elsevier, Amsterdam (2005)
Boissinot, B., et al.: Revisiting Out-of-SSA Translation for Correctness, Code Quality and Efficiency. In: Proc. of the 7th Annual IEEE/ACM International Symposium on Code Generation and Optimization, CGO 2009, pp. 114–125. IEEE Computer Society, Washington, DC (2009) ISBN: 978-0-7695-3576-0
Briggs, P., Cooper, K.D., Simpson, L.T.: Value Numbering. Software, Practice and Experience 27(6), 701–724 (1997)
Chlipala, A.: A verified compiler for an impure functional language. In: POPL 2010, pp. 93–106. ACM, New York (2010)
Chow, F., et al.: A New Algorithm for Partial Redundancy Elimination Based on SSA Form. In: Proc. of PLDI 1997, pp. 273–286. ACM, New York (1997)
Kumar, R., et al.: CakeML: A verified implementation of ML. In: Proc. of POPL 2014, pp. 179–192 (2014)
Lengauer, T., Tarjan, R.: A fast algorithm for finding dominators in a flowgraph. ACM TOPLAS 1(1), 121–141 (1979)
Leroy, X.: A Formally Verified Compiler Back-end. JAR 43(4), 363–446 (2009)
Mansky, W., Gunter, E.: A Framework for Formal Verification of Compiler Optimizations. In: Kaufmann, M., Paulson, L.C. (eds.) ITP 2010. LNCS, vol. 6172, pp. 371–386. Springer, Heidelberg (2010)
Pnueli, A., Siegel, M.D., Singerman, E.: Translation validation. In: Steffen, B. (ed.) TACAS 1998. LNCS, vol. 1384, pp. 151–166. Springer, Heidelberg (1998)
Rideau, S., Leroy, X.: Validating Register Allocation and Spilling. In: Gupta, R. (ed.) CC 2010. LNCS, vol. 6011, pp. 224–243. Springer, Heidelberg (2010)
Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Global Value Numbers and Redundant Computations. In: Proceedings of the 15th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1988, pp. 12–27. ACM, San Diego (1988) ISBN:0- 89791-252-7
Stepp, M., Tate, R., Lerner, S.: Equality-Based Translation Validator for LLVM. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806, pp. 737–742. Springer, Heidelberg (2011)
Tristan, J., Govereau, P., Morrisett, G.: Evaluating value-graph translation validation for LLVM. In: PLDI 2011, pp. 295–305. ACM, New York (2011)
Tristan, J., Leroy, X.: A simple, verified validator for software pipelining. In: POPL 2010, pp. 83–92. ACM, New York (2010)
Tristan, J., Leroy, X.: Verified validation of lazy code motion. In: PLDI 2009, pp. 316–326. ACM, New York (2009)
Wegman, M.N., Zadeck, F.K.: Constant Propagation with Conditional Branches. ACM Trans. Program. Lang. Syst. 13(2), 181–210 (1991)
Yang, X., et al.: Finding and Understanding Bugs in C Compilers. In: Proc. of PLDI 2011, pp. 978–971. ACM, New York (2011) ISBN:978-1-4503-0663-8
Zhao, J., et al.: Formal verification of SSA-based optimizations for LLVM. In: PLDI 2013, pp. 175–186. ACM, New York (2013)
Zhao, J., et al.: Formalizing the LLVM Intermediate Representation for Verified Program Transformation. In: POPL 2012, pp. 427–440. ACM, New York (2012)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Demange, D., Pichardie, D., Stefanesco, L. (2015). Verifying Fast and Sparse SSA-Based Optimizations in Coq. In: Franke, B. (eds) Compiler Construction. CC 2015. Lecture Notes in Computer Science(), vol 9031. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-46663-6_12
Download citation
DOI: https://doi.org/10.1007/978-3-662-46663-6_12
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-662-46662-9
Online ISBN: 978-3-662-46663-6
eBook Packages: Computer ScienceComputer Science (R0)