Skip to content

Commit 390a8e6

Browse files
committed
Modify transform-op-hoist-pad/transform-op-hoist-pad-build-packing-loop-nest.mlir:
The change to not slice when tiling with domain size caused a tensor.extract_slice on %arg1 to disappear. The previous tensor.extract_slice was actually a noop: %extracted_slice_1 = tensor.extract_slice %arg1[0, 0] [12, 25] [1, 1] : tensor<12x25xf32> to tensor<12x25xf32> while %arg1 is defined as: %arg1: tensor<12x25xf32> Since the second operand of the matmul is no longer an extract slice but a block argument the emitted error message also changed.
1 parent e895262 commit 390a8e6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

mlir/test/Dialect/Linalg/transform-op-hoist-pad-build-packing-loop-nest.mlir

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ func.func @pad_and_hoist_rhs(
66
%arg0: tensor<24x12xf32>, %arg1: tensor<12x25xf32>, %arg2: tensor<24x25xf32>)
77
-> tensor<24x25xf32>
88
{
9+
// expected-note @below {{target op}}
910
%0 = linalg.matmul ins(%arg0, %arg1 : tensor<24x12xf32>, tensor<12x25xf32>) outs(%arg2 : tensor<24x25xf32>) -> tensor<24x25xf32>
1011
func.return %0 : tensor<24x25xf32>
1112
}
@@ -24,10 +25,11 @@ module attributes {transform.with_named_sequence} {
2425

2526
// In this case, the pad op is actually empty: we only tile the first dimension
2627
// and it does not have an impact on the RHS operand.
28+
// expected-error @below {{could not find a producer for operand number: 1}}
2729
%pad = transform.get_producer_of_operand %matmul_padded[1]
2830
: (!transform.any_op) -> !transform.any_op
2931

30-
// expected-error @below {{requires exactly 2 non-null handles}}
32+
// We do not even reach this transform op.
3133
transform.structured.hoist_pad.build_packing_loop_nest %pad above %loops_l1
3234
: (!transform.any_op, !transform.any_op) -> !transform.any_op
3335
transform.yield

mlir/test/Dialect/Linalg/transform-op-hoist-pad.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ func.func @pad_and_hoist_rhs(
44
%arg0: tensor<24x12xf32>, %arg1: tensor<12x25xf32>, %arg2: tensor<24x25xf32>)
55
-> tensor<24x25xf32>
66
{
7-
// expected-note @below {{payload operation}}
7+
// expected-note @below {{target op}}
88
%0 = linalg.matmul ins(%arg0, %arg1 : tensor<24x12xf32>, tensor<12x25xf32>) outs(%arg2 : tensor<24x25xf32>) -> tensor<24x25xf32>
99
func.return %0 : tensor<24x25xf32>
1010
}
@@ -25,7 +25,7 @@ module attributes {transform.with_named_sequence} {
2525

2626
// In this case, the pad op is actually empty: we only tile the first dimension
2727
// and it does not have an impact on the RHS operand.
28-
// expected-error @below {{incompatible payload operation name}}
28+
// expected-error @below {{could not find a producer for operand number: 1}}
2929
%pad = transform.get_producer_of_operand %matmul_padded[1]
3030
: (!transform.any_op) -> !transform.op<"tensor.pad">
3131

0 commit comments

Comments
 (0)