[PATCH] D16986: [LICM] Don't assert on volatile accesses

Ed Baunton via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 8 08:51:04 PST 2016


edbaunton added a subscriber: edbaunton.
edbaunton added a comment.

Thanks Matt.

After I created this patch, I actually did some more investigation with Nuno Lopes where we discovered that there is a more subtle bug seemingly going on with the alias analysis that occurs in tdaa.

Running the alias analysis without tdaa produces 2 alias sets, while with tdaa it (seemingly erroneously) produces a third alias set.

The upshot is, that the AST that is checked a few lines up in this file returns `isVolatile` as false because it is checking a third set.

I spent a few hours yesterday trying to track how this magical third set gets produced in the tdaa code and the AliasAnalysis code in general but couldn't get to the bottom of it.

As it is, this patch *I think* will fix the assertion at hand in a relatively safe way: the `isSimple` already checks `isVolatile` and bails the optimisation if that is the case (rather than assertion).

The full fix would be to adjust tdaa to stop producing this third spurious alias set (if that is the case).


http://reviews.llvm.org/D16986





More information about the llvm-commits mailing list