[mlir][sparse] Refactor the convert operator conversion to support codegen for the...
authorbixia1 <bixia@google.com>
Fri, 21 Oct 2022 15:25:45 +0000 (08:25 -0700)
committerbixia1 <bixia@google.com>
Fri, 21 Oct 2022 15:52:47 +0000 (08:52 -0700)
commitb056d0bb691134c01e426851ab8217e2cdb573e2
tree1371dad0223666280e278573604bf5652f54fa4c
parentd4650d0938e290ca9d6544d6b07da2fb7156762d
[mlir][sparse] Refactor the convert operator conversion to support codegen for the operator.

Outline the code that generates the loop structure to iterate over a dense
tensor or a sparse constant to genDenseTensorOrSparseConstantIterLoop.

Move a few routines to CodegenUtils for sharing.

Reviewed By: wrengr

Differential Revision: https://reviews.llvm.org/D136210
mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.cpp
mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.h
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
mlir/test/Dialect/SparseTensor/convert_dense2sparse.mlir