Reliable Compilation Optimization Phase-ordering Exploration with Reinforcement Learning
Jiang Wu, Xiankai Meng, Jianjun Xu, Haoyu Zhang · 2020
Modern compilers provide a huge number of optional compilation optimization options. Not only the selection of compilation optimization options represents a hard problem to be solved, but also the ordering of the phases is adding further complexity, making it a long standing problem in compilation research. A large number of experiments have shown that different ordering of the phases has varying degrees of influence on the program. Currently, most research focuses on the traditional optimization goals, such as execution speedup and code size optimization. In this paper, we focus on the impact of the phase-ordering on program reliability. We propose a new model with reinforcement learning algorithm A3C for finding the phase order that can improve the reliability of the program. We performed our experiments with LLVM compiler framework, considering 130 LLVM optimization options. The experimental results show that when compared with LLVM standard options and the existing phase-ordering method with genetic algorithm, the phase order found by our model can bring higher reliability gain to the program.