Abstract
We present an approach for implementing a formally certified loop-invariant code motion optimization by composing an unrolling pass and a formally certified yet efficient global subexpression elimination. This approach is lightweight: each pass comes with a simple and independent proof of correctness. Experiments show the approach significantly narrows the performance gap between the CompCert certified compiler and state-of-the-art optimizing compilers. Our static analysis employs an efficient yet verified hashed set structure, resulting in the fast compilation.
- [1] . 2014. Formal verification of an SSA-based middle-end for CompCert. ACM Transactions on Programming Languages and Systems 36, 1 (2014), 4:1–4:35. Retrieved from Google Scholar
Digital Library
- [2] . 2012. Formally verified optimizing compilation in ACG-based flight control software. In Proceedings of the Embedded Real Time Software and Systems.Google Scholar
- [3] . 2020. Mechanized semantics and verified compilation for a dataflow synchronous language with reset. Proceedings of the ACM on Programming Languages 4, POPL (2020), 1–29. Retrieved from Google Scholar
Digital Library
- [4] . 2014. Implementing and reasoning about hash-consed data structures in Coq. Journal of Automated Reasoning 53, 3 (2014), 271–304.Google Scholar
Digital Library
- [5] . International Standard—Programming Languages—C.
Technical Report 9899:2018. ISO/IEC.Google Scholar - [6] . 1978. Méthodes itératives de construction et d’approximation de points fixes d’opérateurs monotones sur un treillis, analyse sémantique de programmes. Thèse d’état ès sciences mathématiques. Université scientifique et médicale de Grenoble, Grenoble, France. Retrieved from https://tel.archives-ouvertes.fr/tel-00288657/document.Google Scholar
- [7] . 2015. Verifying fast and sparse SSA-based optimizations in Coq. In Proceedings of the Compiler Construction. (Ed.), Lecture Notes in Computer Science, Vol. 9031, Springer, 233–252.
DOI: Google ScholarCross Ref
- [8] . 2016. TACLeBench: A benchmark collection to support worst-case execution time research. In Proceedings of the 16th International Workshop on Worst-Case Execution Time Analysis and
OpenAccess Series in Informatics. (Ed.), Schloss Dagstuhl–Leibniz-Zentrum für Informatik, Dagstuhl, Germany, 2:1–2:10.Google Scholar - [9] . 2011. Towards formally verified optimizing compilation in flight control software. In Proceedings of the Bringing Theory to Practice: Predictability and Performance in Embedded Systems., , , , and (Eds.), Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, Germany, 59–68.
DOI: Google ScholarCross Ref
- [10] . 2018. CompCert: Practical experience on integrating and qualifying a formally verified optimizing compiler. In Proceedings of the ERTS2 2018-9th European Congress Embedded Real-Time Software and Systems. 1–9. Retrieved from https://hal.inria.fr/hal-01643290.Google Scholar
- [11] . 1973. A unified approach to global program optimization. In Proceedings of the Principles of Programming Languages (Boston, Massachusetts). Association for Computing Machinery, New York, NY, 194–206.
DOI: Google ScholarDigital Library
- [12] . 2009. Formal verification of a realistic compiler. Communications of the ACM 52, 7 (2009), 107–115.Google Scholar
Digital Library
- [13] . 2009. A formally verified compiler back-end. Journal of Automated Reasoning 43, 4 (2009), 363–446. Retrieved from http://xavierleroy.org/publi/compcert-backend.pdf.Google Scholar
Digital Library
- [14] . 2022. The trusted computing base of the CompCert verified compiler. In Proceedings of the Programming Languages and Systems.Springer, 204–233.
DOI: Google ScholarDigital Library
- [15] (Ed.). 2016. SSA-based Compiler Design. Springer. An updated version is available from http://ssabook.gforge.inria.fr/latest/book.pdf.Google Scholar
Digital Library
- [16] . 2013. Translation validation for a verified OS kernel. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. and (Eds.), ACM, 471–482.
DOI: Google ScholarDigital Library
- [17] . 2020. Certified and efficient instruction scheduling: Application to interlocked VLIW processors. Proceedings of the ACM on Programming Languages (2020). Retrieved from https://hal.archives-ouvertes.fr/hal-02185883.
To appear .Google ScholarDigital Library
- [18] . 2022. Formally verified superblock scheduling. In Proceedings of the Certified Programs and Proofs. and (Eds.), ACM, 40–54.
DOI: Google ScholarDigital Library
- [19] . 2009. Formal Verification of Translation Validators. Ph. D. Dissertation. Paris Diderot University, France. Retrieved from https://tel.archives-ouvertes.fr/tel-00437582.Google Scholar
- [20] . 2009. Verified validation of lazy code motion. In Proceedings of the Programming Language Design and Implementation. and (Eds.), ACM, 316–326.
DOI: Google ScholarDigital Library
- [21] . 2011. Finding and understanding bugs in C compilers. In Proceedings of the Programming Language Design and Implementation.ACM, 283–294.Google Scholar
Digital Library
Index Terms
Formally Verified Loop-Invariant Code Motion and Assorted Optimizations
Recommendations
Simple, light, yet formally verified, global common subexpression elimination and loop-invariant code motion
LCTES 2021: Proceedings of the 22nd ACM SIGPLAN/SIGBED International Conference on Languages, Compilers, and Tools for Embedded SystemsWe present an approach for implementing a formally certified loop-invariant code motion optimization by composing an unrolling pass and a formally certified yet efficient global subexpression elimination. This approach is lightweight: each pass comes ...
Verified peephole optimizations for CompCert
PLDI '16Transformations over assembly code are common in many compilers. These transformations are also some of the most bug-dense compiler components. Such bugs could be elim- inated by formally verifying the compiler, but state-of-the- art formally verified ...
Formally Verified Native Code Generation in an Effectful JIT: Turning the CompCert Backend into a Formally Verified JIT Compiler
Modern Just-in-Time compilers (or JITs) typically interleave several mechanisms to execute a program. For faster startup times and to observe the initial behavior of an execution, interpretation can be initially used. But after a while, JITs ...






Comments