Fast compilation is important when compilation occurs at runtime, such as query compilers in modern database systems and WebAssembly virtual machines in modern browsers. We present copy-and-patch, an extremely fast compilation technique that also produces good quality code. It is capable of lowering both high-level languages and low-level bytecode programs to binary code, by stitching together code from a large library of binary implementation variants. We call these binary implementations stencils because they have holes where missing values must be inserted during code generation. We show how to construct a stencil library and describe the copy-and-patch algorithm that generates optimized binary code. We demonstrate two use cases of copy-and-patch: a compiler for a high-level C-like language intended for metaprogramming and a compiler for WebAssembly. Our high-level language compiler has negligible compilation cost: it produces code from an AST in less time than it takes to construct the AST. We have implemented an SQL database query compiler on top of this metaprogramming system and show that on TPC-H database benchmarks, copy-and-patch generates code two orders of magnitude faster than LLVM -O0 and three orders of magnitude faster than higher optimization levels. The generated code runs an order of magnitude faster than interpretation and 14% faster than LLVM -O0. Our WebAssembly compiler generates code 4.9X-6.5X faster than Liftoff, the WebAssembly baseline compiler in Google Chrome. The generated code also outperforms Liftoff's by 39%-63% on the Coremark and PolyBenchC WebAssembly benchmarks.


翻译:当在运行时进行编译,例如现代数据库系统中的查询汇编器和现代浏览器中的WebAssembly 虚拟机器中的查询汇编器等,快速编译非常重要。我们展示了极快的编译技术,这是一个极快的编译技术,它也产生高质量的代码。它能够将高层次语言和低层次的字节程序降低到二进制代码,从一个大型的二进制执行变量库中缝合代码。我们将这些二进制执行程序称为“小”标准,因为它们有在代码生成过程中必须插入缺失值的洞洞。我们展示了如何在Stenciil库中建一个存储器库并描述生成优化的基线二进制代码代码的复制和批配算算法。我们展示了两个版本的复制和批录案例:一个用于元程序编排的高C类语言的编译器,而我们高层次的语言编译器的编译器比创建AST要快得多。我们还在两个版本系统顶端上安装了一个SQLLLLC的调调调调快的代码, 以比我们更高级的版本的版本的版本的LPSerma的版本的调调调调调调调调调调调调快。

0
下载
关闭预览

相关内容

编译器(Compiler),是一种计算机程序,它会将用某种编程语言写成的源代码(原始语言),转换成另一种编程语言(目标语言)。
Linux导论,Introduction to Linux,96页ppt
专知会员服务
77+阅读 · 2020年7月26日
专知会员服务
60+阅读 · 2020年3月19日
AAAI2020接受论文列表,1591篇论文目录全集
专知会员服务
98+阅读 · 2020年1月12日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
39+阅读 · 2019年10月9日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
无监督元学习表示学习
CreateAMind
26+阅读 · 2019年1月4日
已删除
将门创投
10+阅读 · 2018年5月2日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
Arxiv
0+阅读 · 2021年11月4日
Arxiv
0+阅读 · 2021年11月4日
Arxiv
9+阅读 · 2021年5月17日
Arxiv
4+阅读 · 2019年11月21日
Fast AutoAugment
Arxiv
5+阅读 · 2019年5月1日
Arxiv
5+阅读 · 2017年7月23日
VIP会员
相关资讯
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
无监督元学习表示学习
CreateAMind
26+阅读 · 2019年1月4日
已删除
将门创投
10+阅读 · 2018年5月2日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
相关论文
Top
微信扫码咨询专知VIP会员