[mlir][vector] Clarify OOB semantics for `gather` and `scatter`
authorJakub Kuderski <kubak@google.com>
Mon, 13 Mar 2023 17:58:11 +0000 (13:58 -0400)
committerJakub Kuderski <kubak@google.com>
Mon, 13 Mar 2023 17:58:12 +0000 (13:58 -0400)
commit4e4226dc362f851ab57b8169041b722128e23a66
tree21803c2cfe90da838d16a1bde684d95a010812fa
parent56464ba865b7df5bf3edb9be7dc3b6a0fbe21e21
[mlir][vector] Clarify OOB semantics for `gather` and `scatter`

Reword the vector gather and scatter op description to make it
well-defined to have out-of-bounds indices when the corresponding mask
bits are false.

Update the code sample to avoid relying on C UB semantics to provide
informal semantics for vector.gather.

This change should be consistent with the existing interpretation of the
semantics in the codebase.

Issue: https://github.com/llvm/llvm-project/issues/60905

Reviewed By: dcaballe

Differential Revision: https://reviews.llvm.org/D145824
mlir/include/mlir/Dialect/Vector/IR/VectorOps.td