Skip to content

Commit 9c21fa7

Browse files
committed
clarify semantics of masked vector load/store
1 parent 8bec964 commit 9c21fa7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

llvm/docs/LangRef.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24419,7 +24419,10 @@ Semantics:
2441924419
""""""""""
2442024420

2442124421
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.
24422-
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.
24422+
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.
24423+
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).
24424+
In particular, using this intrinsic prevents exceptions on memory accesses to masked-off lanes.
24425+
Masked-off lanes are also not considered accessed for the purpose of data races or `noalias` constraints.
2442324426

2442424427

2442524428
::
@@ -24461,7 +24464,10 @@ Semantics:
2446124464
""""""""""
2446224465

2446324466
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.
24464-
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.
24467+
The result of this operation is equivalent to a load-modify-store sequence, except that the masked-off lanes are not accessed.
24468+
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).
24469+
In particular, using this intrinsic prevents exceptions on memory accesses to masked-off lanes.
24470+
Masked-off lanes are also not considered accessed for the purpose of data races or `noalias` constraints.
2446524471

2446624472
::
2446724473

0 commit comments

Comments
 (0)