[mlir][Vector] Re-define masking semantics in vector.transfer ops
authorDiego Caballero <diegocaballero@google.com>
Wed, 16 Nov 2022 00:43:50 +0000 (00:43 +0000)
committerDiego Caballero <diegocaballero@google.com>
Fri, 18 Nov 2022 01:05:42 +0000 (01:05 +0000)
commit6c59c5cd08c879c9d1cfa653711613244a7c39bf
tree4773078e39225096403962a372f936410a84d1b0
parent46202543c9ba4dd2aca355b3b553ce9caeed9a80
[mlir][Vector] Re-define masking semantics in vector.transfer ops

Masking hasn't been widely used in vector transfer ops and the semantics
of the mask operand were a bit loose. This patch states that the mask
operand in a vector transfer op is applied to the read/write part of the
operation and, therefore, its shape should match the shape of the
elements read/written from/into the memref/tensor regardless of any
permutation/broadcasting also applied by the transfer operation.

Reviewers: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D138079
mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
mlir/include/mlir/Interfaces/VectorInterfaces.h
mlir/include/mlir/Interfaces/VectorInterfaces.td
mlir/lib/Dialect/Vector/IR/VectorOps.cpp
mlir/lib/Dialect/Vector/Transforms/VectorTransferPermutationMapRewritePatterns.cpp
mlir/lib/Interfaces/VectorInterfaces.cpp
mlir/test/Conversion/VectorToSCF/vector-to-scf-mask-and-permutation-map.mlir
mlir/test/Dialect/Vector/ops.mlir
mlir/test/Dialect/Vector/vector-transfer-to-vector-load-store.mlir