一句话:提出自稳定编译器框架 Homeostasis,自动捕获变换并触发程序抽象稳定化,免去遍写者手动处理。
主流编译器在优化中依赖指向分析等程序抽象进行多阶段检查与变换;程序被修改后,抽象可能不一致,若不及时稳定化(失效或同步),后续检查与变换的正确性无法保证。现有框架通常不自动稳定化,而将识别相关抽象、稳定化位置与流程留给遍写者。本文提出编译器设计框架 Homeostasis:自动捕获每个变换阶段对程序的所有修改,并据此在需要时触发稳定化,给出形式化描述与正确性证明,并在面向 OpenMP C 的 IMOP 中实现。作者实现一组标准数据流遍及去除冗余 barrier 的复杂优化;这些优化无需额外稳定化代码。评估表明其高效易用。
Mainstream compilers perform a multitude of analyses and optimizations on the given input program. Each analysis (such as points-to analysis) may generate a program-abstraction (such as points-to graph). Each optimization is typically composed of multiple alternating phases of inspection of such program-abstractions and transformations of the program. Upon transformation of a program, the program-abstractions generated by various analyses may become inconsistent with the modified program. Consequently, the correctness of the downstream inspection (and consequent transformation) phases cannot be ensured until the relevant program-abstractions are stabilized ; that is, the program-abstractions are either invalidated or made consistent with the modified program. In general, the existing compiler frameworks do not perform automated stabilization of the program-abstractions and instead leave it to the compiler pass writers to deal with the complex task of identifying the relevant program-abstractions to be stabilized, the points where the stabilization is to be performed, and the exact procedure of stabilization. In this article, we address these challenges by providing the design and implementation of a novel compiler-design framework called Homeostasis . Homeostasis automatically captures all the program changes performed by each transformation phase, and later, triggers the required stabilization using the captured information, if needed. We also provide a formal description of Homeostasis and a correctness proof thereof. To assess the feasibility of using Homeostasis in compilers of parallel programs, we have implemented our proposed idea in IMOP, a compiler framework for OpenMP C programs. Furthermore, to illustrate the benefits of using Homeostasis , we have implemented a set of standard data-flow passes, and a set of involved optimizations that are used to remove redundant barriers in OpenMP C programs. Implementations of none of these optimizations in IMOP required any additional lines of code for stabilization of the program-abstractions. We present an evaluation in the context of these optimizations and analyses, which demonstrates that Homeostasis is efficient and easy to use.
@article{paperbot2675,
title = {Homeostasis: Design and Implementation of a Self-Stabilizing Compiler},
author = {Aman Nougrahiya and V. Krishna Nandivada},
journal = {ACM Transactions on Programming Languages and Systems},
volume = {46},
number = {2},
year = {2024},
doi = {10.1145/3649308}
}