arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1912.05036cs.PL
收藏

RVSDG:一种优化调度器的中间表示

RVSDG: An Intermediate Representation for Optimizing Compilers

Nico Reissmann, Jan Christian Meyer, Helge Bahmann, Magnus Själander

摘要:

中间表示(IR)是优化编译器的核心,因为程序的表示方式可能会增强或限制分析和转换。合适的IR专注于暴露最相关的信息,并建立不同编译器传递可以依赖的不变量。虽然以控制流为中心的IR似乎是命令式程序设计语言的天然选择,但编译器所需的分析越来越多地转向理解数据依赖关系,并同时在多个抽象层上工作。这在最近的发展中得到了部分证明,例如谷歌提出的MLIR。然而,在通用编译器中严格使用以数据流为中心的IR的可行性和可用性尚未进行评估,因为以前的作品没有提供实际的实现。提出了一种用于优化编译器的区域化值状态依赖图IR。RVSDG是以数据流为中心的IR,其中节点表示计算,边表示计算依赖性,并且区域捕获程序的分层结构。它代表了需求依赖形式的程序,隐式地支持结构化控制流,并在一个单一的IR模型的整个程序。我们提供了一个完整的规范的RVSDG,建设和破坏的方法,以及通过提出死节点和公共节点消除优化的实用程序。我们实现了一个原型编译器,并评估它的性能,代码大小,编译时间和代表性开销。我们的研究结果表明,RVSDG可以作为一个有竞争力的IR优化编译器,同时降低复杂性。

英文摘要:

Intermediate Representations (IRs) are central to optimizing compilers as the way the program is represented may enhance or limit analyses and transformations. Suitable IRs focus on exposing the most relevant information and establish invariants that different compiler passes can rely on. While control-flow centric IRs appear to be a natural fit for imperative programming languages, analyses required by compilers have increasingly shifted to understand data dependencies and work at multiple abstraction layers at the same time. This is partially evidenced in recent developments such as the MLIR proposed by Google. However, rigorous use of data flow centric IRs in general purpose compilers has not been evaluated for feasibility and usability as previous works provide no practical implementations. We present the Regionalized Value State Dependence Graph (RVSDG) IR for optimizing compilers. The RVSDG is a data flow centric IR where nodes represent computations, edges represent computational dependencies, and regions capture the hierarchical structure of programs. It represents programs in demand-dependence form, implicitly supports structured control flow, and models entire programs within a single IR. We provide a complete specification of the RVSDG, construction and destruction methods, as well as exemplify its utility by presenting Dead Node and Common Node Elimination optimizations. We implemented a prototype compiler and evaluate it in terms of performance, code size, compilation time, and representational overhead. Our results indicate that the RVSDG can serve as a competitive IR in optimizing compilers while reducing complexity.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