[Mlir-commits] [mlir] 6756484 - [mlir][sparse][bufferization] initialize reduction variable

Aart Bik llvmlistbot at llvm.org
Thu Jul 14 13:58:32 PDT 2022


Author: Aart Bik
Date: 2022-07-14T13:58:23-07:00
New Revision: 67564841cb0c45ad3e5e6456f3223eb672577e79

URL: https://github.com/llvm/llvm-project/commit/67564841cb0c45ad3e5e6456f3223eb672577e79
DIFF: https://github.com/llvm/llvm-project/commit/67564841cb0c45ad3e5e6456f3223eb672577e79.diff

LOG: [mlir][sparse][bufferization] initialize reduction variable

After recent bufferization improvement, this test
started failing due to missed zero initialization.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D129800

Added: 
    

Modified: 
    mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_dot.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_dot.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_dot.mlir
index 49610a5fe9eb7..84c5c0a4ae3bc 100644
--- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_dot.mlir
+++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_dot.mlir
@@ -37,7 +37,9 @@ module {
     //
     // CHECK: 53
     //
-    %x = bufferization.alloc_tensor() : tensor<f32>
+    %t = bufferization.alloc_tensor() : tensor<f32>
+    %z = arith.constant 0.0 : f32
+    %x = tensor.insert %z into %t[] : tensor<f32>
     %0 = call @sparse_dot(%s1, %s2, %x) : (tensor<1024xf32, #SparseVector>,
                                            tensor<1024xf32, #SparseVector>,
                                            tensor<f32>) -> tensor<f32>


        


More information about the Mlir-commits mailing list