Abstract
Given a loop-free sequence of instructions, superoptimization techniques use a constraint solver to search for an equivalent sequence that is optimal for a desired objective. The complexity of the search grows exponentially with the length of the solution being constructed, and the problem becomes intractable for large sequences of instructions. This paper presents a new approach to superoptimizing stack-bytecode via three novel components: (1) a greedy algorithm to refine the bound on the length of the optimal solution; (2) a new representation of the optimization problem as a set of weighted soft clauses in MaxSAT; (3) a series of domain-specific dominance and redundant constraints to reduce the search space for optimal solutions. We have developed a tool, named SuperStack, which can be used to find optimal code translations of modern stack-based bytecode, namely WebAssembly or Ethereum bytecode. Experimental evaluation on more than 500,000 sequences shows the proposed greedy, constraint-based and SAT combination is able to greatly increase optimization gains achieved by existing superoptimizers and reduce to at least a fourth the optimization time.
Original language | English |
---|---|
Title of host publication | Proceedings of the ACM on Programming Languages |
Subtitle of host publication | Programming Languages Design and Implementation (PLDI 2024) |
Editors | John Regehr |
Place of Publication | New York NY USA |
Publisher | Association for Computing Machinery (ACM) |
Pages | 1437 - 1462 |
Number of pages | 26 |
Volume | 8 |
DOIs | |
Publication status | Published - 2024 |
Event | ACM-SIGPLAN Conference on Programming Language Design and Implementation 2024 - Copenhagen, Denmark Duration: 24 Jun 2024 → 28 Jun 2024 Conference number: 45th https://pldi24.sigplan.org/ (Website) https://dl.acm.org/toc/pacmpl/2024/8/PLDI (Proceedings) |
Conference
Conference | ACM-SIGPLAN Conference on Programming Language Design and Implementation 2024 |
---|---|
Abbreviated title | PLDI 2024 |
Country/Territory | Denmark |
City | Copenhagen |
Period | 24/06/24 → 28/06/24 |
Internet address |
|
Keywords
- EVM
- Program Synthesis
- SAT
- Superoptimization
- WebAssembly