Skip to content

Commit f59b0c7

Browse files
authored
[mlir][linalg][nfc] Delete references to args_in/args_out (llvm#111517)
After the refactor in: * ed22913, the `args_in` and `args_out` attributes are no longer used by `linalg.generic`. This patch removes most the remaining references. I've left out BufferDeallocationInternals.md, which doesn't seem maintained anymore and is quite out of sync with other bits of MLIR (e.g. `test.generic` instead of `linalg.generic`).
1 parent e023d02 commit f59b0c7

File tree

5 files changed

+0
-35
lines changed

5 files changed

+0
-35
lines changed

mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.td

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ def BufferDeallocation : Pass<"buffer-deallocation", "func::FuncOp"> {
3232
^bb2:
3333
%0 = memref.alloc() : memref<2xf32>
3434
linalg.generic {
35-
args_in = 1 : i64,
36-
args_out = 1 : i64,
3735
indexing_maps = [#map0, #map0],
3836
iterator_types = ["parallel"]} %arg1, %0 {
3937
^bb0(%gen1_arg0: f32, %gen1_arg1: f32):
@@ -63,8 +61,6 @@ def BufferDeallocation : Pass<"buffer-deallocation", "func::FuncOp"> {
6361
^bb2: // pred: ^bb0
6462
%1 = memref.alloc() : memref<2xf32>
6563
linalg.generic {
66-
args_in = 1 : i64,
67-
args_out = 1 : i64,
6864
indexing_maps = [#map0, #map0],
6965
iterator_types = ["parallel"]} %arg1, %1 {
7066
^bb0(%arg3: f32, %arg4: f32):
@@ -143,8 +139,6 @@ def OwnershipBasedBufferDeallocation : Pass<
143139
^bb2:
144140
%0 = memref.alloc() : memref<2xf32>
145141
linalg.generic {
146-
args_in = 1 : i64,
147-
args_out = 1 : i64,
148142
indexing_maps = [#map0, #map0],
149143
iterator_types = ["parallel"]}
150144
outs(%arg1, %0 : memref<2xf32>, memref<2xf32>) {
@@ -179,7 +173,6 @@ def OwnershipBasedBufferDeallocation : Pass<
179173
indexing_maps = [#map, #map],
180174
iterator_types = ["parallel"]}
181175
outs(%arg1, %alloc : memref<2xf32>, memref<2xf32>)
182-
attrs = {args_in = 1 : i64, args_out = 1 : i64} {
183176
^bb0(%out: f32, %out_0: f32):
184177
%2 = math.exp %out : f32
185178
linalg.yield %2, %out_0 : f32, f32

mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,6 @@ struct MoveInitOperandsToInput : public OpRewritePattern<GenericOp> {
178178
/// ]
179179
///
180180
/// #trait = {
181-
/// args_in = 2,
182-
/// args_out = 1,
183181
/// indexing_maps = #accesses,
184182
/// iterator_types = ["parallel", "parallel"],
185183
/// library_call = "some_external_fn"
@@ -210,8 +208,6 @@ struct MoveInitOperandsToInput : public OpRewritePattern<GenericOp> {
210208
/// ]
211209
///
212210
/// #trait = {
213-
/// args_in = 2,
214-
/// args_out = 1,
215211
/// indexing_maps = #accesses,
216212
/// iterator_types = ["parallel", "parallel"],
217213
/// library_call = "some_external_fn"

mlir/test/Dialect/Linalg/loops.mlir

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,6 @@ func.func @copy_view(%arg0: memref<?xf32, strided<[1], offset: ?>>, %arg1: memre
254254
affine_map<(i, j, k) -> (i, k, j)>
255255
]
256256
#trait2 = {
257-
args_in = 1,
258-
args_out = 2,
259257
iterator_types = ["parallel", "parallel", "parallel"],
260258
indexing_maps = #accesses,
261259
library_call = "some_external_function_name_2",
@@ -296,8 +294,6 @@ func.func @generic_region(%arg0: memref<?x?xf32, strided<[?, 1], offset: ?>>, %a
296294
// CHECKPARALLEL: store %[[e]], %{{.*}}[%[[i]], %[[k]], %[[j]]] : memref<?x?x?xf32, strided<[?, ?, 1], offset: ?>>
297295

298296
#trait4 = {
299-
args_in = 1,
300-
args_out = 2,
301297
iterator_types = ["parallel", "parallel", "parallel"],
302298
indexing_maps = #accesses,
303299
library_call = "some_external_function_name_2",
@@ -366,8 +362,6 @@ func.func @generic_index_region(
366362
]
367363

368364
#trait_broadcast = {
369-
args_in = 1,
370-
args_out = 1,
371365
indexing_maps = #broadcast_access,
372366
iterator_types = ["parallel", "parallel"],
373367
library_call = "some_broadcast_external_fn"
@@ -466,8 +460,6 @@ func.func @generic_index_op_zero_rank(%arg0: memref<i32>, %arg1: memref<3x4xi32>
466460
]
467461

468462
#trait_reduce_1D = {
469-
args_in = 1,
470-
args_out = 1,
471463
indexing_maps = #reduce_1D_access,
472464
iterator_types = ["reduction"],
473465
library_call = "some_reduce_external_fn"
@@ -510,8 +502,6 @@ func.func @generic_op_1D_reduce(%arg0: memref<?xf32>, %arg1: memref<f32>)
510502
]
511503

512504
#trait_reduce_init_1D = {
513-
args_in = 2,
514-
args_out = 1,
515505
indexing_maps = #reduce_init_1D_access,
516506
iterator_types = ["reduction"],
517507
library_call = "some_reduce_external_fn"
@@ -559,8 +549,6 @@ func.func @generic_index_op_1D_reduce(%arg0: memref<?xf32>,
559549
// CHECKPARALLEL: store %[[e]], %[[ARG2]][]
560550

561551
#trait_const_fill = {
562-
args_in = 0,
563-
args_out = 1,
564552
indexing_maps = [affine_map<(i) -> (i)>],
565553
iterator_types = ["parallel"],
566554
library_call = "some_external_fn"
@@ -591,8 +579,6 @@ func.func @generic_const_init(%arg0: memref<?xf32>) {
591579
affine_map<() -> ()>
592580
]
593581
#scalar_trait = {
594-
args_in = 2,
595-
args_out = 1,
596582
iterator_types = [],
597583
indexing_maps = #scalar_access,
598584
library_call = "some_external_fn"

mlir/test/Dialect/Linalg/transform-patterns.mlir

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ module attributes {transform.with_named_sequence} {
118118
affine_map<(m, n, k) -> (m, n)>
119119
]
120120
#generic_matmul_trait = {
121-
args_in = 2,
122-
args_out = 1,
123121
indexing_maps = #matmul_accesses,
124122
library_call = "linalg_matmul",
125123
iterator_types = ["parallel", "parallel", "reduction"]

mlir/test/Dialect/Linalg/vectorization-with-patterns.mlir

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ module attributes {transform.with_named_sequence} {
8383
// -----
8484

8585
#matmul_trait = {
86-
args_in = 2,
87-
args_out = 1,
8886
indexing_maps = [
8987
affine_map<(m, n, k) -> (m, k)>,
9088
affine_map<(m, n, k) -> (k, n)>,
@@ -125,8 +123,6 @@ module attributes {transform.with_named_sequence} {
125123
// -----
126124

127125
#matmul_transpose_out_trait = {
128-
args_in = 2,
129-
args_out = 1,
130126
indexing_maps = [
131127
affine_map<(m, n, k) -> (m, k)>,
132128
affine_map<(m, n, k) -> (k, n)>,
@@ -196,8 +192,6 @@ module attributes {transform.with_named_sequence} {
196192
// -----
197193

198194
#matmul_trait = {
199-
args_in = 2,
200-
args_out = 1,
201195
indexing_maps = [
202196
affine_map<(m, n, k) -> (m, k)>,
203197
affine_map<(m, n, k) -> (k, n)>,
@@ -528,8 +522,6 @@ func.func @generic_vectorize(%arg0: memref<4x256xf32>,
528522
// CHECK-DAG: %[[C0:.*]] = arith.constant 0 : index
529523
%c1_f32 = arith.constant 1.0 : f32
530524
linalg.generic {
531-
args_in = 0 : i64,
532-
args_out = 10 : i64,
533525
indexing_maps = [
534526
affine_map<(d0, d1) -> (d0, d1)>,
535527
affine_map<(d0, d1) -> (d1)>,

0 commit comments

Comments
 (0)