Abstract
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.
- A. Aiken, J. S. Foster, J. Kodumal, and T. Terauchi. Checking and inferring local non-aliasing. In PLDI, pages 129–140, 2003. Google Scholar
Digital Library
- W. Baek and T. M. Chilimbi. Green: a framework for supporting energy-conscious programming using controlled approximation. In PLDI, pages 198–209, 2010. Google Scholar
Digital Library
- T. Ball, R. Majumdar, T. D. Millstein, and S. K. Rajamani. Automatic predicate abstraction of C programs. In PLDI, pages 203–213, 2001. Google Scholar
Digital Library
- S. Bansal and A. Aiken. Automatic generation of peephole superoptimizers. In ASPLOS, pages 394–403, 2006. Google Scholar
Digital Library
- M. Barnett and K. R. M. Leino. Weakest-precondition of unstructured programs. In Proceedings of the 6th ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, PASTE ’05, pages 82–87, 2005. Google Scholar
Digital Library
- C. Barrett, C. L. Conway, M. Deters, L. Hadarean, D. Jovanovi´c, T. King, A. Reynolds, and C. Tinelli. CVC4. In CAV, pages 171–177, 2011. Google Scholar
Digital Library
- N. E. Beckman, A. V. Nori, S. K. Rajamani, R. J. Simmons, S. Tetali, and A. V. Thakur. Proofs from tests. IEEE Trans. Software Eng., 36(4):495–508, 2010. Google Scholar
Digital Library
- M. Christakis, P. Müller, and V. Wüstholz. Collaborative verification and testing with explicit assumptions. In FM, pages 132–146, 2012.Google Scholar
Cross Ref
- P. Cousot and R. Cousot. Static determination of dynamic properties of programs. In International Symposium on Programming (ISOP 76), pages 106–130, 1976.Google Scholar
- I. Dillig, T. Dillig, and A. Aiken. Automated error diagnosis using abductive inference. In PLDI, pages 181–192, 2012. Google Scholar
Digital Library
- M. Elder, J. Lim, T. Sharma, T. Andersen, and T. W. Reps. Abstract domains of affine relations. In SAS, pages 198–215, 2011. Google Scholar
Digital Library
- M. D. Ernst, J. H. Perkins, P. J. Guo, S. McCamant, C. Pacheco, M. S. Tschantz, and C. Xiao. The Daikon system for dynamic detection of likely invariants. Sci. Comput. Program., 69(1–3), 2007. Google Scholar
Digital Library
- R. W. Floyd. Assigning meanings to programs. In Mathematical Aspects of Computer Science, volume 19 of Proceedings of Symposia in Applied Mathematics, pages 19–32. American Mathematical Society, 1967.Google Scholar
- P. Godefroid, N. Klarlund, and K. Sen. DART: Directed Automated Random Testing. In PLDI, pages 213–223, 2005. Google Scholar
Digital Library
- S. Grebenshchikov, N. P. Lopes, C. Popeea, and A. Rybalchenko. Synthesizing software verifiers from proof rules. In PLDI, pages 405–416, 2012. Google Scholar
Digital Library
- B. Hackett and A. Aiken. How is aliasing used in systems software? In SIGSOFT FSE, pages 69–80, 2006. Google Scholar
Digital Library
- M. W. Hall, T. J. Harvey, K. Kennedy, N. McIntosh, K. S. McKinley, J. D. Oldham, M. H. Paleczny, and G. Roth. Experiences using the ParaScope editor: an interactive parallel programming tool. In PPoPP, pages 33–43, 1993. Google Scholar
Digital Library
- C. Hawblitzel, S. K. Lahiri, K. Pawar, H. Hashmi, S. Gokbulut, L. Fernando, D. Detlefs, and S. Wadsworth. Will you still compile me tomorrow? Static cross-version compiler validation. In ESEC/SIGSOFT FSE, pages 191–201, 2013. Google Scholar
Digital Library
- K. Hoder and N. Bjørner. Generalized property directed reachability. In SAT, pages 157–171, 2012. Google Scholar
Digital Library
- K. Hoffman and R. Kunze. Linear Algebra. Prentice Hall, second edition, 1971.Google Scholar
- J. A. Howell. Spans in the module (z,n)*. In Linear and Multilinear Algebra 19, 1986.Google Scholar
- B. Jeannet, P. Schrammel, and S. Sankaranarayanan. Abstract acceleration of general linear loops. In POPL, pages 529–540, 2014. Google Scholar
Digital Library
- R. Joshi, G. Nelson, and K. H. Randall. Denali: A goaldirected superoptimizer. In PLDI, pages 304–314, 2002. Google Scholar
Digital Library
- M. Karr. Affine relationships among variables of a program. Acta Inf., 6:133–151, 1976. Google Scholar
Digital Library
- M. Kawaguchi, S. K. Lahiri, and H. Reblo. Conditional equivalence. Technical report, MSR, 2010.Google Scholar
- S. Liao, A. Diwan, R. P. Bosch Jr., A. M. Ghuloum, and M. S. Lam. SUIF explorer: An interactive and interprocedural parallelizer. In PPoPP, pages 37–48, 1999. Google Scholar
Digital Library
- C.-K. Luk, R. S. Cohn, R. Muth, H. Patil, A. Klauser, P. G. Lowney, S. Wallace, V. J. Reddi, and K. M. Hazelwood. Pin: building customized program analysis tools with dynamic instrumentation. In PLDI, pages 190–200, 2005. Google Scholar
Digital Library
- H. Massalin. Superoptimizer - A look at the smallest program. In ASPLOS, pages 122–126, 1987. Google Scholar
Digital Library
- M. Matz, J. Hubi˘cka, A. Jaeger, and M. Mitchell. System V Application Binary Interface, AMD64 Architecture Processor Supplement, Draft v0.99.6, 2013.Google Scholar
- S. Misailovic, D. M. Roy, and M. C. Rinard. Probabilistically accurate program transformations. In SAS, pages 316–333, 2011. Google Scholar
Digital Library
- D. Naishlos. Autovectorization in GCC. In Proceedings of the 2004 GCC Developers Summit, 2004.Google Scholar
- J. W. Nimmer and M. D. Ernst. Static verification of dynamically detected program invariants: Integrating Daikon and ESC/Java. Electr. Notes Theor. Comput. Sci., 55(2):255–276, 2001.Google Scholar
Cross Ref
- J. Regehr and U. Duongsaa. Deriving abstract transfer functions for analyzing embedded software. In LCTES, pages 34– 43, 2006. Google Scholar
Digital Library
- T. W. Reps, M. Sagiv, and G. Yorsh. Symbolic implementation of the best transformer. In VMCAI, pages 252–266, 2004.Google Scholar
Cross Ref
- C. Rubio-González, C. Nguyen, H. D. Nguyen, J. Demmel, W. Kahan, K. Sen, D. H. Bailey, C. Iancu, and D. Hough. Precimonious: tuning assistant for floating-point precision. In SC, page 27, 2013.Google Scholar
Digital Library
- E. Schkufza, R. Sharma, and A. Aiken. Stochastic superoptimization. In ASPLOS, pages 305–316, 2013. Google Scholar
Digital Library
- E. Schkufza, R. Sharma, and A. Aiken. Stochastic optimization of floating-point programs using tunable precision. In PLDI, pages 53–64, 2014. Google Scholar
Digital Library
- S. Schleimer, D. S. Wilkerson, and A. Aiken. Winnowing: Local algorithms for document fingerprinting. In SIGMOD, pages 76–85, 2003. Google Scholar
Digital Library
- R. Sharma, S. Gupta, B. Hariharan, A. Aiken, P. Liang, and A. V. Nori. A data driven approach for algebraic loop invariants. In ESOP, pages 574–592, 2013. Google Scholar
Digital Library
- R. Sharma, E. Schkufza, B. R. Churchill, and A. Aiken. Datadriven equivalence checking. In OOPSLA, pages 391–406, 2013. Google Scholar
Digital Library
- S. Sidiroglou-Douskos, S. Misailovic, H. Hoffmann, and M. C. Rinard. Managing performance vs. accuracy tradeoffs with loop perforation. In SIGSOFT FSE, pages 124–134, 2011. Google Scholar
Digital Library
- J. Talbot, Z. DeVito, and P. Hanrahan. Riposte: a trace-driven compiler and parallel VM for vector code in R. In PACT, pages 43–52, 2012. Google Scholar
Digital Library
- R. Tate, M. Stepp, Z. Tatlock, and S. Lerner. Equality saturation: a new approach to optimization. In POPL, pages 264– 276, 2009. Google Scholar
Digital Library
- D. von Dincklage and A. Diwan. Optimizing programs with intended semantics. In OOPSLA, pages 409–424, 2009. Google Scholar
Digital Library
- G. Yorsh, T. Ball, and M. Sagiv. Testing, abstraction, theorem proving: better together! In ISSTA, pages 145–156, 2006. Google Scholar
Digital Library
Index Terms
Conditionally correct superoptimization
Recommendations
Scaling up Superoptimization
ASPLOS '16: Proceedings of the Twenty-First International Conference on Architectural Support for Programming Languages and Operating SystemsDeveloping a code optimizer is challenging, especially for new, idiosyncratic ISAs. Superoptimization can, in principle, discover machine-specific optimizations automatically by searching the space of all instruction sequences. If we can increase the ...
Sound Loop Superoptimization for Google Native Client
ASPLOS '17Software fault isolation (SFI) is an important technique for the construction of secure operating systems, web browsers, and other extensible software. We demonstrate that superoptimization can dramatically improve the performance of Google Native ...
Stochastic superoptimization
ASPLOS '13We formulate the loop-free binary superoptimization task as a stochastic search problem. The competing constraints of transformation correctness and performance improvement are encoded as terms in a cost function, and a Markov Chain Monte Carlo sampler ...






Comments