@@ -329,7 +329,7 @@ func.func @sparse_dealloc_csr(%arg0: tensor<?x?xf64, #CSR>) {
329329// CHECK: %[[A26:.*]] = sparse_tensor.storage_specifier.set %[[A18]] pos_mem_sz at 1 with %[[A25]] : !sparse_tensor.storage_specifier
330330// CHECK: return %[[A23]], %[[A6]], %[[A8]], %[[A26]] : memref<?xindex>, memref<?xindex>, memref<?xf64>, !sparse_tensor.storage_specifier
331331func.func @sparse_alloc_csc (%arg0: index ) -> tensor <10 x?xf64 , #CSC > {
332- %0 = bufferization.alloc_tensor (%arg0 ) : tensor <10 x?xf64 , #CSC >
332+ %0 = tensor.empty (%arg0 ) : tensor <10 x?xf64 , #CSC >
333333 %1 = sparse_tensor.load %0 : tensor <10 x?xf64 , #CSC >
334334 return %1 : tensor <10 x?xf64 , #CSC >
335335}
@@ -351,24 +351,11 @@ func.func @sparse_alloc_csc(%arg0: index) -> tensor<10x?xf64, #CSC> {
351351// CHECK: %[[A16:.*]] = sparse_tensor.storage_specifier.set %[[A10]] val_mem_sz with %[[A14]] : !sparse_tensor.storage_specifier
352352// CHECK: return %[[A15]], %[[A16]] : memref<?xf64>, !sparse_tensor.storage_specifier
353353func.func @sparse_alloc_3d () -> tensor <10 x20 x30 xf64 , #Dense3D > {
354- %0 = bufferization.alloc_tensor () : tensor <10 x20 x30 xf64 , #Dense3D >
354+ %0 = tensor.empty () : tensor <10 x20 x30 xf64 , #Dense3D >
355355 %1 = sparse_tensor.load %0 : tensor <10 x20 x30 xf64 , #Dense3D >
356356 return %1 : tensor <10 x20 x30 xf64 , #Dense3D >
357357}
358358
359- // CHECK-LABEL: func.func @sparse_alloc_coo_with_size_hint(
360- // CHECK-SAME: %[[HINT:.*]]: index)
361- // CHECK: %[[C2:.*]] = arith.constant 2 : index
362- // CHECK: %[[M2:.*]] = arith.muli %[[HINT]], %c2 : index
363- // CHECK: %[[A1:.*]] = memref.alloc() : memref<2xindex>
364- // CHECK: %[[A2:.*]] = memref.alloc(%[[M2]]) : memref<?xindex>
365- // CHECK: %[[A3:.*]] = memref.alloc(%[[HINT]]) : memref<?xf64>
366- func.func @sparse_alloc_coo_with_size_hint (%arg0: index ) -> tensor <10 x20 xf64 , #Coo > {
367- %0 = bufferization.alloc_tensor () size_hint =%arg0 : tensor <10 x20 xf64 , #Coo >
368- %1 = sparse_tensor.load %0 : tensor <10 x20 xf64 , #Coo >
369- return %1 : tensor <10 x20 xf64 , #Coo >
370- }
371-
372359// CHECK-LABEL: func.func @sparse_expansion1()
373360// CHECK: %[[A:.*]] = memref.alloc() : memref<8xf64>
374361// CHECK: %[[B:.*]] = memref.alloc() : memref<8xi1>
@@ -378,7 +365,7 @@ func.func @sparse_alloc_coo_with_size_hint(%arg0: index) -> tensor<10x20xf64, #C
378365// CHECK-DAG: linalg.fill ins(%{{.*}} : i1) outs(%[[B]] : memref<8xi1>)
379366// CHECK: return %[[D]] : memref<?xindex>
380367func.func @sparse_expansion1 () -> memref <?xindex > {
381- %0 = bufferization.alloc_tensor () : tensor <4 x8 xf64 , #CSR >
368+ %0 = tensor.empty () : tensor <4 x8 xf64 , #CSR >
382369 %values , %filled , %added , %count = sparse_tensor.expand %0
383370 : tensor <4 x8 xf64 , #CSR > to memref <?xf64 >, memref <?xi1 >, memref <?xindex >
384371 return %added : memref <?xindex >
@@ -393,7 +380,7 @@ func.func @sparse_expansion1() -> memref<?xindex> {
393380// CHECK-DAG: linalg.fill ins(%{{.*}} : i1) outs(%[[B]] : memref<4xi1>)
394381// CHECK: return %[[D]] : memref<?xindex>
395382func.func @sparse_expansion2 () -> memref <?xindex > {
396- %0 = bufferization.alloc_tensor () : tensor <4 x8 xf64 , #CSC >
383+ %0 = tensor.empty () : tensor <4 x8 xf64 , #CSC >
397384 %values , %filled , %added , %count = sparse_tensor.expand %0
398385 : tensor <4 x8 xf64 , #CSC > to memref <?xf64 >, memref <?xi1 >, memref <?xindex >
399386 return %added : memref <?xindex >
@@ -409,7 +396,7 @@ func.func @sparse_expansion2() -> memref<?xindex> {
409396// CHECK: linalg.fill ins(%{{.*}} : i1) outs(%[[B]] : memref<?xi1>)
410397// CHECK: return %[[D]] : memref<?xindex>
411398func.func @sparse_expansion3 (%arg0: index , %arg1: index ) -> memref <?xindex > {
412- %0 = bufferization.alloc_tensor (%arg0 , %arg1 ) : tensor <?x?xf64 , #CSC >
399+ %0 = tensor.empty (%arg0 , %arg1 ) : tensor <?x?xf64 , #CSC >
413400 %values , %filled , %added , %count = sparse_tensor.expand %0
414401 : tensor <?x?xf64 , #CSC > to memref <?xf64 >, memref <?xi1 >, memref <?xindex >
415402 return %added : memref <?xindex >
0 commit comments