You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[LangRef] Clarify semantics of masked vector load/store (#82469)
Basically, these operations are equivalent to a loop that iterates all
elements and then does a `getelementptr` (without `inbounds`!) plus
`load`/`store` only for the masked-on elements.
Copy file name to clipboardExpand all lines: llvm/docs/LangRef.rst
+8-2
Original file line number
Diff line number
Diff line change
@@ -25182,7 +25182,10 @@ Semantics:
25182
25182
""""""""""
25183
25183
25184
25184
The '``llvm.masked.load``' intrinsic is designed for conditional reading of selected vector elements in a single IR operation. It is useful for targets that support vector masked loads 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 load operations.
25185
-
The result of this operation is equivalent to a regular vector load instruction followed by a 'select' between the loaded and the passthru values, predicated on the same mask. However, using this intrinsic prevents exceptions on memory access to masked-off lanes.
25185
+
The result of this operation is equivalent to a regular vector load instruction followed by a 'select' between the loaded and the passthru values, predicated on the same mask, except that the masked-off lanes are not accessed.
25186
+
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).
25187
+
In particular, using this intrinsic prevents exceptions on memory accesses to masked-off lanes.
25188
+
Masked-off lanes are also not considered accessed for the purpose of data races or ``noalias`` constraints.
25186
25189
25187
25190
25188
25191
::
@@ -25224,7 +25227,10 @@ Semantics:
25224
25227
""""""""""
25225
25228
25226
25229
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.
25227
-
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.
25230
+
The result of this operation is equivalent to a load-modify-store sequence, except that the masked-off lanes are not accessed.
25231
+
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).
25232
+
In particular, using this intrinsic prevents exceptions on memory accesses to masked-off lanes.
25233
+
Masked-off lanes are also not considered accessed for the purpose of data races or ``noalias`` constraints.
0 commit comments