Skip to content

Commit acf5422

Browse files
committed
clarify semantics of masked vector load/store
1 parent a445474 commit acf5422

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

llvm/docs/LangRef.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -23751,7 +23751,9 @@ Semantics:
2375123751
""""""""""
2375223752

2375323753
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.
23754-
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.
23754+
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.
23755+
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).
23756+
In particular, using this intrinsic prevents exceptions on memory access to masked-off lanes.
2375523757

2375623758

2375723759
::
@@ -23793,7 +23795,9 @@ Semantics:
2379323795
""""""""""
2379423796

2379523797
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.
23796-
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.
23798+
The result of this operation is equivalent to a load-modify-store sequence, except that the masked-off lanes are not accessed.
23799+
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).
23800+
In particular, using this intrinsic prevents exceptions and data races on memory access to masked-off lanes.
2379723801

2379823802
::
2379923803

0 commit comments

Comments
 (0)