@@ -329,7 +329,7 @@ func.func @sparse_dealloc_csr(%arg0: tensor<?x?xf64, #CSR>) {
329
329
// CHECK: %[[A26:.*]] = sparse_tensor.storage_specifier.set %[[A18]] pos_mem_sz at 1 with %[[A25]] : !sparse_tensor.storage_specifier
330
330
// CHECK: return %[[A23]], %[[A6]], %[[A8]], %[[A26]] : memref<?xindex>, memref<?xindex>, memref<?xf64>, !sparse_tensor.storage_specifier
331
331
func.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 >
333
333
%1 = sparse_tensor.load %0 : tensor <10 x?xf64 , #CSC >
334
334
return %1 : tensor <10 x?xf64 , #CSC >
335
335
}
@@ -351,24 +351,11 @@ func.func @sparse_alloc_csc(%arg0: index) -> tensor<10x?xf64, #CSC> {
351
351
// CHECK: %[[A16:.*]] = sparse_tensor.storage_specifier.set %[[A10]] val_mem_sz with %[[A14]] : !sparse_tensor.storage_specifier
352
352
// CHECK: return %[[A15]], %[[A16]] : memref<?xf64>, !sparse_tensor.storage_specifier
353
353
func.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 >
355
355
%1 = sparse_tensor.load %0 : tensor <10 x20 x30 xf64 , #Dense3D >
356
356
return %1 : tensor <10 x20 x30 xf64 , #Dense3D >
357
357
}
358
358
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
-
372
359
// CHECK-LABEL: func.func @sparse_expansion1()
373
360
// CHECK: %[[A:.*]] = memref.alloc() : memref<8xf64>
374
361
// CHECK: %[[B:.*]] = memref.alloc() : memref<8xi1>
@@ -378,7 +365,7 @@ func.func @sparse_alloc_coo_with_size_hint(%arg0: index) -> tensor<10x20xf64, #C
378
365
// CHECK-DAG: linalg.fill ins(%{{.*}} : i1) outs(%[[B]] : memref<8xi1>)
379
366
// CHECK: return %[[D]] : memref<?xindex>
380
367
func.func @sparse_expansion1 () -> memref <?xindex > {
381
- %0 = bufferization.alloc_tensor () : tensor <4 x8 xf64 , #CSR >
368
+ %0 = tensor.empty () : tensor <4 x8 xf64 , #CSR >
382
369
%values , %filled , %added , %count = sparse_tensor.expand %0
383
370
: tensor <4 x8 xf64 , #CSR > to memref <?xf64 >, memref <?xi1 >, memref <?xindex >
384
371
return %added : memref <?xindex >
@@ -393,7 +380,7 @@ func.func @sparse_expansion1() -> memref<?xindex> {
393
380
// CHECK-DAG: linalg.fill ins(%{{.*}} : i1) outs(%[[B]] : memref<4xi1>)
394
381
// CHECK: return %[[D]] : memref<?xindex>
395
382
func.func @sparse_expansion2 () -> memref <?xindex > {
396
- %0 = bufferization.alloc_tensor () : tensor <4 x8 xf64 , #CSC >
383
+ %0 = tensor.empty () : tensor <4 x8 xf64 , #CSC >
397
384
%values , %filled , %added , %count = sparse_tensor.expand %0
398
385
: tensor <4 x8 xf64 , #CSC > to memref <?xf64 >, memref <?xi1 >, memref <?xindex >
399
386
return %added : memref <?xindex >
@@ -409,7 +396,7 @@ func.func @sparse_expansion2() -> memref<?xindex> {
409
396
// CHECK: linalg.fill ins(%{{.*}} : i1) outs(%[[B]] : memref<?xi1>)
410
397
// CHECK: return %[[D]] : memref<?xindex>
411
398
func.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 >
413
400
%values , %filled , %added , %count = sparse_tensor.expand %0
414
401
: tensor <?x?xf64 , #CSC > to memref <?xf64 >, memref <?xi1 >, memref <?xindex >
415
402
return %added : memref <?xindex >
0 commit comments