[mlir][sparse] start using size_hint provided in allocation op
authorAart Bik <ajcbik@google.com>
Fri, 3 Feb 2023 21:08:46 +0000 (13:08 -0800)
committerAart Bik <ajcbik@google.com>
Fri, 3 Feb 2023 22:02:41 +0000 (14:02 -0800)
commite2e6e7a6a3a575153e2c3a4782c89c2ca1e09c02
treee9b2d37b340ed6f729c40ff6fb7000a1c9aaa09b
parentbe58d484cb315028049255d9bb29ce2c7bffc983
[mlir][sparse] start using size_hint provided in allocation op

Even though we introduced the size_hint, we never used it.
This is a very first step, using the hint during the codegen path.
Note that we can refine the heuristics. Also, we need to start
adding the hint on all allocation generated for reading tensors,
converting tensors, etc.

Reviewed By: Peiming, bixia

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