Skip to content

Commit 0cbaff8

Browse files
authored
[mlir][sparse] cleanup conversion test (llvm#70356)
Various TODOs had been added that actually removed the actual test. This puts the CHECK test backs and removes the TODOs that have no immediate plans.
1 parent 88d00a6 commit 0cbaff8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

mlir/test/Dialect/SparseTensor/convert_sparse2sparse.mlir

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,24 @@ func.func @sparse_nop_convert(%arg0: tensor<64xf32, #SparseVector>) -> tensor<64
4141
}
4242

4343
// CHECK-LABEL: func.func @sparse_hidden_nop_cast
44-
// TODO: The following convert should be a cast instead.
45-
// CHECK: sparse_tensor.convert
46-
// CHECK: return
44+
// CHECK-NEXT: sparse_tensor.convert
45+
// CHECK-NEXT: return
4746
func.func @sparse_hidden_nop_cast(%arg0: tensor<32xf32, #SparseVector>) -> tensor<?xf32, #SparseVector> {
4847
%0 = sparse_tensor.convert %arg0 : tensor<32xf32, #SparseVector> to tensor<?xf32, #SparseVector>
4948
return %0 : tensor<?xf32, #SparseVector>
5049
}
5150

5251
// CHECK-LABEL: func.func @sparse_convert_1d_ss(
53-
// TODO: libgen path need to support efficient format conversion (e.g., 32 bit pos -> 64 bit pos).
54-
// Maybe we should use a different operator as well to be clear.
52+
// CHECK-NEXT: sparse_tensor.convert
53+
// CHECK-NEXT: return
5554
func.func @sparse_convert_1d_ss(%arg0: tensor<?xf32, #SparseVector64>) -> tensor<?xf32, #SparseVector32> {
5655
%0 = sparse_tensor.convert %arg0 : tensor<?xf32, #SparseVector64> to tensor<?xf32, #SparseVector32>
5756
return %0 : tensor<?xf32, #SparseVector32>
5857
}
5958

6059
// CHECK-LABEL: func.func @sparse_convert(
61-
// TODO: libgen path need to support efficient format conversion (e.g., 32 bit pos -> 64 bit pos).
62-
// Maybe we should use a different operator as well to be clear.
60+
// CHECK-NEXT: sparse_tensor.convert
61+
// CHECK-NEXT: return
6362
func.func @sparse_convert(%arg0: tensor<?xf32, #SparseVector64>) -> tensor<?xf32, #SparseVector32> {
6463
%0 = sparse_tensor.convert %arg0 : tensor<?xf32, #SparseVector64> to tensor<?xf32, #SparseVector32>
6564
return %0 : tensor<?xf32, #SparseVector32>
@@ -73,6 +72,7 @@ func.func @sparse_convert(%arg0: tensor<?xf32, #SparseVector64>) -> tensor<?xf32
7372
// CHECK: sparse_tensor.foreach
7473
// CHECK: sparse_tensor.insert
7574
// CHECK: sparse_tensor.load
75+
// CHECK: return
7676
func.func @sparse_convert_permuted(%arg0: tensor<?x?x?xf32, #SortedCOO3D>) -> tensor<?x?x?xf32, #TsssPermuted> {
7777
%0 = sparse_tensor.convert %arg0 : tensor<?x?x?xf32, #SortedCOO3D> to tensor<?x?x?xf32, #TsssPermuted>
7878
return %0 : tensor<?x?x?xf32, #TsssPermuted>
@@ -83,6 +83,7 @@ func.func @sparse_convert_permuted(%arg0: tensor<?x?x?xf32, #SortedCOO3D>) -> te
8383
// CHECK: sparse_tensor.insert
8484
// CHECK: sparse_tensor.load
8585
// CHECK-NOT: sparse_tensor.reorder_coo
86+
// CHECK: return
8687
func.func @sparse_convert_slice(%arg0: tensor<2x13xi32, #COOSlice>) -> (tensor<2x13xi32, #SortedCOO2D>) {
8788
%0 = sparse_tensor.convert %arg0 : tensor<2x13xi32, #COOSlice> to tensor<2x13xi32, #SortedCOO2D>
8889
return %0 : tensor<2x13xi32, #SortedCOO2D>

0 commit comments

Comments
 (0)