Back to Search Start Over

Formalizing the LLVM intermediate representation for verified program transformations

Authors :
Milo M. K. Martin
Santosh Nagarakatte
Steve Zdancewic
Jianzhou Zhao
Source :
POPL
Publication Year :
2012
Publisher :
Association for Computing Machinery (ACM), 2012.

Abstract

This paper presents Vellvm (verified LLVM), a framework for reasoning about programs expressed in LLVM's intermediate representation and transformations that operate on it. Vellvm provides a mechanized formal semantics of LLVM's intermediate representation, its type system, and properties of its SSA form. The framework is built using the Coq interactive theorem prover. It includes multiple operational semantics and proves relations among them to facilitate different reasoning styles and proof techniques. To validate Vellvm's design, we extract an interpreter from the Coq formal semantics that can execute programs from LLVM test suite and thus be compared against LLVM reference implementations. To demonstrate Vellvm's practicality, we formalize and verify a previously proposed transformation that hardens C programs against spatial memory safety violations. Vellvm's tools allow us to extract a new, verified implementation of the transformation pass that plugs into the real LLVM infrastructure; its performance is competitive with the non-verified, ad-hoc original.

Details

ISSN :
15581160 and 03621340
Volume :
47
Database :
OpenAIRE
Journal :
ACM SIGPLAN Notices
Accession number :
edsair.doi.dedup.....c6c1d86f102d13dcb95a4b927cf85a3c