skip to main content
research-article
Open Access
Distinguished Paper

Dataflow-based pruning for speeding up superoptimization

Published:13 November 2020Publication History
Skip Abstract Section

Abstract

Superoptimization is a compilation strategy that uses search to improve code quality, rather than relying on a canned sequence of transformations, as traditional optimizing compilers do. This search can be seen as a program synthesis problem: from unoptimized code serving as a specification, the synthesis procedure attempts to create a more efficient implementation. An important family of synthesis algorithms works by enumerating candidates and then successively checking if each refines the specification, using an SMT solver. The contribution of this paper is a pruning technique which reduces the enumerative search space using fast dataflow-based techniques to discard synthesis candidates that contain symbolic constants and uninstantiated instructions. We demonstrate the effectiveness of this technique by improving the runtime of an enumerative synthesis procedure in the Souper superoptimizer for the LLVM intermediate representation. The techniques presented in this paper eliminate 65% of the solver calls made by Souper, making it 2.32x faster (14.54 hours vs 33.76 hours baseline, on a large multicore) at solving all 269,113 synthesis problems that Souper encounters when optimizing the C and C++ programs from SPEC CPU 2017.

Skip Supplemental Material Section

Supplemental Material

Auxiliary Presentation Video

Superoptimization is a compilation strategy that uses search to improve code quality, rather than relying on a canned sequence of transformations, as traditional optimizing compilers do. This search can be seen as a program synthesis problem: from unoptimized code serving as a specification, the synthesis procedure attempts to create a more efficient implementation. An important family of synthesis algorithms works by enumerating candidates and then successively checking if each refines the specification, using an SMT solver. The contribution of this paper is a pruning technique which reduces the enumerative search space using fast dataflow-based techniques to discard synthesis candidates that contain symbolic constants and uninstantiated instructions. We demonstrate the effectiveness of this technique by improving the runtime of an enumerative synthesis procedure in the Souper superoptimizer for the LLVM intermediate representation.

