[mlir][sparse] replace stack-based access pattern with dyn-alloc
authorAart Bik <ajcbik@google.com>
Wed, 6 Apr 2022 20:22:08 +0000 (13:22 -0700)
committerAart Bik <ajcbik@google.com>
Thu, 7 Apr 2022 00:10:43 +0000 (17:10 -0700)
commit0b55f94d2bf3b0de027e6e674c99210d20bd8f7b
treecaaaa396cbe00573f8fcef6afcbb3c565eb429e3
parent303c180199b73eb9c2840d05c92afeb9326e2e15
[mlir][sparse] replace stack-based access pattern with dyn-alloc

Rationale:
Allocating the temporary buffers for access pattern expansion on the stack
(using alloca) is a bit too agressive, since it easily runs out of stack space
for large enveloping tensor dimensions. This revision changes the dynamic
allocation of these buffers with explicit alloc/dealloc pairs.

Reviewed By: bixia, wrengr

Differential Revision: https://reviews.llvm.org/D123253
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
mlir/test/Dialect/SparseTensor/conversion.mlir
mlir/test/Dialect/SparseTensor/sparse_expand.mlir [new file with mode: 0644]