aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp
diff options
context:
space:
mode:
authorMatthias Springer <me@m-sp.org>2024-03-15 13:35:48 +0900
committerGitHub <noreply@github.com>2024-03-15 13:35:48 +0900
commite8e8df4c1bf97f0674b2387175cdeb251a4e0d9c (patch)
treefd07c13e0b4a2ccf33bbd4c9baad22aa3becaec9 /llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp
parent5124eedd357b75a96f695c20ebad427b61741abc (diff)
downloadllvm-e8e8df4c1bf97f0674b2387175cdeb251a4e0d9c.zip
llvm-e8e8df4c1bf97f0674b2387175cdeb251a4e0d9c.tar.gz
llvm-e8e8df4c1bf97f0674b2387175cdeb251a4e0d9c.tar.bz2
[mlir][sparse] Add `has_runtime_library` test op (#85355)
This commit adds a new test-only op: `sparse_tensor.has_runtime_library`. The op returns "1" if the sparse compiler runs in runtime library mode. This op is useful for writing test cases that require different IR depending on whether the sparse compiler runs in runtime library or codegen mode. This commit fixes a memory leak in `sparse_pack_d.mlir`. This test case uses `sparse_tensor.assemble` to create a sparse tensor SSA value from existing buffers. This runtime library reallocates+copies the existing buffers; the codegen path does not. Therefore, the test requires additional deallocations when running in runtime library mode. Alternatives considered: - Make the codegen path allocate. "Codegen" is the "default" compilation mode and it is handling `sparse_tensor.assemble` correctly. The issue is with the runtime library path, which should not allocate. Therefore, it is better to put a workaround in the runtime library path than to work around the issue with a new flag in the codegen path. - Add a `sparse_tensor.runtime_only` attribute to `bufferization.dealloc_tensor`. Verifying that the attribute can only be attached to `bufferization.dealloc_tensor` may introduce an unwanted dependency of `MLIRSparseTensorDialect` on `MLIRBufferizationDialect`.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp')
0 files changed, 0 insertions, 0 deletions