[llvm] [AA] Refine ModRefInfo taking into account `errnomem` location (PR #157495)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 14 13:46:55 PDT 2025


================
@@ -951,7 +951,8 @@ ModRefInfo BasicAAResult::getModRefInfo(const CallBase *Call,
     return ModRefInfo::NoModRef;
 
   ModRefInfo ArgMR = ME.getModRef(IRMemLocation::ArgMem);
-  ModRefInfo OtherMR = ME.getWithoutLoc(IRMemLocation::ArgMem).getModRef();
+  ModRefInfo ErrnoMR = ME.getModRef(IRMemLocation::ErrnoMem);
+  ModRefInfo OtherMR = ME.getModRef(IRMemLocation::Other);
----------------
nikic wrote:

Because a MemoryLocation cannot alias inaccessible memory. (Note that it is already explicitly excluded a few lines above.)

https://github.com/llvm/llvm-project/pull/157495


More information about the llvm-commits mailing list