[llvm] [LangRef] Clarify pointer capture spec (PR #194647)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 02:53:38 PDT 2026


================
@@ -3683,9 +3683,53 @@ memory before the call, the call may capture two components of the pointer:
     rules <pointeraliasing>`. We further distinguish whether only read accesses
     are allowed, or both reads and writes.
 
+These two cases are discussed in more detail in the following.
+
+Provenance capture
+^^^^^^^^^^^^^^^^^^
+
+If an argument does not capture the provenance the pointer, accesses that are
+based on the argument and are performed after the function returns (or unwinds)
+cause undefined behavior. In the case where only read provenance is captured,
+only stores cause undefined behavior.
+
+More formally, an argument that does not capture provenance will return a new
----------------
antoniofrighetto wrote:

Not sure return reads best here, how about:
```suggestion
More formally, an argument that does not capture provenance effectively provides to the callee a new
```

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


More information about the llvm-commits mailing list