Validating Correctness of Compiler Optimizer Execution Using Temporal Logic

It is very important that compiler optimization works correctly without changing the semantics of a program. However, because there are many complex optimizations, it is generally dicult to implement them correctly. In this paper, we propose a technique for validating whether or not the optimization transformations to the program have been performed correctly, after the execution of the optimizer. We first describe the properties that program points modified by the optimization have to satisfy to preserve the program semantics, in terms of temporal logic. The system then performs model checking on the optimized program, to check if these program points satisfy the logical formulas described. This technique has the advantages that it can be applied to complex optimizers that already exist, and that checking occurs within a realistic time. We have implemented and executed this technique and found an unknown bug in an optimizer within a widely-used compiler.

[1]  Sorin Lerner,et al.  Automated soundness proofs for dataflow analyses and transformations via local rules , 2005, POPL '05.

[2]  Sorin Lerner,et al.  Automatically proving the correctness of compiler optimizations , 2003, PLDI '03.

[3]  George C. Necula,et al.  Translation validation for an optimizing compiler , 2000, PLDI '00.

[4]  Mark N. Wegman,et al.  Constant propagation with conditional branches , 1985, POPL.

[5]  Stephan Merz,et al.  Model Checking , 2000 .

[6]  Keith D. Cooper,et al.  Operator strength reduction , 2001, TOPL.

[7]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools (2nd Edition) , 2006 .

[8]  Bernhard Steffen,et al.  Optimal code motion: theory and practice , 1994, TOPL.

[9]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[10]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.

[11]  Masataka Sassa,et al.  Generating Java Compiler Optimizers Using Bidirectional CTL , 2007, COCV@ETAPS.

[12]  Eric Van Wyk,et al.  Compiler Optimization Correctness by Temporal Logic , 2004, High. Order Symb. Comput..

[13]  David A. Schmidt Data flow analysis is model checking of abstract interpretations , 1998, POPL '98.

[14]  Martin Rinard,et al.  Credible Compilation with Pointers , 1999 .

[15]  Andrew W. Appel,et al.  Modern Compiler Implementation in Java, 2nd edition , 2002 .

[16]  Andrew W. Appel,et al.  Modern Compiler Implementation in Java , 1997 .