[PATCH] D20206: GlobalsAA: Don't assume that intrinsics can't access global variables

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Thu May 12 09:32:36 PDT 2016


tstellarAMD added a comment.

In http://reviews.llvm.org/D20206#428444, @jmolloy wrote:

> I'm not sure about this. Does the barrier intrinsic actually access memory? Is that how we've modelled it? (as clobbering everything?)


The barrier intrinsic does not actually access memory.  It is more like a memfence, and in order to handle it in an optimal way, we would need to add a memfence/nomfence attribute as described here: https://groups.google.com/forum/#!msg/llvm-dev/KRBnfuQkLNA/8TH5Mb_t_xcJ

However, as I understand, modelling it as clobbering everything is conservatively correct, since it will prevent the compiler from moving loads/stores across it.

> This seems like a more general problem then something unique to GlobalsAA.


The test case passes with the other alias analysis pass that I tried, and I grep'd through those pass for 'Intrinsic' and didn't really find any special handling applied to all intrinsics.  I'm not sure which other kinds of passes might assume that intrinsics don't access global variables.


http://reviews.llvm.org/D20206





More information about the llvm-commits mailing list