Skip to content

Commit 04e2899

Browse files
author
git apple-llvm automerger
committed
Merge commit 'ca5d34ec7186' from llvm.org/main into next
2 parents e995be4 + ca5d34e commit 04e2899

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

mlir/docs/Tutorials/transform/Ch1.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ transform.sequence failures(propagate) {
261261
262262
// The actual tiling transformation takes tile sizes as attributes. It
263263
// produces a handle to the loop generated during tiling.
264-
%loop, %tiled_max =
264+
%tiled_max, %loop =
265265
transform.structured.tile_using_forall %max tile_sizes [8, 32]
266266
: (!transform.any_op) -> (!transform.any_op, !transform.any_op)
267267
@@ -271,12 +271,12 @@ transform.sequence failures(propagate) {
271271
// important. We could also use "transform.merge_handles" to obtain a single
272272
// handle to all operations and give it to `fuse_into_containing_op` that
273273
// would take care of the ordering in this case.
274-
%loop_0, %tiled_add =
274+
%add_fused, %loop_0 =
275275
transform.structured.fuse_into_containing_op %add into %loop
276276
: (!transform.any_op, !transform.any_op)
277277
-> (!transform.any_op, !transform.any_op)
278-
%loop_1, %tiled_matmul =
279-
transform.structured.fuse_into_containing_op %arg1 into %loop
278+
%matmul_fused, %loop_1 =
279+
transform.structured.fuse_into_containing_op %arg1 into %loop_0
280280
: (!transform.op<"linalg.matmul">, !transform.any_op)
281281
-> (!transform.any_op, !transform.any_op)
282282
@@ -304,7 +304,7 @@ transform.sequence failures(propagate) {
304304
305305
// The actual tiling transformation takes tile sizes as attributes. It
306306
// produces a handle to the loop generated during tiling.
307-
%loop, %tiled = transform.structured.tile_using_forall %max tile_sizes [8, 32]
307+
%tiled, %loop = transform.structured.tile_using_forall %max tile_sizes [8, 32]
308308
: (!transform.any_op) -> (!transform.any_op, !transform.any_op)
309309
310310
// We can now fuse the other operations into the loop. Here, we fuse
@@ -318,7 +318,7 @@ transform.sequence failures(propagate) {
318318
: (!transform.any_op, !transform.any_op)
319319
-> (!transform.any_op, !transform.any_op)
320320
%matmul_fused, %loop_1 =
321-
transform.structured.fuse_into_containing_op %arg1 into %loop
321+
transform.structured.fuse_into_containing_op %arg1 into %loop_0
322322
: (!transform.op<"linalg.matmul">, !transform.any_op)
323323
-> (!transform.any_op, !transform.any_op)
324324
@@ -327,7 +327,7 @@ transform.sequence failures(propagate) {
327327
// "max" operation. This illustrates the precise targeting with the transform
328328
// dialect. Otherwise, it is difficult to differentiate "add" and "max", both
329329
// of which having the same kind.
330-
%loop_2, %tiled_2 =
330+
%tiled_2, %loop_2 =
331331
transform.structured.tile_using_forall %add_fused tile_sizes [4, 4]
332332
: (!transform.any_op) -> (!transform.any_op, !transform.any_op)
333333
%matmul_fused_2, %loop_3 =
@@ -338,7 +338,7 @@ transform.sequence failures(propagate) {
338338
// Since outlining is currently only implemented for region-holding operations
339339
// such as loops, use tiling to size 1 to materialize the outer loop that is
340340
// going to be outlined.
341-
%outline_target, %_ =
341+
%_, %outline_target =
342342
transform.structured.tile_using_forall %tiled_2 tile_sizes [1]
343343
: (!transform.any_op) -> (!transform.any_op, !transform.any_op)
344344
transform.structured.fuse_into_containing_op %matmul_fused_2

mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,8 +1911,8 @@ def TileUsingForallOp :
19111911
tiled operations, which can all be empty.
19121912

19131913
These two returned handles point to:
1914-
- the new scf.forall op,
1915-
- the tiled op that implements TilingInterface.
1914+
- the tiled op that implements TilingInterface,
1915+
- the new scf.forall op.
19161916

19171917
#### Example using `num_threads`
19181918

mlir/test/Dialect/GPU/transform-gpu-failing.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func.func @map_nested_forall_to_threads_not_buffer(%x: tensor<32x32xf32>, %y: te
144144
module attributes {transform.with_named_sequence} {
145145
transform.named_sequence @__transform_main(%arg0: !transform.any_op {transform.readonly}) {
146146
%matmul = transform.structured.match ops{["linalg.matmul"]} in %arg0 : (!transform.any_op) -> !transform.any_op
147-
%forall, %tiled = transform.structured.tile_using_forall %matmul num_threads [2, 3, 1] (mapping = [ #gpu.thread<y>, #gpu.thread<x>, #gpu.thread<z> ] )
147+
%tiled, %forall = transform.structured.tile_using_forall %matmul num_threads [2, 3, 1] (mapping = [ #gpu.thread<y>, #gpu.thread<x>, #gpu.thread<z> ] )
148148
: (!transform.any_op) -> (!transform.any_op, !transform.any_op)
149149
%funcop = transform.structured.match ops{["gpu.launch"]} in %arg0 : (!transform.any_op) -> !transform.any_op
150150
// expected-error @below {{only bufferized scf.forall can be mapped}}

mlir/test/Dialect/Linalg/tile-to-forall.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ module attributes {transform.with_named_sequence} {
389389
module attributes {transform.with_named_sequence} {
390390
transform.named_sequence @__transform_main(%arg1: !transform.any_op {transform.readonly}) {
391391
%0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
392-
%forall, %tiled_generic = transform.structured.tile_using_forall %0 num_threads [7]
392+
%tiled_generic, %forall = transform.structured.tile_using_forall %0 num_threads [7]
393393
: (!transform.any_op) -> (!transform.any_op, !transform.any_op)
394394
transform.yield
395395
}
@@ -445,7 +445,7 @@ module attributes {transform.with_named_sequence} {
445445
module attributes {transform.with_named_sequence} {
446446
transform.named_sequence @__transform_main(%IN_MAT2: !transform.any_op {transform.readonly}) {
447447
%0 = transform.structured.match ops{["linalg.generic"]} in %IN_MAT2 : (!transform.any_op) -> !transform.any_op
448-
%forall, %tiled_generic = transform.structured.tile_using_forall %0 num_threads [4]
448+
%tiled_generic, %forall = transform.structured.tile_using_forall %0 num_threads [4]
449449
: (!transform.any_op) -> (!transform.any_op, !transform.any_op)
450450
transform.yield
451451
}

mlir/test/Examples/transform/Ch1/invalidation-1.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ transform.sequence failures(propagate) {
1919
%arg2: !transform.op<"linalg.elemwise_binary">):
2020
// The actual tiling transformation takes tile sizes as attributes.
2121
// expected-note @below {{invalidated by this transform op that consumes its operand #0 and invalidates all handles to payload IR entities associated with this operand and entities nested in them}}
22-
%loop, %tiled = transform.structured.tile_using_forall %arg1 tile_sizes [4, 32]
22+
%tiled, %loop = transform.structured.tile_using_forall %arg1 tile_sizes [4, 32]
2323
: (!transform.op<"linalg.matmul">) -> (!transform.any_op, !transform.any_op)
2424

2525
// This is trying to use an invalidated handle leading to undefined behavior.
@@ -64,7 +64,7 @@ transform.sequence failures(propagate) {
6464

6565
// The actual tiling transformation takes tile sizes as attributes.
6666
// expected-note @below {{invalidated by this transform op that consumes its operand #0 and invalidates all handles to payload IR entities associated with this operand and entities nested in them}}
67-
%loop, %tiled = transform.structured.tile_using_forall %arg1 tile_sizes [4, 32]
67+
%tiled, %loop = transform.structured.tile_using_forall %arg1 tile_sizes [4, 32]
6868
: (!transform.op<"linalg.matmul">) -> (!transform.any_op, !transform.any_op)
6969

7070
// Consuming an operand invalidates the consumed handle and any other handle that is

0 commit comments

Comments
 (0)