References

  1. Takuya Akiba, Kentaro Imajo, Hiroaki Iwami, Yoichi Iwata, Toshiki Kataoka, Naohiro Takahashi, Michał Moskal, and Nikhil Swamy. 2013. Calibrating Research in Program Synthesis Using 72 ,000 Hours of Programmer Time.Google ScholarGoogle Scholar
  2. Rajeev Alur, Rastislav Bodik, Garvit Juniwal, Milo M. K. Martin, Mukund Raghothaman, Sanjit A. Seshia, Rishabh Singh, Armando Solar-Lezama, Emina Torlak, and Abhishek Udupa. 2013. Syntax-guided synthesis. Formal Methods in Computer-Aided Design, 1-17. https://doi.org/10.1109/FMCAD. 2013.6679385 Google ScholarGoogle ScholarCross RefCross Ref
  3. Rajeev Alur, Pavol Černý, and Arjun Radhakrishna. 2015. Synthesis Through Unification. In Computer Aided Verification, Daniel Kroening and Corina S. Păsăreanu (Eds.). 163-179. https://doi.org/10.1007/978-3-319-21668-3_10 Google ScholarGoogle ScholarCross RefCross Ref
  4. Rajeev Alur, Arjun Radhakrishna, and Abhishek Udupa. 2017. Scaling Enumerative Program Synthesis via Divide and Conquer. In Tools and Algorithms for the Construction and Analysis of Systems, Axel Legay and Tiziana Margaria (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 319-336. https://doi.org/10.1007/978-3-662-54577-5_18 Google ScholarGoogle ScholarCross RefCross Ref
  5. Sorav Bansal and Alex Aiken. 2006. Automatic Generation of Peephole Superoptimizers. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (San Jose, California, USA). 394-403. https://doi.org/10.1145/1168918.1168906 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Haniel Barbosa, Andrew Reynolds, Daniel Larraz, and Cesare Tinelli. 2019. Extending enumerative function synthesis via SMT-driven classification. 212-220. https://doi.org/10.23919/FMCAD. 2019.8894267 Google ScholarGoogle ScholarCross RefCross Ref
  7. Gilles Barthe, Juan Manuel Crespo, Sumit Gulwani, Cesar Kunz, and Mark Marron. 2013. From Relational Verification to SIMD Loop Synthesis. In Proceedings of the 18th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (Shenzhen, China) ( PPoPP '13). 123--134. https://doi.org/10.1145/2442516.2442529 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. James Bornholt, Emina Torlak, Dan Grossman, and Luis Ceze. 2016. Optimizing Synthesis with Metasketches. In Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (St. Petersburg, FL, USA) ( POPL '16). 775-788. https://doi.org/10.1145/2837614.2837666 Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Roberto Bruttomesso, Alessandro Cimatti, Anders Franzén, Alberto Griggio, Alessandro Santuari, and Roberto Sebastiani. 2006. To Ackermann-Ize or Not to Ackermann-Ize? On Eficiently Handling Uninterpreted Function Symbols in SMT. In Proc. of the 13th International Conference on Logic for Programming, Artificial Intelligence, and Reasoning (Phnom Penh, Cambodia). 557-571. https://doi.org/10.1007/11916277_38 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Joel Galenson, Philip Reames, Rastislav Bodik, Björn Hartmann, and Koushik Sen. 2014. CodeHint: Dynamic and Interactive Synthesis of Code Snippets. In Proceedings of the 36th International Conference on Software Engineering (Hyderabad, India) (ICSE 2014 ). 653--663. https://doi.org/10.1145/2568225.2568250 Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Sumit Gulwani, Susmit Jha, Ashish Tiwari, and Ramarathnam Venkatesan. 2011. Synthesis of Loop-free Programs. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation (San Jose, California, USA) ( PLDI '11). 62-73. https://doi.org/10.1145/1993316.1993506 Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Zheng Guo, Michael James, David Justo, Jiaxiao Zhou, Ziteng Wang, Ranjit Jhala, and Nadia Polikarpova. 2019. Program Synthesis by Type-Guided Abstraction Refinement. Proc. ACM Program. Lang. 4, POPL, Article 12 ( Dec. 2019 ). https: //doi.org/10.1145/3371080 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Juneyoung Lee, Yoonseung Kim, Youngju Song, Chung-Kil Hur, Sanjoy Das, David Majnemer, John Regehr, and Nuno P. Lopes. 2017. Taming Undefined Behavior in LLVM. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (Barcelona, Spain) ( PLDI 2017 ). Association for Computing Machinery, New York, NY, USA, 633-647. https://doi.org/10.1145/3062341.3062343 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Woosuk Lee, Kihong Heo, Rajeev Alur, and Mayur Naik. 2018. Accelerating Search-based Program Synthesis Using Learned Probabilistic Models. In Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation (Philadelphia, PA, USA) ( PLDI 2018 ). 436-449. https://doi.org/10.1145/3192366.3192410 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Alexander Lex, Nils Gehlenborg, Hendrik Strobelt, Romain Vuillemot, and Hanspeter Pfister. 2014. UpSet: Visualization of Intersecting Sets. IEEE Transactions on Visualization and Computer Graphics 20, 12 ( 2014 ), 1983--1992.Google ScholarGoogle ScholarCross RefCross Ref
  16. Calvin Loncaric, Michael D. Ernst, and Emina Torlak. 2018. Generalized Data Structure Synthesis. In Proceedings of the 40th International Conference on Software Engineering (Gothenburg, Sweden) (ICSE '18). 958-968. https://doi.org/10.1145/ 3180155.3180211 Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Henry Massalin. 1987. Superoptimizer: A Look at the Smallest Program. In Proceedings of the Second International Conference on Architectual Support for Programming Languages and Operating Systems (Palo Alto, California, USA) ( ASPLOS '87). 122-126. https://doi.org/10.1145/36177.36194 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Phitchaya Mangpo Phothilimthana, Aditya Thakur, Rastislav Bodik, and Dinakar Dhurjati. 2016. Scaling Up Superoptimization. In Proceedings of the Twenty-First International Conference on Architectural Support for Programming Languages and Operating Systems (Atlanta, Georgia, USA) ( ASPLOS '16). 297-310. https://doi.org/10.1145/2872362.2872387 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Nadia Polikarpova and Ilya Sergey. 2019. Structuring the Synthesis of Heap-Manipulating Programs. Proc. ACM Program. Lang. 3, POPL, Article 72 ( Jan. 2019 ). https://doi.org/10.1145/3290385 Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Raimondas Sasnauskas, Yang Chen, Peter Collingbourne, Jeroen Ketema, Gratian Lup, Jubi Taneja, and John Regehr. 2017. Souper: A Synthesizing Superoptimizer. arXiv: 1711.04422 [cs.PL]Google ScholarGoogle Scholar
  21. Eric Schkufza, Rahul Sharma, and Alex Aiken. 2013. Stochastic Superoptimization. In Proceedings of the Eighteenth International Conference on Architectural Support for Programming Languages and Operating Systems (Houston, Texas, USA) ( ASPLOS '13). 305-316. https://doi.org/10.1145/2490301.2451150 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Armando Solar-Lezama. 2008. Program Synthesis by Sketching. Ph.D. Dissertation. Berkeley, CA, USA. Advisor(s) Bodik, Rastislav. AAI3353225.Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Venkatesh Srinivasan and Thomas Reps. 2015. Synthesis of Machine Code from Semantics. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (Portland, OR, USA) ( PLDI '15). 596-607. https://doi.org/10.1145/2737924.2737960 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Venkatesh Srinivasan, Tushar Sharma, and Thomas Reps. 2016. Speeding Up Machine-code Synthesis. In Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (Amsterdam, Netherlands) ( OOPSLA 2016 ). 165-180. https://doi.org/10.1145/2983990.2984006 Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Ashish Tiwari, Adrià Gascón, and Bruno Dutertre. 2015. Program Synthesis Using Dual Interpretation. In Automated Deduction-CADE-25, Amy P. Felty and Aart Middeldorp (Eds.). Springer International Publishing, Cham, 482-497.Google ScholarGoogle Scholar
  26. Abhishek Udupa, Arun Raghavan, Jyotirmoy V. Deshmukh, Sela Mador-Haim, Milo M.K. Martin, and Rajeev Alur. 2013. TRANSIT: Specifying Protocols with Concolic Snippets. In Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation (Seattle, Washington, USA) ( PLDI '13). 287-296. https://doi.org/10.1145/2491956.2462174 Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Xuejun Yang, Yang Chen, Eric Eide, and John Regehr. 2011. Finding and Understanding Bugs in C Compilers. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation (San Jose, California, USA) ( PLDI '11). 283-294. https://doi.org/10.1145/1993316.1993532 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Dataflow-based pruning for speeding up 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!