[llvm-dev] Suggested BasicAA improvements

Markus Lavin via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 30 02:07:55 PST 2018


We recently noticed some deficiencies in BasicAA that result in poor scheduling for our downstream VLIW target. It boils down to BasicAA not being able to tell that accesses to %G1 and %G2 below would not alias.

%1 = mul i16 %X, 6
%2 = shl i16 %X, 3
%G1 = getelementptr i16, i16* %base, i16 %1
%G2 = getelementptr i16, i16* %base, i16 %2

In general that would be correct but in the special case where it is known that %X != 0 it seems reasonable to conclude that they cannot alias.

In https://reviews.llvm.org/D55107 (not at all ready, just for discussion) there is an attempt to teach BasicAA about this in the presence of a @llvm.assume on %X.

Now I am curious if adding such additional analysis to BasicAA would be considered a good idea and if so what would be the proper way to integrate it as right now my implementation feels mostly bolted on top of the existing one.

-Markus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181130/a832b34a/attachment.html>


More information about the llvm-dev mailing list