skip to main content
research-article
Public Access

Speeding up machine-code synthesis

Published:19 October 2016Publication History
Skip Abstract Section

Abstract

Machine-code synthesis is the problem of searching for an instruction sequence that implements a semantic specification, given as a formula in quantifier-free bit-vector logic (QFBV). Instruction sets like Intel's IA-32 have around 43,000 unique instruction schemas; this huge instruction pool, along with the exponential cost inherent in enumerative synthesis, results in an enormous search space for a machine-code synthesizer: even for relatively small specifications, the synthesizer might take several hours or days to find an implementation. In this paper, we present several improvements to the algorithms used in a state-of-the-art machine-code synthesizer McSynth. In addition to a novel pruning heuristic, our improvements incorporate a number of ideas known from the literature, which we adapt in novel ways for the purpose of speeding up machine-code synthesis. Our experiments for Intel's IA-32 instruction set show that our improvements enable synthesis of code for 12 out of 14 formulas on which McSynth times out, speeding up the synthesis time by at least 1981X, and for the remaining formulas, speeds up synthesis by 3X.

References

  1. Compilers: Principles, Techniques, and Tools, chapter 8: Code Generation. Addison-Wesley, 2007.Google ScholarGoogle Scholar
  2. A. Aho, M. Ganapathi, and S. Tjiang. Code generation using tree matching and dynamic programming. TOPLAS, 35(4), 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. G. Balakrishnan and T. Reps. WYSINWYX: What You See Is Not What You eXecute. TOPLAS, 32(6), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Bansal and A. Aiken. Automatic generation of peephole superoptimizers. In ASPLOS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. S. Bansal and A. Aiken. Binary translation using peephole superoptimizers. In OSDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. D. Brumley, I. Jager, T. Avgerinos, and E. Schwartz. BAP: A Binary Analysis Platform. In CAV, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. B. Dutertre and L. de Moura. Yices: An SMT solver, 2006. http://yices.csl.sri.com/.Google ScholarGoogle Scholar
  8. K. ElWazeer, K. Anand, A. Kotha, M. Smithson, and R. Barua. Scalable variable and data type detection in a binary rewriter. In PLDI, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. C. Fraser, D. Hanson, and T. Proebsting. Engineering a simple, efficient code-generator generator. LOPLAS, 1 (3), 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. G. Goff, K. Kennedy, and C. Tseng. Practical dependence testing. In PLDI, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. J. Henning. SPEC CPU2006 Benchmark descriptions. SIGARCH Comput. Archit. News, 34(4):1–17, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. N. Jones, C. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, Inc., 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. R. Joshi, G. Nelson, and K. Randall. Denali: A goaldirected superoptimizer. In PLDI, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. J. Lim and T. Reps. TSL: A system for generating abstract interpreters and its application to machine-code analysis. TOPLAS, 35(4), 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. J. Lim, A. Lal, and T. Reps. Symbolic analysis via semantic reinterpretation. Softw. Tools for Tech. Transfer, 13(1):61–87, 2011.Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. H. Massalin. Superoptimizer: A look at the smallest program. In ASPLOS, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. D. Maydan, J. Hennessy, and M. Lam. Efficient and exact data dependence analysis. In PLDI, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. P. Phothilimthana, A. Thakur, R. Bodik, and D. Ghurjati. Scaling up superoptimization. In ASPLOS, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P. Phothilimthana, A. Thakur, R. Bodik, and D. Ghurjati. GreenThumb: Superoptimizer construction framework. UCB/EECS-2016-8, University of California–Berkeley Tech Report, Feb. 2016.Google ScholarGoogle Scholar
  20. V. Raychev, M. Vechev, and E. Yahav. Code completion with statistical language models. In PLDI, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. V. Raychev, M. Vechev, and A. Krause. Predicting program properties from“big code”. In POPL, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. H. Sa¨ıdi. Logical foundation for static analysis: Application to binary static analysis for security. ACM SIGAda Ada Letters, 28(1):96–102, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. E. Schkufza, R. Sharma, and A. Aiken. Stochastic superoptimization. In ASPLOS, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. D. Song, D. Brumley, H. Yin, J. Caballero, I. Jager, M. Kang, Z. Liang, J. Newsome, P. Poosankam, and P. Saxena. BitBlaze: A new approach to computer security via binary analysis. In Int. Conf. on Information Systems Security, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. V. Srinivasan and T. Reps. Partial evaluation of machine code. In OOPSLA, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. V. Srinivasan and T. Reps. Synthesis of machine code from semantics. In PLDI, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. V. Srinivasan and T. Reps. An improved algorithm for slicing machince code. In OOPSLA, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library

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!