Miniphases: compilation using modular and efficient tree transformations

Miniphases: compilation using modular and efficient tree transformations
复制标题

Miniphases:使用模块化和高效的树转换进行编译

DOI:
10.1145/3062341.3062346
复制
发表时间:
2017
期刊:
Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation
影响因子:
--
通讯作者:
Martin Odersky
Martin Odersky
中科院分区:
--
文献类型:
--
作者:
Dmitry Petrashko;Ondřej Lhoták;Martin Odersky

文献摘要

被引文献

相似文献

生产编译器通常在中间表示上执行几十个转换。在单独的通道中运行这些转换会损害性能。恢复性能的一种方法是手动联合收割机转换以减少遍数。这种方法损害了模块化,从而使编译器难以长期维护和发展,并使性能推理变得更加困难。本文介绍了一种方法,允许编译器作者定义多个转换分别,但融合成一个单一的遍历的中间表示时,编译器运行。这种方法已经在Scala语言的编译器中实现。我们的性能评估表明,这种方法减少了35%的树转换的运行时间,并表明这是由于提高了缓存友好性。与此同时,该方法通过将对象的占用率降低50%来提高总内存消耗。这种方法使编译器编写器能够编写同时具有模块化和快速性的转换。
Production compilers commonly perform dozens of transformations on an intermediate representation. Running those transformations in separate passes harms performance. One approach to recover performance is to combine transformations by hand in order to reduce number of passes. Such an approach harms modularity, and thus makes it hard to maintain and evolve a compiler over the long term, and makes reasoning about performance harder. This paper describes a methodology that allows a compiler writer to define multiple transformations separately, but fuse them into a single traversal of the intermediate representation when the compiler runs. This approach has been implemented in a compiler for the Scala language. Our performance evaluation indicates that this approach reduces the running time of tree transformations by 35% and shows that this is due to improved cache friendliness. At the same time, the approach improves total memory consumption by reducing the object tenuring rate by 50%. This approach enables compiler writers to write transformations that are both modular and fast at the same time.