[PATCH] D109647: [AA] Consider globalmemonly in getModRefInfo()
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 11 11:58:19 PDT 2021
nikic requested changes to this revision.
nikic added inline comments.
This revision now requires changes to proceed.
================
Comment at: llvm/lib/Analysis/AliasAnalysis.cpp:283
+ getUnderlyingObject(Loc.Ptr->stripPointerCastsForAliasAnalysis());
+ if (!isa<GlobalValue>(V1)) {
+ return ModRefInfo::NoModRef;
----------------
Just because the underlying object is not a global value, doesn't mean that it can't be based on one -- e.g. imagine a global being passed to a function argument. getUnderlyingObject() will just give you the argument in that case, which may still alias with a global.
At the very least, you need to check for isIdentifiedObject() here. However, even that may be insufficient, as noalias arguments are identified objects, but I don't think you can apply this optimization to them (a noalias argument could point to a global, and a globalmemonly function could access the global through a passed-on noalias argument).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109647/new/
https://reviews.llvm.org/D109647
More information about the llvm-commits
mailing list