Leveraging Alias Analysis Without Porting
Alias Analysis (AA) is essential for compile-time optimization. However, the AA implemented in mainstream compilers such as LLVM is fundamentally elementary and often suffers from low accuracy; about 85% of pointer pairs are conservatively classified as May-Alias. Additionally, LLVM’s support for inter-procedural AA is limited. State-of-the-art AA tools, such as Static Value-Flow Analysis Framework (SVF), offer higher accuracy and handle inter-procedural cases, but integrating these modern analyses into production compilers proves challenging due to compiler version mismatches, causing portability and upgrade difficulties. Our insight is based on the fact that the compiler Intermediate Representation (IR) changes infrequently and remains consistent across multiple compiler versions. By leveraging this, we can encode results from external alias analyses (even those implemented on older compiler versions) and then read these analysis outcomes in newer compiler versions. We propose AADB, which decouples SVF and LLVM, making the more recent LLVM version operate with older SVF versions. By integrating precise AA results in SLP pass, we obtained an average (geomean) improvement of 0.6% and a maximum of 3.6% in x264 on SPEC CPU 2017 on Intel I7 13700K over the compiler baseline.