一句话:反向研究别名分析:系统性移除(而非精化)别名信息,发现其在 LLVM 中影响甚微,仅少数查询真正关键。
别名分析是编译器的基础分析,长期研究都假设更精确的别名信息能带来更好的优化,但近期工作显示其性能收益甚微甚至为负。本文转换视角,从"精化"转向"放松"别名信息,即主动删除信息,以系统性地检验上述假设。作者在最先进的编译器 LLVM 上运行 SPEC CPU 2017 基准套件,通过整体移除与随机放松别名信息来观察最终二进制的变化。结果显示三点:(1) 总体影响很小,完全移除别名分析对最终二进制几乎没有影响;(2) 有影响力的查询很少,仅约 3% 的别名信息会导致最终二进制发生改变;(3) 存在未释放的潜力,随机放松在某些用例中可将执行时间降低 21%、二进制大小降低 39%,说明编译器并未充分利用已有的别名信息。作者据此主张,未来研究不应只追求别名分析整体精度的提升,还应探索如何定位与精化最相关的查询,以及如何更有效地利用别名信息。
Alias analysis is a fundamental compiler analysis that powers numerous optimizations. While research has focused on deriving more precise alias information assuming that the compiler will optimize better, recent work shows a negligible, or even negative, performance impact of alias information. In this work, we shift the perspective from refining to relaxing alias information, i.e. , removing information, to complement existing work and challenge that assumption systematically. Our study on a state-of-the-art compiler, LLVM, running the SPEC CPU 2017 benchmark suite, shows (1) a small overall impact —removing alias analysis entirely has little impact on the final binaries, (2) few influential queries —only a small fraction, namely ∼3%, of the alias information leads to changes in the final binary, and (3) lost potential —random relaxations can reduce execution time by 21% and binary size by 39% for certain cases, suggesting that compilers could better utilize alias information. Through this work, we advocate that it is beneficial for future research to avoid simply refining the general precision of alias analysis, but also to explore how to find and refine the most relevant queries, and how to more effectively utilize alias information.
@article{paperbot3072,
title = {Relaxing Alias Analysis: Exploring the Unexplored Space},
author = {Michel Weber and Theodoros Theodoridis and Zhendong Su},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {PLDI},
year = {2025},
doi = {10.1145/3729254}
}