Skip to content

Commit c48e3a1

Browse files
committed
[mlir][NFC] Update textual references of func to func.func in Tensor/Tosa/Vector tests
The special case parsing of `func` operations is being removed.
1 parent 2c7836e commit c48e3a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1013
-1013
lines changed

mlir/test/Dialect/Tensor/bufferize.mlir

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// CHECK: %[[MEMREF:.*]] = bufferization.to_memref %[[TENSOR]] : memref<f32>
1414
// CHECK: %[[EXTENT:.*]] = memref.dim %[[MEMREF]], %[[INDEX]] : memref<f32>
1515
// CHECK: return %[[EXTENT]] : index
16-
func @dim(%arg0: tensor<f32>, %arg1: index) -> index {
16+
func.func @dim(%arg0: tensor<f32>, %arg1: index) -> index {
1717
%0 = tensor.dim %arg0, %arg1 : tensor<f32>
1818
return %0 : index
1919
}
@@ -22,7 +22,7 @@ func @dim(%arg0: tensor<f32>, %arg1: index) -> index {
2222
// CHECK-SAME: %[[TENSOR:.*]]: tensor<*xf32>) -> index {
2323
// CHECK: %[[MEMREF:.*]] = bufferization.to_memref %[[TENSOR]]
2424
// CHECK: %[[EXTENT:.*]] = memref.rank %[[MEMREF]] : memref<*xf32>
25-
func @rank(%arg0: tensor<*xf32>) -> index {
25+
func.func @rank(%arg0: tensor<*xf32>) -> index {
2626
%0 = tensor.rank %arg0 : tensor<*xf32>
2727
return %0 : index
2828
}
@@ -33,7 +33,7 @@ func @rank(%arg0: tensor<*xf32>) -> index {
3333
// CHECK: %[[CASTED:.*]] = memref.cast %[[MEMREF]] : memref<?xindex> to memref<2xindex>
3434
// CHECK: %[[RET:.*]] = bufferization.to_tensor %[[CASTED]]
3535
// CHECK: return %[[RET]] : tensor<2xindex>
36-
func @tensor.cast(%arg0: tensor<?xindex>) -> tensor<2xindex> {
36+
func.func @tensor.cast(%arg0: tensor<?xindex>) -> tensor<2xindex> {
3737
%0 = tensor.cast %arg0 : tensor<?xindex> to tensor<2xindex>
3838
return %0 : tensor<2xindex>
3939
}
@@ -44,7 +44,7 @@ func @tensor.cast(%arg0: tensor<?xindex>) -> tensor<2xindex> {
4444
// CHECK: %[[CASTED_MEMREF:.*]] = memref.cast %[[MEMREF]] : memref<*xf32> to memref<2xf32>
4545
// CHECK: %[[RET:.*]] = bufferization.to_tensor %[[CASTED_MEMREF]] : memref<2xf32>
4646
// CHECK: return %[[RET]] : tensor<2xf32>
47-
func @tensor.cast_from_unranked(%arg0: tensor<*xf32>) -> tensor<2xf32> {
47+
func.func @tensor.cast_from_unranked(%arg0: tensor<*xf32>) -> tensor<2xf32> {
4848
%0 = tensor.cast %arg0 : tensor<*xf32> to tensor<2xf32>
4949
return %0 : tensor<2xf32>
5050
}
@@ -55,7 +55,7 @@ func @tensor.cast_from_unranked(%arg0: tensor<*xf32>) -> tensor<2xf32> {
5555
// CHECK: %[[CASTED_MEMREF:.*]] = memref.cast %[[MEMREF]] : memref<2xf32> to memref<*xf32>
5656
// CHECK: %[[RET:.*]] = bufferization.to_tensor %[[CASTED_MEMREF]] : memref<*xf32>
5757
// CHECK: return %[[RET]] : tensor<*xf32>
58-
func @tensor.cast_to_unranked(%arg0: tensor<2xf32>) -> tensor<*xf32> {
58+
func.func @tensor.cast_to_unranked(%arg0: tensor<2xf32>) -> tensor<*xf32> {
5959
%0 = tensor.cast %arg0 : tensor<2xf32> to tensor<*xf32>
6060
return %0 : tensor<*xf32>
6161
}
@@ -67,15 +67,15 @@ func @tensor.cast_to_unranked(%arg0: tensor<2xf32>) -> tensor<*xf32> {
6767
// CHECK: %[[RET:.*]] = memref.load %[[MEMREF]][%[[IDX]]] : memref<?xf32>
6868
// CHECK: return %[[RET]] : f32
6969
// CHECK: }
70-
func @tensor.extract(%arg0: tensor<?xf32>, %arg1: index) -> f32 {
70+
func.func @tensor.extract(%arg0: tensor<?xf32>, %arg1: index) -> f32 {
7171
%0 = tensor.extract %arg0[%arg1] : tensor<?xf32>
7272
return %0 : f32
7373
}
7474

7575
// CHECK-LABEL: func @tensor.from_elements_no_elements() -> tensor<0xindex> {
7676
// CHECK: %[[RET:.*]] = arith.constant dense<> : tensor<0xindex>
7777
// CHECK: return %[[RET]] : tensor<0xindex>
78-
func @tensor.from_elements_no_elements() -> tensor<0xindex> {
78+
func.func @tensor.from_elements_no_elements() -> tensor<0xindex> {
7979
%0 = tensor.from_elements : tensor<0xindex>
8080
return %0 : tensor<0xindex>
8181
}
@@ -86,7 +86,7 @@ func @tensor.from_elements_no_elements() -> tensor<0xindex> {
8686
// CHECK: store %[[ELEM0]], %[[MEMREF]]
8787
// CHECK: %[[RET:.*]] = bufferization.to_tensor %[[MEMREF]]
8888
// CHECK: return %[[RET]] : tensor<index>
89-
func @tensor.from_elements_0d(%arg0: index) -> tensor<index> {
89+
func.func @tensor.from_elements_0d(%arg0: index) -> tensor<index> {
9090
%0 = tensor.from_elements %arg0 : tensor<index>
9191
return %0 : tensor<index>
9292
}
@@ -101,7 +101,7 @@ func @tensor.from_elements_0d(%arg0: index) -> tensor<index> {
101101
// CHECK: store %[[ELEM1]], %[[MEMREF]][%[[C1]]]
102102
// CHECK: %[[RET:.*]] = bufferization.to_tensor %[[MEMREF]]
103103
// CHECK: return %[[RET]] : tensor<2xindex>
104-
func @tensor.from_elements_1d(%arg0: index, %arg1: index) -> tensor<2xindex> {
104+
func.func @tensor.from_elements_1d(%arg0: index, %arg1: index) -> tensor<2xindex> {
105105
%0 = tensor.from_elements %arg0, %arg1 : tensor<2xindex>
106106
return %0 : tensor<2xindex>
107107
}
@@ -121,7 +121,7 @@ func @tensor.from_elements_1d(%arg0: index, %arg1: index) -> tensor<2xindex> {
121121
// CHECK: store %[[ELEM1]], %[[MEMREF]][%[[C2]], %[[C1]]]
122122
// CHECK: %[[RET:.*]] = bufferization.to_tensor %[[MEMREF]]
123123
// CHECK: return %[[RET]] : tensor<3x2xindex>
124-
func @tensor.from_elements_2d(%arg0: index, %arg1: index) -> tensor<3x2xindex> {
124+
func.func @tensor.from_elements_2d(%arg0: index, %arg1: index) -> tensor<3x2xindex> {
125125
%0 = tensor.from_elements %arg0, %arg1, %arg0, %arg1, %arg0, %arg1
126126
: tensor<3x2xindex>
127127
return %0 : tensor<3x2xindex>
@@ -163,7 +163,7 @@ func @tensor.from_elements_2d(%arg0: index, %arg1: index) -> tensor<3x2xindex> {
163163

164164
// CHECK: %[[RET:.*]] = bufferization.to_tensor %[[MEMREF]]
165165
// CHECK: return %[[RET]] : tensor<3x2x2xf32>
166-
func @tensor.from_elements_3d(%f0 : f32) -> tensor<3x2x2xf32> {
166+
func.func @tensor.from_elements_3d(%f0 : f32) -> tensor<3x2x2xf32> {
167167
%f1 = arith.constant 1.0 : f32
168168
%f2 = arith.constant 2.0 : f32
169169
%f3 = arith.constant 3.0 : f32
@@ -195,7 +195,7 @@ func @tensor.from_elements_3d(%f0 : f32) -> tensor<3x2x2xf32> {
195195
// CHECK: %[[RET:.*]] = bufferization.to_tensor %[[MEMREF]] : memref<?xindex>
196196
// CHECK: return %[[RET]] : tensor<?xindex>
197197
// CHECK: }
198-
func @tensor.generate(%arg: tensor<*xf32>, %dynamic_extent: index) -> tensor<?xindex> {
198+
func.func @tensor.generate(%arg: tensor<*xf32>, %dynamic_extent: index) -> tensor<?xindex> {
199199
%result = tensor.generate %dynamic_extent {
200200
^bb0(%i : index):
201201
%elem = tensor.dim %arg, %i : tensor<*xf32>
@@ -221,7 +221,7 @@ func @tensor.generate(%arg: tensor<*xf32>, %dynamic_extent: index) -> tensor<?xi
221221
// CHECK: %[[RET:.*]] = bufferization.to_tensor %[[MEMREF]] : memref<16x?xindex>
222222
// CHECK: return %[[RET]] : tensor<16x?xindex>
223223
// CHECK: }
224-
func @tensor.generate_static_and_dynamic(%arg0: index) -> tensor<16x?xindex> {
224+
func.func @tensor.generate_static_and_dynamic(%arg0: index) -> tensor<16x?xindex> {
225225
%result = tensor.generate %arg0 {
226226
^bb0(%i: index, %j: index):
227227
%sum = arith.addi %i, %j : index
@@ -231,7 +231,7 @@ func @tensor.generate_static_and_dynamic(%arg0: index) -> tensor<16x?xindex> {
231231
}
232232

233233
// CHECK-LABEL: func @tensor.generate_unknown_ops_in_body
234-
func @tensor.generate_unknown_ops_in_body(%arg0: index) -> tensor<?xindex> {
234+
func.func @tensor.generate_unknown_ops_in_body(%arg0: index) -> tensor<?xindex> {
235235
// CHECK-NOT: tensor.generate
236236
%tensor = tensor.generate %arg0 {
237237
^bb0(%iv: index):
@@ -244,7 +244,7 @@ func @tensor.generate_unknown_ops_in_body(%arg0: index) -> tensor<?xindex> {
244244

245245
// CHECK-LABEL: func @tensor.extract_slice(
246246
// CHECK-SAME: %[[t1:.*]]: tensor<?x?xf32>, %[[idx1:.*]]: index, %[[idx2:.*]]: index
247-
func @tensor.extract_slice(
247+
func.func @tensor.extract_slice(
248248
%t1: tensor<?x?xf32>, %idx1: index, %idx2: index) -> tensor<?x10xf32> {
249249
// CHECK: %[[m:.*]] = bufferization.to_memref %[[t1]] : memref<?x?xf32>
250250
// CHECK: %[[r:.*]] = memref.subview %[[m]][5, %[[idx2]]] [%[[idx1]], 10] [1, 1] : memref<?x?xf32> to memref<?x10xf32, #[[$MAP0]]>
@@ -258,7 +258,7 @@ func @tensor.extract_slice(
258258
// CHECK-LABEL: func @tensor.extract_slice_rank_reducing(
259259
// CHECK-SAME: %[[t1:.*]]: tensor<?x10x?xf32>, %[[idx1:.*]]: index,
260260
// CHECK-SAME: %[[idx2:.*]]: index
261-
func @tensor.extract_slice_rank_reducing(
261+
func.func @tensor.extract_slice_rank_reducing(
262262
%t1: tensor<?x10x?xf32>, %idx1: index, %idx2: index) -> tensor<?x15xf32> {
263263
// CHECK: %[[m1:.*]] = bufferization.to_memref %[[t1]] : memref<?x10x?xf32>
264264
// CHECK: %[[r:.*]] = memref.subview %[[m1]][5, %[[idx1]], 10] [%[[idx2]], 1, 15] [1, 1, 1] : memref<?x10x?xf32> to memref<?x15xf32, #[[$MAP0]]>
@@ -272,7 +272,7 @@ func @tensor.extract_slice_rank_reducing(
272272
// CHECK-LABEL: func @tensor.insert_slice(
273273
// CHECK-SAME: %[[t1:.*]]: tensor<?x?xf32>, %[[t2:.*]]: tensor<?x10xf32>,
274274
// CHECK-SAME: %[[idx1:.*]]: index, %[[idx2:.*]]: index
275-
func @tensor.insert_slice(%t1: tensor<?x?xf32>, %t2: tensor<?x10xf32>,
275+
func.func @tensor.insert_slice(%t1: tensor<?x?xf32>, %t2: tensor<?x10xf32>,
276276
%idx1: index, %idx2: index) -> tensor<?x?xf32> {
277277
// CHECK-DAG: %[[c0:.*]] = arith.constant 0 : index
278278
// CHECK-DAG: %[[c1:.*]] = arith.constant 1 : index
@@ -295,7 +295,7 @@ func @tensor.insert_slice(%t1: tensor<?x?xf32>, %t2: tensor<?x10xf32>,
295295
// CHECK-LABEL: func @tensor.insert(
296296
// CHECK-SAME: %[[t1:.*]]: tensor<5xf32>, %[[idx1:.*]]: index,
297297
// CHECK-SAME: %[[f:.*]]: f32
298-
func @tensor.insert(%t1: tensor<5xf32>, %idx1: index, %f: f32) -> tensor<5xf32> {
298+
func.func @tensor.insert(%t1: tensor<5xf32>, %idx1: index, %f: f32) -> tensor<5xf32> {
299299
// CHECK-DAG: %[[alloc:.*]] = memref.alloc() {{.*}} : memref<5xf32>
300300
// CHECK-DAG: %[[m1:.*]] = bufferization.to_memref %[[t1]] : memref<5xf32>
301301
// CHECK: memref.copy %[[m1]], %[[alloc]]
@@ -309,7 +309,7 @@ func @tensor.insert(%t1: tensor<5xf32>, %idx1: index, %f: f32) -> tensor<5xf32>
309309

310310
// CHECK-LABEL: func @tensor.expand_shape(
311311
// CHECK-SAME: %[[t1:.*]]: tensor<?x10xf32>
312-
func @tensor.expand_shape(%t1: tensor<?x10xf32>) -> tensor<2x?x10xf32> {
312+
func.func @tensor.expand_shape(%t1: tensor<?x10xf32>) -> tensor<2x?x10xf32> {
313313
// CHECK: %[[m1:.*]] = bufferization.to_memref %[[t1]] : memref<?x10xf32>
314314
// CHECK: %[[expanded:.*]] = memref.expand_shape %[[m1]] [
315315
// CHECK-SAME: [0, 1], [2]] : memref<?x10xf32> into memref<2x?x10xf32>
@@ -323,7 +323,7 @@ func @tensor.expand_shape(%t1: tensor<?x10xf32>) -> tensor<2x?x10xf32> {
323323

324324
// CHECK-LABEL: func @tensor.expand_shape_of_slice(
325325
// CHECK-SAME: %[[t1:.*]]: tensor<?x20xf32>
326-
func @tensor.expand_shape_of_slice(
326+
func.func @tensor.expand_shape_of_slice(
327327
%t1: tensor<?x20xf32>, %o1: index, %s1: index) -> tensor<?x7x2x5xf32> {
328328
// CHECK: %[[m1:.*]] = bufferization.to_memref %[[t1]] : memref<?x20xf32>
329329
// CHECK: %[[subview:.*]] = memref.subview %[[m1]][%{{.*}}, 5] [%{{.*}}, 10] [1, 1] : memref<?x20xf32> to memref<?x10xf32, #[[$MAP1]]>
@@ -340,7 +340,7 @@ func @tensor.expand_shape_of_slice(
340340

341341
// CHECK-LABEL: func @tensor.expand_shape_of_slice2(
342342
// CHECK-SAME: %[[t1:.*]]: tensor<1x2xf32>
343-
func @tensor.expand_shape_of_slice2(%t1: tensor<1x2xf32>) -> tensor<1xf32> {
343+
func.func @tensor.expand_shape_of_slice2(%t1: tensor<1x2xf32>) -> tensor<1xf32> {
344344
// CHECK: memref.subview {{.*}} : memref<1x2xf32> to memref<1x1xf32, #[[$MAP5]]>
345345
%0 = tensor.extract_slice %t1[0, 0][1, 1][1, 1] : tensor<1x2xf32> to tensor<1x1xf32>
346346
// CHECK: memref.collapse_shape %{{.*}} [
@@ -351,7 +351,7 @@ func @tensor.expand_shape_of_slice2(%t1: tensor<1x2xf32>) -> tensor<1xf32> {
351351

352352
// CHECK-LABEL: func @tensor.collapse_shape(
353353
// CHECK-SAME: %[[t1:.*]]: tensor<2x?x?xf32>
354-
func @tensor.collapse_shape(%t1: tensor<2x?x?xf32>) -> tensor<?x?xf32> {
354+
func.func @tensor.collapse_shape(%t1: tensor<2x?x?xf32>) -> tensor<?x?xf32> {
355355
// CHECK: %[[m1:.*]] = bufferization.to_memref %[[t1]] : memref<2x?x?xf32>
356356
// CHECK: %[[collapsed:.*]] = memref.collapse_shape %[[m1]] [
357357
// CHECK-SAME: [0, 1], [2]] : memref<2x?x?xf32> into memref<?x?xf32>
@@ -365,7 +365,7 @@ func @tensor.collapse_shape(%t1: tensor<2x?x?xf32>) -> tensor<?x?xf32> {
365365

366366
// CHECK-LABEL: func @tensor.collapse_shape_to_scalar(
367367
// CHECK-SAME: %[[t1:.*]]: tensor<1x1x1xf32>
368-
func @tensor.collapse_shape_to_scalar(%t1: tensor<1x1x1xf32>) -> tensor<f32> {
368+
func.func @tensor.collapse_shape_to_scalar(%t1: tensor<1x1x1xf32>) -> tensor<f32> {
369369
// CHECK: %[[m1:.*]] = bufferization.to_memref %[[t1]] : memref<1x1x1xf32>
370370
// CHECK: %[[collapsed:.*]] = memref.collapse_shape %[[m1]] [] : memref<1x1x1xf32> into memref<f32>
371371
%0 = tensor.collapse_shape %t1 []
@@ -377,7 +377,7 @@ func @tensor.collapse_shape_to_scalar(%t1: tensor<1x1x1xf32>) -> tensor<f32> {
377377
}
378378

379379
// CHECK-LABEL: func @tensor.collapse_shape_of_slice(
380-
func @tensor.collapse_shape_of_slice(%arg0: tensor<2xi32>) -> tensor<i32> {
380+
func.func @tensor.collapse_shape_of_slice(%arg0: tensor<2xi32>) -> tensor<i32> {
381381
// CHECK: memref.subview %{{.*}}[1] [1] [1] : memref<2xi32> to memref<1xi32, #[[$MAP3]]>
382382
%0 = tensor.extract_slice %arg0[1] [1] [1] : tensor<2xi32> to tensor<1xi32>
383383
// CHECK: memref.collapse_shape %{{.*}} [] : memref<1xi32, #[[$MAP3]]> into memref<i32, #[[$MAP4]]>
@@ -386,7 +386,7 @@ func @tensor.collapse_shape_of_slice(%arg0: tensor<2xi32>) -> tensor<i32> {
386386
}
387387

388388
// CHECK-LABEL: func @tensor.collapse_shape_of_slice2(
389-
func @tensor.collapse_shape_of_slice2(
389+
func.func @tensor.collapse_shape_of_slice2(
390390
%arg0: tensor<?x?x?x?xi64>, %o1: index, %o2: index, %o3: index, %o4: index)
391391
-> tensor<87x63648xi64> {
392392
// CHECK: %[[subview:.*]] = memref.subview %{{.*}} : memref<?x?x?x?xi64> to memref<87x78x68x12xi64, #{{.*}}>

0 commit comments

Comments
 (0)