Lazy Code Transformations in a Formally Verified Compiler - Archive ouverte HAL
Conference Papers Year : 2023

Lazy Code Transformations in a Formally Verified Compiler

Léo Gourdin

Abstract

Translation validation verifies the results of an untrusted translator---called an oracle---at the compiler's runtime using a validator. This approach enables validating intricate optimizations without having to prove them directly. Parametrizing such a validator with hints provided by oracles greatly simplifies its integration within a formally verified compiler---such as CompCert. However, generating those hints requires adapting state-of-the-art optimizations. The co-design of a validation framework supporting a class of optimizations led us to improve the Lazy Code Motion (LCM) and Lazy Strength Reduction (LSR) data-flow algorithms of Knoop, Rüthing, and Steffen. We propose an efficient implementation in OCaml combining both LCM and LSR, operating over basic-blocks, and whose result is checked by a Coq-verified validator. We show how to generate invariant annotations from the data-flow equations as hints for the defensive validation, and we introduce several algorithmic refinements w.r.t. the original papers. Our solution is fully integrated within CompCert, and to the best of our knowledge, it is the first formally verified strength-reduction of loop-induction variables.
Fichier principal
Vignette du fichier
preprint.pdf (786.85 Ko) Télécharger le fichier
Origin Files produced by the author(s)
Licence
Copyright

Dates and versions

hal-04108775 , version 1 (30-05-2023)
hal-04108775 , version 2 (26-06-2023)
hal-04108775 , version 3 (10-07-2023)
hal-04108775 , version 4 (23-01-2024)

Licence

Copyright

Identifiers

Cite

Léo Gourdin. Lazy Code Transformations in a Formally Verified Compiler. ICOOOLPS '23: 18th ACM International Workshop on Implementation, Compilation, Optimization of OO Languages, Programs and Systems, Jul 2023, Seattle WA USA, United States. pp.3-14, ⟨10.1145/3605158.3605848⟩. ⟨hal-04108775v4⟩
293 View
229 Download

Altmetric

Share

More