|
1 |
| -// First use with `kViaCOO` for sparse2sparse conversion (the old way). |
2 |
| -// RUN: mlir-opt %s --sparse-tensor-conversion="s2s-strategy=1" \ |
3 |
| -// RUN: --canonicalize --cse | FileCheck %s |
4 |
| -// |
5 |
| -// Now again with `kAuto` (the new default). |
6 |
| -// RUN: mlir-opt %s --sparse-tensor-conversion="s2s-strategy=0" \ |
7 |
| -// RUN: --canonicalize --cse | FileCheck %s -check-prefix=CHECKAUTO |
| 1 | +// RUN: mlir-opt %s --sparse-tensor-conversion --canonicalize --cse | FileCheck %s |
8 | 2 |
|
9 | 3 | #SparseVector = #sparse_tensor.encoding<{
|
10 | 4 | dimLevelType = ["compressed"]
|
@@ -233,29 +227,15 @@ func.func @sparse_convert_complex(%arg0: tensor<100xcomplex<f64>>) -> tensor<100
|
233 | 227 |
|
234 | 228 | // CHECK-LABEL: func @sparse_convert_1d_ss(
|
235 | 229 | // CHECK-SAME: %[[A:.*]]: !llvm.ptr<i8>)
|
236 |
| -// CHECK-DAG: %[[ToCOO:.*]] = arith.constant 5 : i32 |
237 |
| -// CHECK-DAG: %[[FromCOO:.*]] = arith.constant 2 : i32 |
| 230 | +// CHECK-DAG: %[[SparseToSparse:.*]] = arith.constant 3 : i32 |
238 | 231 | // CHECK-DAG: %[[P:.*]] = memref.alloca() : memref<1xi8>
|
239 | 232 | // CHECK-DAG: %[[Q:.*]] = memref.alloca() : memref<1xindex>
|
240 | 233 | // CHECK-DAG: %[[R:.*]] = memref.alloca() : memref<1xindex>
|
241 | 234 | // CHECK-DAG: %[[X:.*]] = memref.cast %[[P]] : memref<1xi8> to memref<?xi8>
|
242 | 235 | // CHECK-DAG: %[[Y:.*]] = memref.cast %[[Q]] : memref<1xindex> to memref<?xindex>
|
243 | 236 | // CHECK-DAG: %[[Z:.*]] = memref.cast %[[R]] : memref<1xindex> to memref<?xindex>
|
244 |
| -// CHECK: %[[C:.*]] = call @newSparseTensor(%[[X]], %[[Y]], %[[Z]], %{{.*}}, %{{.*}}, %{{.*}}, %[[ToCOO]], %[[A]]) |
245 |
| -// CHECK: %[[T:.*]] = call @newSparseTensor(%[[X]], %[[Y]], %[[Z]], %{{.*}}, %{{.*}}, %{{.*}}, %[[FromCOO]], %[[C]]) |
246 |
| -// CHECK: call @delSparseTensorCOOF32(%[[C]]) |
| 237 | +// CHECK: %[[T:.*]] = call @newSparseTensor(%[[X]], %[[Y]], %[[Z]], %{{.*}}, %{{.*}}, %{{.*}}, %[[SparseToSparse]], %[[A]]) |
247 | 238 | // CHECK: return %[[T]] : !llvm.ptr<i8>
|
248 |
| -// CHECKAUTO-LABEL: func @sparse_convert_1d_ss( |
249 |
| -// CHECKAUTO-SAME: %[[A:.*]]: !llvm.ptr<i8>) |
250 |
| -// CHECKAUTO-DAG: %[[SparseToSparse:.*]] = arith.constant 3 : i32 |
251 |
| -// CHECKAUTO-DAG: %[[P:.*]] = memref.alloca() : memref<1xi8> |
252 |
| -// CHECKAUTO-DAG: %[[Q:.*]] = memref.alloca() : memref<1xindex> |
253 |
| -// CHECKAUTO-DAG: %[[R:.*]] = memref.alloca() : memref<1xindex> |
254 |
| -// CHECKAUTO-DAG: %[[X:.*]] = memref.cast %[[P]] : memref<1xi8> to memref<?xi8> |
255 |
| -// CHECKAUTO-DAG: %[[Y:.*]] = memref.cast %[[Q]] : memref<1xindex> to memref<?xindex> |
256 |
| -// CHECKAUTO-DAG: %[[Z:.*]] = memref.cast %[[R]] : memref<1xindex> to memref<?xindex> |
257 |
| -// CHECKAUTO: %[[T:.*]] = call @newSparseTensor(%[[X]], %[[Y]], %[[Z]], %{{.*}}, %{{.*}}, %{{.*}}, %[[SparseToSparse]], %[[A]]) |
258 |
| -// CHECKAUTO: return %[[T]] : !llvm.ptr<i8> |
259 | 239 | func.func @sparse_convert_1d_ss(%arg0: tensor<?xf32, #SparseVector64>) -> tensor<?xf32, #SparseVector32> {
|
260 | 240 | %0 = sparse_tensor.convert %arg0 : tensor<?xf32, #SparseVector64> to tensor<?xf32, #SparseVector32>
|
261 | 241 | return %0 : tensor<?xf32, #SparseVector32>
|
|
0 commit comments