Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article
Public Access

Speeding up machine-code synthesis

Published: 19 October 2016 Publication History

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.
[2]
A. Aho, M. Ganapathi, and S. Tjiang. Code generation using tree matching and dynamic programming. TOPLAS, 35(4), 1989.
[3]
G. Balakrishnan and T. Reps. WYSINWYX: What You See Is Not What You eXecute. TOPLAS, 32(6), 2010.
[4]
S. Bansal and A. Aiken. Automatic generation of peephole superoptimizers. In ASPLOS, 2006.
[5]
S. Bansal and A. Aiken. Binary translation using peephole superoptimizers. In OSDI, 2008.
[6]
D. Brumley, I. Jager, T. Avgerinos, and E. Schwartz. BAP: A Binary Analysis Platform. In CAV, 2011.
[7]
B. Dutertre and L. de Moura. Yices: An SMT solver, 2006. http://yices.csl.sri.com/.
[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.
[9]
C. Fraser, D. Hanson, and T. Proebsting. Engineering a simple, efficient code-generator generator. LOPLAS, 1 (3), 1992.
[10]
G. Goff, K. Kennedy, and C. Tseng. Practical dependence testing. In PLDI, 1991.
[11]
J. Henning. SPEC CPU2006 Benchmark descriptions. SIGARCH Comput. Archit. News, 34(4):1–17, 2006.
[12]
N. Jones, C. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, Inc., 1993.
[13]
R. Joshi, G. Nelson, and K. Randall. Denali: A goaldirected superoptimizer. In PLDI, 2002.
[14]
J. Lim and T. Reps. TSL: A system for generating abstract interpreters and its application to machine-code analysis. TOPLAS, 35(4), 2013.
[15]
J. Lim, A. Lal, and T. Reps. Symbolic analysis via semantic reinterpretation. Softw. Tools for Tech. Transfer, 13(1):61–87, 2011.
[16]
H. Massalin. Superoptimizer: A look at the smallest program. In ASPLOS, 1987.
[17]
D. Maydan, J. Hennessy, and M. Lam. Efficient and exact data dependence analysis. In PLDI, 1991.
[18]
P. Phothilimthana, A. Thakur, R. Bodik, and D. Ghurjati. Scaling up superoptimization. In ASPLOS, 2016.
[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.
[20]
V. Raychev, M. Vechev, and E. Yahav. Code completion with statistical language models. In PLDI, 2014.
[21]
V. Raychev, M. Vechev, and A. Krause. Predicting program properties from“big code”. In POPL, 2015.
[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.
[23]
E. Schkufza, R. Sharma, and A. Aiken. Stochastic superoptimization. In ASPLOS, 2013.
[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.
[25]
V. Srinivasan and T. Reps. Partial evaluation of machine code. In OOPSLA, 2015.
[26]
V. Srinivasan and T. Reps. Synthesis of machine code from semantics. In PLDI, 2015.
[27]
V. Srinivasan and T. Reps. An improved algorithm for slicing machince code. In OOPSLA, 2016.

Cited By

View all
  • (2018)Synthesizing an instruction selection rule library from semantic specificationsProceedings of the 2018 International Symposium on Code Generation and Optimization10.1145/3168821(300-313)Online publication date: 24-Feb-2018
  • (2024)Hydra: Generalizing Peephole Optimizations with Program SynthesisProceedings of the ACM on Programming Languages10.1145/36498378:OOPSLA1(725-753)Online publication date: 29-Apr-2024
  • (2024)Parallel Assembly SynthesisLogic-Based Program Synthesis and Transformation10.1007/978-3-031-71294-4_1(3-26)Online publication date: 9-Sep-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 51, Issue 10
OOPSLA '16
October 2016
915 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/3022671
Issue’s Table of Contents
  • cover image ACM Conferences
    OOPSLA 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications
    October 2016
    915 pages
    ISBN:9781450344449
    DOI:10.1145/2983990
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 19 October 2016
Published in SIGPLAN Volume 51, Issue 10

Check for updates

Author Tags

  1. IA-32 instruction set
  2. Machine-code synthesis
  3. flattening deep terms
  4. flow independence
  5. move-to-front heuristic
  6. pruning heuristics

Qualifiers

  • Research-article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)89
  • Downloads (Last 6 weeks)24
Reflects downloads up to 13 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2018)Synthesizing an instruction selection rule library from semantic specificationsProceedings of the 2018 International Symposium on Code Generation and Optimization10.1145/3168821(300-313)Online publication date: 24-Feb-2018
  • (2024)Hydra: Generalizing Peephole Optimizations with Program SynthesisProceedings of the ACM on Programming Languages10.1145/36498378:OOPSLA1(725-753)Online publication date: 29-Apr-2024
  • (2024)Parallel Assembly SynthesisLogic-Based Program Synthesis and Transformation10.1007/978-3-031-71294-4_1(3-26)Online publication date: 9-Sep-2024
  • (2023)Towards Porting Operating Systems with Program SynthesisACM Transactions on Programming Languages and Systems10.1145/356394345:1(1-70)Online publication date: 3-Mar-2023
  • (2021)Assuage: Assembly Synthesis Using A Guided ExplorationThe 34th Annual ACM Symposium on User Interface Software and Technology10.1145/3472749.3474740(134-148)Online publication date: 10-Oct-2021
  • (2020)Dataflow-based pruning for speeding up superoptimizationProceedings of the ACM on Programming Languages10.1145/34282454:OOPSLA(1-24)Online publication date: 13-Nov-2020
  • (2018)Synthesizing an instruction selection rule library from semantic specificationsProceedings of the 2018 International Symposium on Code Generation and Optimization10.1145/3168821(300-313)Online publication date: 24-Feb-2018
  • (2017)Model-assisted machine-code synthesisProceedings of the ACM on Programming Languages10.1145/31338851:OOPSLA(1-26)Online publication date: 12-Oct-2017

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media