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

Eli Friedman llvmlistbot at llvm.org
Wed Feb 5 10:50:05 PST 2025


================
@@ -82,7 +82,7 @@ define void @test_store(ptr %p) {
 
 @G = external global ptr
 define i8 @test_store_capture(ptr %p) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: read, inaccessiblemem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: read, inaccessiblemem: none, errnomem: none)
----------------
efriedma-quic wrote:

The argument `%p` to `test_store_capture` can point to errno.

You can't assume all accesses to errno are exactly 32 bits wide.  (They usually will be, but if, for example, someone writes `(char)errno`, we'll narrow the load.)  It's probably okay to assume accesses wider than 32 bits don't access errno...

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


More information about the Mlir-commits mailing list