[Mlir-commits] [mlir] [mlir][sparse] Fix memory leaks (part 4) (PR #85729)

Yinying Li llvmlistbot at llvm.org
Tue Mar 19 14:57:53 PDT 2024


================
@@ -279,6 +279,31 @@ module {
     %si = tensor.extract %li[] : tensor<i64>
     vector.print %si : i64
 
+    // TODO: This check is no longer needed once the codegen path uses the
+    // buffer deallocation pass. "dealloc_tensor" turn into a no-op in the
+    // codegen path.
+    %has_runtime = sparse_tensor.has_runtime_library
+    scf.if %has_runtime {
+      // sparse_tensor.assemble copies buffers when running with the runtime
+      // library. Deallocations are needed not needed when running in codgen
----------------
yinying-lisa-li wrote:

Not needed? 

https://github.com/llvm/llvm-project/pull/85729


More information about the Mlir-commits mailing list