[mlir][tensor] Add gather/scatter op definitions to the tensor dialect.
authorNicolas Vasilache <nicolas.vasilache@gmail.com>
Thu, 21 Jul 2022 11:38:46 +0000 (04:38 -0700)
committerNicolas Vasilache <nicolas.vasilache@gmail.com>
Mon, 5 Sep 2022 09:02:22 +0000 (02:02 -0700)
commitd2613d5bb5dca0624833e4747f67db6fe3236ce8
treec6caa592677f65cdf98b463220c05c845adaea73
parent5de4d97a00b2a5d710892e96d77810784fd2cd5c
[mlir][tensor] Add gather/scatter op definitions to the tensor dialect.

Gather/Scatter are examined from first principles in light of our recent progress on tensor-based codegen
and in-place bufferization.

In the future, lowering of these abstractions to operate **inplace** on buffers
will likely require a more powerful buffer representation than strided memref.

General context: https://discourse.llvm.org/t/rfc-structured-codegen-beyond-rectangular-arrays/64707
Relevant TL;DR parts of the proposal:
- gather: https://discourse.llvm.org/t/rfc-structured-codegen-beyond-rectangular-arrays/64707#proposal-gatherop-and-friends-10
- need for more expressive types: https://discourse.llvm.org/t/rfc-structured-codegen-beyond-rectangular-arrays/64707#proposal-bufferization-copy-view-and-the-need-for-more-expressive-types-12
- jagged buffer discussion: https://discourse.llvm.org/t/rfc-structured-codegen-beyond-rectangular-arrays/64707#proposal-first-class-jagged-buffer-13

Differential Revision: https://reviews.llvm.org/D130348
mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td
mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
mlir/test/Dialect/Tensor/invalid.mlir
mlir/test/Dialect/Tensor/ops.mlir