[llvm] [mlir] [IR][ModRef] Introduce `errno` memory location (PR #120783)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 10 07:39:08 PST 2025


================
@@ -126,8 +126,21 @@ static void addLocAccess(MemoryEffects &ME, const MemoryLocation &Loc,
     return;
   if (isa<Argument>(UO)) {
     ME |= MemoryEffects::argMemOnly(MR);
+    if (Loc.Size <= LocationSize::precise(sizeof(int)))
+      ME |= MemoryEffects::errnoMemOnly(MR);
----------------
antoniofrighetto wrote:

Dropped the check for now. I'm slightly unsure if it'd still make sense to keep it while examining formal parameters within the call-site (hence, from caller perspective)? Thinking more on checking the memory location size, say, e.g., a memory location possibly refers to a pointer to pointer: this case would be incorrectly excluded from the above check, correct?

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


More information about the llvm-commits mailing list