Compiler phase ordering has a strong effect on program performance. Finding an effective sequence of passes is still a difficult task because the search space is large and execution time, code size and energy consumption often conflict. Existing methods usually depend on fixed optimization levels or limited heuristics and they rarely handle multiple objectives at the same time. This paper presents MileStone, a modular framework that models compiler phase ordering as a multi-objective optimization problem. MileStone represents programs as graphs, predicts performance metrics with a graph neural network and explores pass sequences with a reinforcement-learning agent that follows user constraints. The framework also builds a self-evolving database that collects compiler transformations and improves prediction quality. Experiments on standard benchmarks show that MileStone finds strong Pareto-optimal solutions, meets energy limits more accurately than LLVM optimization levels and other related techniques. MileStone reduces execution time by up to 45 percent under the same energy budget using a multi-objective approach. The results show that MileStone provides an effective and scalable solution for multi-objective compiler phase ordering.
翻译:编译器阶段排序对程序性能有重要影响。由于搜索空间庞大,且执行时间、代码大小和能耗常常相互冲突,寻找有效的阶段序列仍是一项困难的任务。现有方法通常依赖固定的优化级别或有限的启发式策略,且很少同时处理多个优化目标。本文提出MileStone,一个模块化框架,将编译器阶段排序建模为多目标优化问题。MileStone以图形式表示程序,使用图神经网络预测性能指标,并通过遵循用户约束的强化学习智能体探索阶段序列。该框架还构建了一个自进化数据库,用于收集编译器变换并改进预测质量。在标准基准测试上的实验表明,MileStone能够找到强帕累托最优解,且相较于LLVM优化级别及其他相关技术,能更精确地满足能耗限制。在多目标方法下,相同能耗预算内,MileStone最多可将执行时间降低45%。结果表明,MileStone为多目标编译器阶段排序提供了一种有效且可扩展的解决方案。