[all-commits] [llvm/llvm-project] 2c3326: [mlir][sparse] Add lowering for unary and binary ops
Jim Kitchen via All-commits
all-commits at lists.llvm.org
Tue May 3 13:51:06 PDT 2022
Author: Jim Kitchen <jim22k at gmail.com>
Date: 2022-05-03 (Tue, 03 May 2022)
[mlir][sparse] Add lowering for unary and binary ops
Adding lowering for Unary and Binary required several changes due to
their unique nature of containing custom code for different "regions"
of the sparse structure being operated on. Along with a Kind, a pointer
to the Operation is passed along to be merged once the lattice
structure is figured out.
The original operation is maintained, as it is required for subsequent
lattice decisions. However, sparse_tensor.binary has some branches
are considered as fully handled and therefore are marked with as
kBinaryBranch to distinguish them.
A unique aspect of the custom code is that sometimes the desired result
is no result at all -- i.e. a user wants overlapping sparse entries to
become empty in the output. The solution to this is to return an
uninitialized Value(), which is checked and handled elsewhere in the
code and results in nothing being written to the output tensor for that
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D123057
More information about the All-commits