Mainstream compilers perform a multitude of analyses and optimizations on the given input program. Each analysis pass may generate a program-abstraction. Each optimization pass is typically composed of multiple alternating phases of inspection of program-abstractions and transformations of the program. Upon transformation of a program, the program-abstractions generated by various analysis passes may become inconsistent with the program's modified state. Consequently, the downstream transformations may be considered unsafe until the relevant program-abstractions are stabilized, i.e., the program-abstractions are 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 optimization writer to deal with the complex task of identifying the relevant program-abstractions to stabilize, the points where the stabilization is to be performed, and the exact procedure of stabilization. Similarly, adding new analyses becomes a challenge as one has to understand which all existing optimizations may impact the newly added program-abstractions. In this paper, we address these challenges by providing the design and implementation of a novel generalized compiler-design framework called Homeostasis. Homeostasis can be used to guarantee the trigger of automated stabilization of relevant program-abstractions under every possible transformation of the program. Interestingly, Homeostasis provides such guarantees not only for the existing optimization passes but also for any future optimizations that may be added to the framework. We have implemented our proposed ideas in the IMOP compiler framework, for OpenMP C programs. We present an evaluation which shows that Homeostasis is efficient and easy to use.
翻译:主流编译器对给定的输入程序进行多种分析和优化。 每个分析通道都可能生成程序吸附。 每个优化通道通常由程序吸附和程序的转换的多个交替检查阶段组成。 程序转换后, 各种分析通道产生的程序吸附行动可能与程序的修改状态不相符。 因此, 下游转换可能被视为不安全, 直到相关的程序吸附行动稳定下来, 即程序吸附行动与修改的程序保持一致。 一般来说, 现有的编译框架并不自动稳定程序, 而通常由程序吸附和程序的转换的多个交替阶段组成。 程序转换后, 各个分析器产生的程序- 程序吸附程序可能会与程序修改的状态不符。 类似地, 添加新的分析将成为一个挑战, 因为人们必须理解的是, 所有现有的优化都可能影响到新添加的程序- 。 在本文中, 我们处理这些挑战的方式是, 提供当前通用的快速编译- 程序格式化的快速编译框架的设计和实施, 也意味着, 内部编译器程序下的任何系统化程序 都能够提供当前版本的系统化 。