skip to main content
research-article

Verified validation of lazy code motion

Published: 15 June 2009 Publication History

Abstract

Translation validation establishes a posteriori the correctness of a run of a compilation pass or other program transformation. In this paper, we develop an efficient translation validation algorithm for the Lazy Code Motion (LCM) optimization. LCM is an interesting challenge for validation because it is a global optimization that moves code across loops. Consequently, care must be taken not to move computations that may fail before loops that may not terminate. Our validator includes a specific check for anticipability to rule out such incorrect moves. We present a mechanically-checked proof of correctness of the validation algorithm, using the Coq proof assistant. Combining our validator with an unverified implementation of LCM, we obtain a LCM pass that is provably semantics-preserving and was integrated in the CompCert formally verified compiler.

References

[1]
Clark W. Barret, Yi Fang, Benjamin Goldberg, Ying Hu, Amir Pnueli, and Lenore Zuck. TVOC: A translation validator for optimizing compilers. In phComputer Aided Verification, 17th Int. Conf., CAV 2005, volume 3576 of Lecture Notes in Computer ScienceLNCS, pages 291---295. Springer, 2005.
[2]
Yves Bertot and Pierre Castéran. phInteractive Theorem Proving and Program Development --- Coq'Art: The Calculus of Inductive Constructions. EATCS Texts in Theoretical Computer Science. Springer, 2004.
[3]
Rastislav Bodík, Rajiv Gupta, and Mary Lou Soffa. Complete removal of redundant expressions. In phPLDI'98: Proceedings of the ACM SIGPLAN 1998 conference on Programming language design and implementation, pages 1--14. ACM, 1998.
[4]
CoqCoq development team. The Coq proof assistant. Software and documentation available at http://coq.inria.fr/, 1989--2009.
[5]
Sumit Gulwani and George C. Necula. A polynomial-time algorithm for global value numbering. In phStatic Analysis, 11th Int. Symp., SAS 2004, volume 3148 of Lecture Notes in Computer Science, pages 212--227. Springer, 2004.
[6]
Yuqiang Huang, Bruce R. Childers, and Mary Lou Soffa. Catching and identifying bugs in register allocation. In phStatic Analysis, 13th Int. Symp., SAS 2006, volume 4134 of Lecture Notes in Computer Science, pages 281--300. Springer, 2006.
[7]
Aditya Kanade, Amitabha Sanyal, and Uday Khedker. A PVS based framework for validating compiler optimizations. In phSEFM'06: Proceedings of the Fourth IEEE International Conference on Software Engineering and Formal Methods, pages 108--117. IEEE Computer Society, 2006.
[8]
Gerwin Klein and Tobias Nipkow. A machine-checked model for a Java-like language, virtual machine and compiler. ACM Transactions on Programming Languages and Systems Trans. Prog. Lang. Syst., 28 (4): 619--695, 2006.
[9]
Jens Knoop, Oliver Rüthing, and Bernhard Steffen. Lazy code motion. In phProgramming Languages Design and Implementation 1992, pages 224--234. ACM Press, 1992.
[10]
Jens Knoop, Oliver Rüthing, and Bernhard Steffen. Optimal code motion: Theory and practice. ACM Transactions on Programming Languages and Systems, 16 (4): 1117--1155, 1994.
[11]
Dirk Leinenbach, Wolfgang Paul, and Elena Petrova. Towards the formal verification of a C0 compiler: Code generation and implementation correctness. In phInt. Conf. on Software Engineering and Formal Methods (SEFM 2005), pages 2--11. IEEE Computer Society Press, 2005.
[12]
Sorin Lerner, Todd Millstein, and Craig Chambers. Automatically proving the correctness of compiler optimizations. In phProgramming Language Design and Implementation 2003, pages 220--231. ACM Press, 2003.
[13]
Xavier Leroy. A formally verified compiler back-end. arXiv:0902.2137 {cs}. Submitted, July 2008.
[14]
Xavier Leroy. Formal certification of a compiler back-end, or: programming a compiler with a proof assistant. In 33rd symposium Principles of Programming Languages. Principles of Progr. Lang, pages 42--54. ACM Press, 2006.
[15]
Xavier Leroy and Sandrine Blazy. Formal verification of a C-like memory model and its uses for verifying program transformations. Journal of Automated Reasoning, 41 (1): 1--31, 2008.
[16]
Xavier Leroy et al. The CompCert verified compiler. Development available at http://compcert.inria.fr, 2004--2009.
[17]
Etienne Morel and Claude Renvoise. Global optimization by suppression of partial redundancies. Communication of the ACM, 22 (2): 96--103, 1979.
[18]
George C. Necula. Translation validation for an optimizing compiler. In Programming Language Design and Implementation 2000, pages 83--95. ACM Press, 2000.
[19]
Amir Pnueli, Ofer Shtrichman, and Michael Siegel. The code validation tool (CVT) -- automatic verification of a compilation process. phInternational Journal on Software Tools for Technology Transfer, 2: 192--201, 1998a.
[20]
Amir Pnueli, Michael Siegel, and Eli Singerman. Translation validation. In phTools and Algorithms for Construction and Analysis of Systems, TACAS'98, volume 1384 of Lecture Notes in Computer Science, pages 151--166. Springer, 1998
[21]
Martin Rinard and Darko Marinov. Credible compilation with pointers. In phWorkshop on Run-Time Result Verification, 1999.
[22]
Xavier Rival. Symbolic transfer function-based approaches to certified compilation. In 31st Principles of Programming Languagessymp. Principles of Progr. Lang, pages 1-13. ACM Press, 2004.
[23]
Bernhard Steffen. Property-oriented expansion. In Static Analysis, Third International Symposium, SAS'96, volume 1145 of Lecture Notes in Computer ScienceLNCS, pages 22--41. Springer, 1996.
[24]
Jean-Baptiste Tristan and Xavier Leroy. Formal verification of translation validators: A case study on instruction scheduling optimizations. In ph35th symposium Principles of Programming Languages, pages 17--27. ACM Press, 2008.
[25]
Anna Zaks and Amir Pnueli. Covac: Compiler validation by program analysis of the cross-product. In phFM 2008: Formal Methods, 15th International Symposium on Formal Methods, volume 5014 of Lecture Notes in Computer Science, pages 35--51. Springer, 2008.
[26]
Lenore Zuck, Amir Pnueli, and Raya Leviathan. Validation of optimizing compilers. Technical Report MCS01-12, Weizmann institute of Science, 2001.
[27]
Lenore Zuck, Amir Pnueli, Yi Fang, and Benjamin Goldberg. VOC: A methodology for translation validation of optimizing compilers. phJournal of Universal Computer Science, 9 (3): 223--247, 2003.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 44, Issue 6
PLDI '09
June 2009
478 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/1543135
Issue’s Table of Contents
  • cover image ACM Conferences
    PLDI '09: Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation
    June 2009
    492 pages
    ISBN:9781605583921
    DOI:10.1145/1542476
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]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 15 June 2009
Published in SIGPLAN Volume 44, Issue 6

Check for updates

Author Tags

  1. lazy code motion
  2. redundancy elimination
  3. the coq proof assistant
  4. translation validation
  5. verified compilers

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)10
  • Downloads (Last 6 weeks)1
Reflects downloads up to 15 Sep 2024

Other Metrics

Citations

Cited By

View all

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media