[mlir][sparse] add memSizes array to sparse storage format
authorAart Bik <ajcbik@google.com>
Mon, 12 Sep 2022 19:53:07 +0000 (12:53 -0700)
committerAart Bik <ajcbik@google.com>
Mon, 12 Sep 2022 21:04:01 +0000 (14:04 -0700)
commit6607fdf7490c5bf73a8892bc08ed2dba55043ca8
tree7c15586418d8b477d5ae7e680e8b1db2491d8c0e
parent4763200ec95ce6514403176017f29b87757b292a
[mlir][sparse] add memSizes array to sparse storage format

Rationale:
For every dynamic memref (memref<?xtype>), the stored size really
indicates the capacity and the entry in the memSizes indicates
the actual size. This allows us to use memref's as "vectors".

Reviewed By: Peiming

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