Publication | Closed Access
Automatically proving the correctness of compiler optimizations
116
Citations
27
References
2003
Year
EngineeringCompiler TechnologyVerificationSoftware EngineeringSoftware AnalysisFormal VerificationBranch FoldingCompilersCobalt OptimizationsCompiler SupportComputer EngineeringComputer ScienceOptimizing CompilerProgram AnalysisAutomated ReasoningCompiler OptimizationsFormal MethodsProgram SynthesisParallel ProgrammingCompiler Optimizations SoundSymbolic Execution
We describe a technique for automatically proving compiler optimizations sound , meaning that their transformations are always semantics-preserving. We first present a domain-specific language, called Cobalt, for implementing optimizations as guarded rewrite rules. Cobalt optimizations operate over a C-like intermediate representation including unstructured control flow, pointers to local variables and dynamically allocated memory, and recursive procedures. Then we describe a technique for automatically proving the soundness of Cobalt optimizations. Our technique requires an automatic theorem prover to discharge a small set of simple, optimization-specific proof obligations for each optimization. We have written a variety of forward and backward intraprocedural dataflow optimizations in Cobalt, including constant propagation and folding, branch folding, full and partial redundancy elimination, full and partial dead assignment elimination, and simple forms of points-to analysis. We implemented our soundness-checking strategy using the Simplify automatic theorem prover, and we have used this implementation to automatically prove our optimizations correct. Our checker found many subtle bugs during the course of developing our optimizations. We also implemented an execution engine for Cobalt optimizations as part of the Whirlwind compiler infrastructure.
| Year | Citations | |
|---|---|---|
Page 1
Page 1