[mlir][sparse] add a cursor to sparse storage scheme
authorAart Bik <ajcbik@google.com>
Wed, 26 Oct 2022 22:07:18 +0000 (15:07 -0700)
committerAart Bik <ajcbik@google.com>
Thu, 27 Oct 2022 18:18:50 +0000 (11:18 -0700)
commit80b08b68f219949a6479aeff6a54e3e5129ce7dc
treef8112d46307ec0594cb4d55e777f09e71f68705e
parent846904195bd603628ee3670d7dc0ca84e3e3bba4
[mlir][sparse] add a cursor to sparse storage scheme

This prepare a subsequent revision that will generalize
the insertion code generation. Similar to the support lib,
insertions become much easier to perform with some "cursor"
bookkeeping. Note that we, in the long run, could perhaps
avoid storing the "cursor" permanently and use some
retricted-scope solution (alloca?) instead. However,
that puts harder restrictions on insertion-chain operations,
so for now we follow the more straightforward approach.

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D136800
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
mlir/test/Dialect/SparseTensor/codegen.mlir
mlir/test/Dialect/SparseTensor/invalid.mlir
mlir/test/Dialect/SparseTensor/scf_1_N_conversion.mlir