[mlir][sparse] fix a bug in UnpackOp converter.
authorPeiming Liu <peiming@google.com>
Wed, 15 Feb 2023 02:18:54 +0000 (02:18 +0000)
committerPeiming Liu <peiming@google.com>
Wed, 15 Feb 2023 02:36:00 +0000 (02:36 +0000)
commit81cb70e46ea1edb16fe97b5e44e3d710d64b2dbb
treeb59617009bb36719419398487711abbcd0f74bd5
parentdd31a3b3a526c0fcbbc0f09d065670af2fbab861
[mlir][sparse] fix a bug in UnpackOp converter.

UnpackOp Converter used to create reallocOp unconditionally, but it might cause issue when the requested memory size is smaller than the actually storage.

Reviewed By: aartbik

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