Pointer disambiguation via strict inequalities

Maroua Maalej, Vitor Paisante, Pedro Ramos, Laure Gonnord, Fernando Magno Quintao Pereira
2017 2017 IEEE/ACM International Symposium on Code Generation and Optimization (CGO)  
The design and implementation of static analyses that disambiguate pointers has been a focus of research since the early days of compiler construction. One of the challenges that arise in this context is the analysis of languages that support pointer arithmetics, such as C, C++ and assembly dialects. This paper contributes to solve this challenge. We start from an obvious, yet unexplored, observation: if a pointer is strictly less than another, they cannot alias. Motivated by this remark, we
more » ... abstract interpretation to build strict less-than relations between pointers. We construct a program representation that bestows the Static Single Information (SSI) property onto our dataflow analysis. SSI gives us a sparse algorithm, whose correctness is easy to ensure. We have implemented our static analysis in LLVM. It runs in time linear on the number of program variables, and, depending on the benchmark, it can be as much as six times more precise than the pointer disambiguation techniques already in place in that compiler.
doi:10.1109/cgo.2017.7863735 fatcat:t5tjdttlkrfkhfxocb3wejr43e