Conditionally correct superoptimization

The aggressive optimization of heavily used kernels is an important problem in high-performance computing. However, both general purpose compilers and highly specialized tools such as superoptimizers often do not have sufficient static knowledge of restrictions on program inputs that could be exploited to produce the very best code. For many applications, the best possible code is conditionally correct: the optimized kernel is equal to the code that it replaces only under certain preconditions on the kernel's inputs. The main technical challenge in producing conditionally correct optimizations is in obtaining non-trivial and useful conditions and proving conditional equivalence formally in the presence of loops. We combine abstract interpretation, decision procedures, and testing to yield a verification strategy that can address both of these problems. This approach yields a superoptimizer for x86 that in our experiments produces binaries that are often multiple times faster than those produced by production compilers.

[1]  Thomas W. Reps,et al.  Abstract Domains of Affine Relations , 2011, SAS.

[2]  Robert W. Floyd,et al.  Assigning Meanings to Programs , 1993 .

[3]  Amer Diwan,et al.  SUIF Explorer: an interactive and interprocedural parallelizer , 1999, PPoPP '99.

[4]  Daniel M. Roy,et al.  Probabilistically Accurate Program Transformations , 2011, SAS.

[5]  Alexander Aiken,et al.  A Data Driven Approach for Algebraic Loop Invariants , 2013, ESOP.

[6]  Sriram Sankaranarayanan,et al.  Abstract acceleration of general linear loops , 2014, POPL.

[7]  Alexander Aiken,et al.  Automatic generation of peephole superoptimizers , 2006, ASPLOS XII.

[8]  John Regehr,et al.  Deriving abstract transfer functions for analyzing embedded software , 2006, LCTES '06.

[9]  Alexander Aiken,et al.  How is aliasing used in systems software? , 2006, SIGSOFT '06/FSE-14.

[10]  Harish Patil,et al.  Pin: building customized program analysis tools with dynamic instrumentation , 2005, PLDI '05.

[11]  Alexander Aiken,et al.  Checking and inferring local non-aliasing , 2003, PLDI '03.

[12]  Robert J. Simmons,et al.  Proofs from Tests , 2008, IEEE Transactions on Software Engineering.

[13]  Stephen McCamant,et al.  The Daikon system for dynamic detection of likely invariants , 2007, Sci. Comput. Program..

[14]  Jim Hefferon,et al.  Linear Algebra , 2012 .

[15]  Thomas Ball,et al.  Testing, abstraction, theorem proving: better together! , 2006, ISSTA '06.

[16]  K. Rustan M. Leino,et al.  Weakest-precondition of unstructured programs , 2005, PASTE '05.

[17]  Ken Kennedy,et al.  The parascope editor: an interactive parallel programming tool , 1993, Proceedings of the 1989 ACM/IEEE Conference on Supercomputing (Supercomputing '89).

[18]  Pat Hanrahan,et al.  Riposte: A trace-driven compiler and parallel VM for vector code in R , 2012, 2012 21st International Conference on Parallel Architectures and Compilation Techniques (PACT).

[19]  Koushik Sen,et al.  DART: directed automated random testing , 2005, PLDI '05.

[20]  Alexander Aiken,et al.  Data-driven equivalence checking , 2013, OOPSLA.

[21]  Nikolaj Bjørner,et al.  Generalized Property Directed Reachability , 2012, SAT.

[22]  Patrick Cousot,et al.  Static determination of dynamic properties of programs , 1976 .

[23]  Alexander Aiken,et al.  Stochastic optimization of floating-point programs with tunable precision , 2014, PLDI.

[24]  Thomas W. Reps,et al.  Symbolic Implementation of the Best Transformer , 2004, VMCAI.

[25]  Keith H. Randall,et al.  Denali: a goal-directed superoptimizer , 2002, PLDI '02.

[26]  Daniel Shawcross Wilkerson,et al.  Winnowing: local algorithms for document fingerprinting , 2003, SIGMOD '03.

[27]  Andrey Rybalchenko,et al.  Synthesizing software verifiers from proof rules , 2012, PLDI.

[28]  Amer Diwan,et al.  Optimizing programs with intended semantics , 2009, OOPSLA.

[29]  D. Naishlos,et al.  Autovectorization in GCC , 2004 .

[30]  Michael Stepp,et al.  Equality saturation: a new approach to optimization , 2009, POPL '09.

[31]  John A. Howell,et al.  Spans in the module (Zm ) s , 1986 .

[32]  Peter Müller,et al.  Collaborative Verification and Testing with Explicit Assumptions , 2012, FM.

[33]  Woongki Baek,et al.  Green: a framework for supporting energy-conscious programming using controlled approximation , 2010, PLDI '10.

[34]  Michael Karr,et al.  Affine relationships among variables of a program , 1976, Acta Informatica.

[35]  Todd Millstein,et al.  Automatic predicate abstraction of C programs , 2001, PLDI '01.

[36]  Henry Hoffmann,et al.  Managing performance vs. accuracy trade-offs with loop perforation , 2011, ESEC/FSE '11.

[37]  Alexander Aiken,et al.  Stochastic superoptimization , 2012, ASPLOS '13.

[38]  Shuvendu K. Lahiri,et al.  Conditional Equivalence , 2010 .

[39]  Shuvendu K. Lahiri,et al.  Will you still compile me tomorrow? static cross-version compiler validation , 2013, ESEC/FSE 2013.

[40]  Isil Dillig,et al.  Automated error diagnosis using abductive inference , 2012, PLDI.

[41]  Michael D. Ernst,et al.  Static verification of dynamically detected program invariants: Integrating Daikon and ESC/Java , 2001, RV@CAV.

[42]  James Demmel,et al.  Precimonious: Tuning assistant for floating-point precision , 2013, 2013 SC - International Conference for High Performance Computing, Networking, Storage and Analysis (SC).