skip to main content
research-article
Public Access

Conditionally correct superoptimization

Published:23 October 2015Publication History
Skip Abstract Section

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.

References

  1. A. Aiken, J. S. Foster, J. Kodumal, and T. Terauchi. Checking and inferring local non-aliasing. In PLDI, pages 129–140, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. W. Baek and T. M. Chilimbi. Green: a framework for supporting energy-conscious programming using controlled approximation. In PLDI, pages 198–209, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. T. Ball, R. Majumdar, T. D. Millstein, and S. K. Rajamani. Automatic predicate abstraction of C programs. In PLDI, pages 203–213, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Bansal and A. Aiken. Automatic generation of peephole superoptimizers. In ASPLOS, pages 394–403, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. Christakis, P. Müller, and V. Wüstholz. Collaborative verification and testing with explicit assumptions. In FM, pages 132–146, 2012.Google ScholarGoogle ScholarCross RefCross Ref
  9. P. Cousot and R. Cousot. Static determination of dynamic properties of programs. In International Symposium on Programming (ISOP 76), pages 106–130, 1976.Google ScholarGoogle Scholar
  10. I. Dillig, T. Dillig, and A. Aiken. Automated error diagnosis using abductive inference. In PLDI, pages 181–192, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. Elder, J. Lim, T. Sharma, T. Andersen, and T. W. Reps. Abstract domains of affine relations. In SAS, pages 198–215, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle Scholar
  14. P. Godefroid, N. Klarlund, and K. Sen. DART: Directed Automated Random Testing. In PLDI, pages 213–223, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. S. Grebenshchikov, N. P. Lopes, C. Popeea, and A. Rybalchenko. Synthesizing software verifiers from proof rules. In PLDI, pages 405–416, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. B. Hackett and A. Aiken. How is aliasing used in systems software? In SIGSOFT FSE, pages 69–80, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. K. Hoder and N. Bjørner. Generalized property directed reachability. In SAT, pages 157–171, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. K. Hoffman and R. Kunze. Linear Algebra. Prentice Hall, second edition, 1971.Google ScholarGoogle Scholar
  21. J. A. Howell. Spans in the module (z,n)*. In Linear and Multilinear Algebra 19, 1986.Google ScholarGoogle Scholar
  22. B. Jeannet, P. Schrammel, and S. Sankaranarayanan. Abstract acceleration of general linear loops. In POPL, pages 529–540, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. R. Joshi, G. Nelson, and K. H. Randall. Denali: A goaldirected superoptimizer. In PLDI, pages 304–314, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M. Karr. Affine relationships among variables of a program. Acta Inf., 6:133–151, 1976. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. M. Kawaguchi, S. K. Lahiri, and H. Reblo. Conditional equivalence. Technical report, MSR, 2010.Google ScholarGoogle Scholar
  26. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. H. Massalin. Superoptimizer - A look at the smallest program. In ASPLOS, pages 122–126, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. 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 ScholarGoogle Scholar
  30. S. Misailovic, D. M. Roy, and M. C. Rinard. Probabilistically accurate program transformations. In SAS, pages 316–333, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. D. Naishlos. Autovectorization in GCC. In Proceedings of the 2004 GCC Developers Summit, 2004.Google ScholarGoogle Scholar
  32. 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 ScholarGoogle ScholarCross RefCross Ref
  33. J. Regehr and U. Duongsaa. Deriving abstract transfer functions for analyzing embedded software. In LCTES, pages 34– 43, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. T. W. Reps, M. Sagiv, and G. Yorsh. Symbolic implementation of the best transformer. In VMCAI, pages 252–266, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  35. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  36. E. Schkufza, R. Sharma, and A. Aiken. Stochastic superoptimization. In ASPLOS, pages 305–316, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. E. Schkufza, R. Sharma, and A. Aiken. Stochastic optimization of floating-point programs using tunable precision. In PLDI, pages 53–64, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. S. Schleimer, D. S. Wilkerson, and A. Aiken. Winnowing: Local algorithms for document fingerprinting. In SIGMOD, pages 76–85, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  40. R. Sharma, E. Schkufza, B. R. Churchill, and A. Aiken. Datadriven equivalence checking. In OOPSLA, pages 391–406, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  42. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  43. R. Tate, M. Stepp, Z. Tatlock, and S. Lerner. Equality saturation: a new approach to optimization. In POPL, pages 264– 276, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. D. von Dincklage and A. Diwan. Optimizing programs with intended semantics. In OOPSLA, pages 409–424, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. G. Yorsh, T. Ball, and M. Sagiv. Testing, abstraction, theorem proving: better together! In ISSTA, pages 145–156, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Conditionally correct superoptimization

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in

              Full Access

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader
              About Cookies On This Site

              We use cookies to ensure that we give you the best experience on our website.

              Learn more

              Got it!