[MLIR] Extend vector.gather to accept tensor as base
authorJerry Wu <cheyuw@google.com>
Tue, 9 Aug 2022 18:19:05 +0000 (11:19 -0700)
committerHanhan Wang <hanchung@google.com>
Tue, 9 Aug 2022 18:19:16 +0000 (11:19 -0700)
commit66c2b76846246fcd1df31e1928b0df44a8fe43e1
tree59a11070a1dd543caa570e13fbdb0df5302de030
parent3597727fa7ff104bb0f6e39a71900960b87144df
[MLIR] Extend vector.gather to accept tensor as base

In addition to memref, accept ranked tensor as the base operand of vector.gather, similar to vector.trasnfer_read.

This will allow us to vectorize noncontiguous tensor.extract into vector.gather. Full discussion can be found here: https://github.com/iree-org/iree/issues/9198

Reviewed By: hanchung, dcaballe

Differential Revision: https://reviews.llvm.org/D130097
mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
mlir/lib/Dialect/Vector/IR/VectorOps.cpp
mlir/lib/Dialect/Vector/Transforms/BufferizableOpInterfaceImpl.cpp
mlir/test/Dialect/Vector/bufferize.mlir
mlir/test/Dialect/Vector/ops.mlir