Automatically proving the correctness of compiler optimizations
- 9 May 2003
- conference paper
- Published by Association for Computing Machinery (ACM)
- Vol. 38 (5) , 220-231
- https://doi.org/10.1145/781131.781156
Abstract
We describe a technique for automatically proving compiler optimizations sound, meaning that their transformations are always semantics-preserving. We rst present a domain- specic language, called Cobalt, for implementing optimiza- tions as guarded rewrite rules. Cobalt optimizations operate over a C-like intermediate representation including unstruc- tured control o w, pointers to local variables and dynami- cally allocated memory, and recursive procedures. Then we describe a technique for automatically proving the sound- ness of Cobalt optimizations. Our technique requires an au- tomatic theorem prover to discharge a small set of simple, optimization-specic proof obligations for each optimiza- tion. We have written a variety of forward and backward intraprocedural datao w optimizations in Cobalt, includ- ing constant propagation and folding, branch folding, full and partial redundancy elimination, full and partial dead assignment elimination, and simple forms of points-to analy- sis. We implemented our soundness-checking strategy using the Simplify automatic theorem prover, and we have used this implementation to automatically prove our optimiza- tions correct. Our checker found many subtle bugs during the course of developing our optimizations. We also imple- mented an execution engine for Cobalt optimizations as part of the Whirlwind compiler infrastructure. Categories and Subject DescriptorsKeywords
This publication has 22 references indexed in Scilit:
- Extended static checking for JavaPublished by Association for Computing Machinery (ACM) ,2002
- From system F to typed assembly languageACM Transactions on Programming Languages and Systems, 1999
- TILPublished by Association for Computing Machinery (ACM) ,1996
- The VLISP verified PreScheme compilerHigher-Order and Symbolic Computation, 1995
- VLISP: A verified implementation of SchemeHigher-Order and Symbolic Computation, 1995
- The Boyer-Moore theorem prover and its interactive enhancementComputers & Mathematics with Applications, 1995
- Generating data flow analysis algorithms from modal specificationsScience of Computer Programming, 1993
- On the temporal analysis of fairnessPublished by Association for Computing Machinery (ACM) ,1980
- Simplification by Cooperating Decision ProceduresACM Transactions on Programming Languages and Systems, 1979
- Global optimization by suppression of partial redundanciesCommunications of the ACM, 1979