[mlir][sparse] Introduce new reduce op
authorJim Kitchen <jim22k@gmail.com>
Fri, 15 Jul 2022 20:26:41 +0000 (15:26 -0500)
committerJim Kitchen <jim22k@gmail.com>
Fri, 15 Jul 2022 20:30:41 +0000 (15:30 -0500)
commit2b8a4d9ce1fc72fc97ef55170a5851b9fbda0889
tree767236e46ac33d7b58575f7fd2deba3f529303c8
parent6ab686eb86fb60ab63750dddd575ac92d8a1f9f9
[mlir][sparse] Introduce new reduce op

A new sparse_tensor operation allows for
custom reduction code to be injected during
linalg.generic lowering for sparse tensors.
An identity value is provided to indicate
the starting value of the reduction. A single
block region is required to contain the
custom reduce computation.

Reviewed by: aartbik

Differential Revision: https://reviews.llvm.org/D128004
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
mlir/test/Dialect/SparseTensor/invalid.mlir
mlir/test/Dialect/SparseTensor/roundtrip.mlir