[PATCH] D158081: [IR] Add writable attribute

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 12:18:21 PDT 2023


nikic added inline comments.


================
Comment at: llvm/docs/LangRef.rst:1540-1541
+
+    In that case, the attribute indicates that the first ``N`` bytes will be
+    (non-atomically) loaded and stored back on entry to the function.
+
----------------
aeubanks wrote:
> is this part necessary? or can we just defer to the next paragraph for what this attribute allows?
I think so. This is the part specifying the actual operational semantics, the rest is just implications. This gives a general answer to some non-obvious questions, such as "if I have two aliasing noalias arguments that are only read inside the function, but one of them is marked writable, is this UB?" to which the answer would be "yes, because writable implies a write on entry, which makes aliasing noalias UB".


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158081/new/

https://reviews.llvm.org/D158081



More information about the llvm-commits mailing list