Perfect Reconstructability of Control Flow from Demand Dependence Graphs

Author:

Bahmann Helge1,Reissmann Nico2,Jahre Magnus2,Meyer Jan Christian2

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 4 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. 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

2. RVSDG;ACM Transactions on Embedded Computing Systems;2020-11-30

3. Partial control-flow linearization;ACM SIGPLAN Notices;2018-12-02

4. Partial control-flow linearization;Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation;2018-06-11

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3