Affiliation:
1. Google Zürich, Switzerland
2. Norwegian University of Science and Technology, Trondheim, Norway
Abstract
Demand-based dependence graphs (DDGs), such as the (Regionalized) Value State Dependence Graph ((R)VSDG), are intermediate representations (IRs) well suited for a wide range of program transformations. They explicitly model the flow of data and state, and only implicitly represent a restricted form of control flow. These features make DDGs especially suitable for automatic parallelization and vectorization, but cannot be leveraged by practical compilers without efficient construction and destruction algorithms. Construction algorithms remodel the arbitrarily complex control flow of a procedure to make it amenable to DDG representation, whereas destruction algorithms reestablish control flow for generating efficient object code. Existing literature presents solutions to both problems, but these impose structural constraints on the generatable control flow, and omit qualitative evaluation.
The key contribution of this article is to show that there is no intrinsic structural limitation in the control flow directly extractable from RVSDGs. This fundamental result originates from an interpretation of loop repetition and decision predicates as computed continuations, leading to the introduction of the
predicate continuation
normal form. We provide an algorithm for constructing RVSDGs in predicate continuation form, and propose a novel destruction algorithm for RVSDGs in this form. Our destruction algorithm can generate arbitrarily complex control flow; we show this by proving that the original CFG an RVSDG was derived from can, apart from overspecific detail, be reconstructed perfectly. Additionally, we prove termination and correctness of these algorithms. Furthermore, we empirically evaluate the performance, the representational overhead at compile time, and the reduction in branch instructions compared to existing solutions. In contrast to previous work, our algorithms impose no additional overhead on the control flow of the produced object code. To our knowledge, this is the first scheme that allows the original control flow of a procedure to be recovered from a DDG representation.
Publisher
Association for Computing Machinery (ACM)
Subject
Hardware and Architecture,Information Systems,Software
Reference33 articles.
1. Alfred V. Aho Monica S. Lam Ravi Sethi and Jeffrey D. Ullman. 2006. Compilers: Principles Techniques and Tools (2nd ed.). Addison-Wesley Longman Inc. New York NY. Alfred V. Aho Monica S. Lam Ravi Sethi and Jeffrey D. Ullman. 2006. Compilers: Principles Techniques and Tools (2nd ed.). Addison-Wesley Longman Inc. New York NY.
2. A control-flow normalization algorithm and its complexity
3. The program dependence graph and vectorization
4. orrado Böhm and Giuseppe Jacopini. 1979. Classics in software engineering. Chapter Flow Diagrams Turing Machines and Languages with Only Two Formation Rules. Yourdon Press New York NY 11--25. orrado Böhm and Giuseppe Jacopini. 1979. Classics in software engineering. Chapter Flow Diagrams Turing Machines and Languages with Only Two Formation Rules. Yourdon Press New York NY 11--25.
5. Revisiting Out-of-SSA Translation for Correctness, Code Quality and Efficiency
Cited by
5 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. RRPDG: A Graph Model to Enable AI-Based Production Reconfiguration and Optimization;IEEE Transactions on Industrial Informatics;2024-04
2. Skybox: Open-Source Graphic Rendering on Programmable RISC-V GPUs;Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 3;2023-03-25
3. RVSDG;ACM Transactions on Embedded Computing Systems;2020-11-30
4. Partial control-flow linearization;ACM SIGPLAN Notices;2018-12-02
5. Partial control-flow linearization;Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation;2018-06-11