[llvm] clarify semantics of masked vector load/store (PR #82469)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 20:32:21 PDT 2024


================
@@ -24461,7 +24464,10 @@ Semantics:
 """"""""""
 
 The '``llvm.masked.store``' intrinsics is designed for conditional writing of selected vector elements in a single IR operation. It is useful for targets that support vector masked store and allows vectorizing predicated basic blocks on these targets. Other targets may support this intrinsic differently, for example by lowering it into a sequence of branches that guard scalar store operations.
-The result of this operation is equivalent to a load-modify-store sequence. However, using this intrinsic prevents exceptions and data races on memory access to masked-off lanes.
+The result of this operation is equivalent to a load-modify-store sequence, except that the masked-off lanes are not accessed.
+Only the masked-on lanes of the vector need to be inbounds of an allocation (but all these lanes need to be inbounds of the same allocation).
+In particular, using this intrinsic prevents exceptions on memory accesses to masked-off lanes.
+Masked-off lanes are also not considered accessed for the purpose of data races or `noalias` constraints.
----------------
nikic wrote:

```suggestion
Masked-off lanes are also not considered accessed for the purpose of data races or ``noalias`` constraints.
```

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


More information about the llvm-commits mailing list