An Abstract Interpretation for SPMD Divergence on Reducible Control Flow Graphs
Vectorizing compilers employ divergence analysis to detect at which program point a specific variable is uniform, i.e. has the same value on all SIMD threads that execute this program point. They exploit uniformity to retain branching to counter branch divergence and defer computations to scalar processor units.
Divergence is a hyper-property and closely related to non-interference and binding time. There exist several divergence, binding time, and non-interference analyses already but they either sacrifice precision or make significant restrictions to the syntactical structure of the program in order to achieve soundness.
In this paper, we present the first abstract interpretation for uniformity that is general enough to be applicable to reducible CFGs and, at the same time, more precise than other analyses that achieve at least the same generality.
Our analysis comes with a correctness proof that is to a large part mechanized in Coq. Our experimental evaluation shows that the compile time and the precision of our analysis is on par with LLVM’s default divergence analysis that is only sound on more restricted CFGs. At the same time, our analysis is faster, achieves better precision and therefore enables faster vectorized programs, than a state-of-the-art non-interference analysis that is sound at least as general as our analysis.