}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.conv_2d_nhwc_hwcf"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.conv_2d_nhwc_hwcf"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error@below {{failed to apply}}
- %1:2 = transform.structured.convert_conv2d_to_img2col %0 : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
+ %1:2 = transform.structured.convert_conv2d_to_img2col %0 : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.conv_2d_nhwc_hwcf"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %img2col_tensor_producer, %transformed = transform.structured.convert_conv2d_to_img2col %0 : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
- transform.print %img2col_tensor_producer {name = "tensor_producer"}: !pdl.operation
- transform.print %transformed {name = "transformed"}: !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.conv_2d_nhwc_hwcf"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %img2col_tensor_producer, %transformed = transform.structured.convert_conv2d_to_img2col %0 : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
+ transform.print %img2col_tensor_producer {name = "tensor_producer"}: !transform.any_op
+ transform.print %transformed {name = "transformed"}: !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.depthwise_conv_2d_nhwc_hwc"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1:2 = transform.structured.convert_conv2d_to_img2col %0 : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.depthwise_conv_2d_nhwc_hwc"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1:2 = transform.structured.convert_conv2d_to_img2col %0 : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.conv_2d_nhwc_hwcf"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1:2 = transform.structured.convert_conv2d_to_img2col %0 : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.conv_2d_nhwc_hwcf"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1:2 = transform.structured.convert_conv2d_to_img2col %0 : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.conv_2d_nchw_fchw"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1:2 = transform.structured.convert_conv2d_to_img2col %0 : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.conv_2d_nchw_fchw"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1:2 = transform.structured.convert_conv2d_to_img2col %0 : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.conv_2d_nhwc_hwcf"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %img2col_tensor_producer, %transformed = transform.structured.convert_conv2d_to_img2col %0 : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
- transform.print %img2col_tensor_producer {name = "tensor_producer"}: !pdl.operation
- transform.print %transformed {name = "transformed"}: !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.conv_2d_nhwc_hwcf"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %img2col_tensor_producer, %transformed = transform.structured.convert_conv2d_to_img2col %0 : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
+ transform.print %img2col_tensor_producer {name = "tensor_producer"}: !transform.any_op
+ transform.print %transformed {name = "transformed"}: !transform.any_op
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["func.func"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.hoist_redundant_vector_transfers %0
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["func.func"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.hoist_redundant_vector_transfers %0
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["func.func"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.hoist_redundant_vector_transfers %0
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["func.func"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.hoist_redundant_tensor_subsets %0
- : (!pdl.operation) -> ()
+ : (!transform.any_op) -> ()
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["func.func"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.hoist_redundant_tensor_subsets %0
- : (!pdl.operation) -> ()
+ : (!transform.any_op) -> ()
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["func.func"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.hoist_redundant_tensor_subsets %0
- : (!pdl.operation) -> ()
+ : (!transform.any_op) -> ()
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["func.func"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.hoist_redundant_tensor_subsets %0
- : (!pdl.operation) -> ()
+ : (!transform.any_op) -> ()
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["func.func"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.hoist_redundant_tensor_subsets %0
- : (!pdl.operation) -> ()
+ : (!transform.any_op) -> ()
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["func.func"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.hoist_redundant_vector_transfers %0
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
// This implements a 2D multisize tiling with target sizes [3, 10].
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1:3 = transform.structured.multitile_sizes %0 { dimension = 0, target_size = 3} : (!pdl.operation) -> !pdl.operation
- %t:3 = transform.structured.multitile_sizes %0 { dimension = 1, target_size = 10} : (!pdl.operation) -> !pdl.operation
- %2:2 = transform.structured.split %0 after %1#2 { dimension = 0 } : !pdl.operation, !pdl.operation
- %3:2 = transform.structured.tile %2#0 [%1#0] : (!pdl.operation, !pdl.operation) -> (!pdl.operation, !pdl.operation)
- %4:2 = transform.structured.tile %2#1 [%1#1] : (!pdl.operation, !pdl.operation) -> (!pdl.operation, !pdl.operation)
- %5 = merge_handles %3#0, %4#0 : !pdl.operation
- %tt:3 = replicate num(%5) %t#0, %t#1, %t#2 : !pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation
- %6:2 = transform.structured.split %5 after %tt#2 { dimension = 1 } : !pdl.operation, !pdl.operation
- transform.structured.tile %6#0 [0, %tt#0] : (!pdl.operation, !pdl.operation) -> (!pdl.operation, !pdl.operation)
- transform.structured.tile %6#1 [0, %tt#1] : (!pdl.operation, !pdl.operation) -> (!pdl.operation, !pdl.operation)
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1:3 = transform.structured.multitile_sizes %0 { dimension = 0, target_size = 3} : (!transform.any_op) -> !transform.any_op
+ %t:3 = transform.structured.multitile_sizes %0 { dimension = 1, target_size = 10} : (!transform.any_op) -> !transform.any_op
+ %2:2 = transform.structured.split %0 after %1#2 { dimension = 0 } : !transform.any_op, !transform.any_op
+ %3:2 = transform.structured.tile %2#0 [%1#0] : (!transform.any_op, !transform.any_op) -> (!transform.any_op, !transform.any_op)
+ %4:2 = transform.structured.tile %2#1 [%1#1] : (!transform.any_op, !transform.any_op) -> (!transform.any_op, !transform.any_op)
+ %5 = merge_handles %3#0, %4#0 : !transform.any_op
+ %tt:3 = replicate num(%5) %t#0, %t#1, %t#2 : !transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op
+ %6:2 = transform.structured.split %5 after %tt#2 { dimension = 1 } : !transform.any_op, !transform.any_op
+ transform.structured.tile %6#0 [0, %tt#0] : (!transform.any_op, !transform.any_op) -> (!transform.any_op, !transform.any_op)
+ transform.structured.tile %6#1 [0, %tt#1] : (!transform.any_op, !transform.any_op) -> (!transform.any_op, !transform.any_op)
}
func.func private @elem(%arg0: f32, %arg1: index, %arg2: index) -> f32
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1:3 = transform.structured.multitile_sizes %0 { dimension = 0, target_size = 3} : (!pdl.operation) -> !transform.param<i64>
- %t:3 = transform.structured.multitile_sizes %0 { dimension = 1, target_size = 10} : (!pdl.operation) -> !transform.param<i64>
- %2:2 = transform.structured.split %0 after %1#2 { dimension = 0 } : !pdl.operation, !transform.param<i64>
- %3:2 = transform.structured.tile %2#0 [%1#0] : (!pdl.operation, !transform.param<i64>) -> (!pdl.operation, !pdl.operation)
- %4:2 = transform.structured.tile %2#1 [%1#1] : (!pdl.operation, !transform.param<i64>) -> (!pdl.operation, !pdl.operation)
- %5 = merge_handles %3#0, %4#0 : !pdl.operation
- %tt:3 = replicate num(%5) %t#0, %t#1, %t#2 : !pdl.operation, !transform.param<i64>, !transform.param<i64>, !transform.param<i64>
- %6:2 = transform.structured.split %5 after %tt#2 { dimension = 1 } : !pdl.operation, !transform.param<i64>
- transform.structured.tile %6#0 [0, %tt#0] : (!pdl.operation, !transform.param<i64>) -> (!pdl.operation, !pdl.operation)
- transform.structured.tile %6#1 [0, %tt#1] : (!pdl.operation, !transform.param<i64>) -> (!pdl.operation, !pdl.operation)
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1:3 = transform.structured.multitile_sizes %0 { dimension = 0, target_size = 3} : (!transform.any_op) -> !transform.param<i64>
+ %t:3 = transform.structured.multitile_sizes %0 { dimension = 1, target_size = 10} : (!transform.any_op) -> !transform.param<i64>
+ %2:2 = transform.structured.split %0 after %1#2 { dimension = 0 } : !transform.any_op, !transform.param<i64>
+ %3:2 = transform.structured.tile %2#0 [%1#0] : (!transform.any_op, !transform.param<i64>) -> (!transform.any_op, !transform.any_op)
+ %4:2 = transform.structured.tile %2#1 [%1#1] : (!transform.any_op, !transform.param<i64>) -> (!transform.any_op, !transform.any_op)
+ %5 = merge_handles %3#0, %4#0 : !transform.any_op
+ %tt:3 = replicate num(%5) %t#0, %t#1, %t#2 : !transform.any_op, !transform.param<i64>, !transform.param<i64>, !transform.param<i64>
+ %6:2 = transform.structured.split %5 after %tt#2 { dimension = 1 } : !transform.any_op, !transform.param<i64>
+ transform.structured.tile %6#0 [0, %tt#0] : (!transform.any_op, !transform.param<i64>) -> (!transform.any_op, !transform.any_op)
+ transform.structured.tile %6#1 [0, %tt#1] : (!transform.any_op, !transform.param<i64>) -> (!transform.any_op, !transform.any_op)
}
func.func private @elem(%arg0: f32, %arg1: index, %arg2: index) -> f32
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.conv_2d"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loop:2 = transform.structured.tile %0 [2, 3] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation)
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.conv_2d"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loop:2 = transform.structured.tile %0 [2, 3] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK: func @conv
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loop = transform.structured.tile %0 [10] : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loop = transform.structured.tile %0 [10] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// TILE-10n25-DAG: [[$MAP:#[a-zA-Z0-9_]*]] = affine_map<(d0, d1) -> (d0 + d1)>
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loop:2 = transform.structured.tile %0 [10, 25] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation)
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loop:2 = transform.structured.tile %0 [10, 25] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// TILE-10n25-DAG: [[$MAP:#[a-zA-Z0-9_]*]] = affine_map<(d0, d1) -> (d0 + d1)>
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:3 = transform.structured.tile %0 [2, 3, 4] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:3 = transform.structured.tile %0 [2, 3, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:3 = transform.structured.tile %0 [2, 3, 4] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:3 = transform.structured.tile %0 [2, 3, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK-LABEL: func @generic_op_tensors
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:3 = transform.structured.tile %0 [2, 3, 4] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:3 = transform.structured.tile %0 [2, 3, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
+^bb1(%module_op: !transform.any_op):
%pack = transform.structured.match ops{["tensor.pack"]} in %module_op
- : (!pdl.operation) -> !transform.op<"tensor.pack">
+ : (!transform.any_op) -> !transform.op<"tensor.pack">
transform.structured.lower_pack %pack : (!transform.op<"tensor.pack">)
-> (!transform.op<"tensor.pad">, !transform.op<"tensor.expand_shape">, !transform.op<"linalg.transpose">)
}
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
+^bb1(%module_op: !transform.any_op):
%pack = transform.structured.match ops{["tensor.pack"]} in %module_op
- : (!pdl.operation) -> !transform.op<"tensor.pack">
+ : (!transform.any_op) -> !transform.op<"tensor.pack">
transform.structured.lower_pack %pack : (!transform.op<"tensor.pack">)
-> (!transform.op<"tensor.pad">, !transform.op<"tensor.expand_shape">, !transform.op<"linalg.transpose">)
}
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
+^bb1(%module_op: !transform.any_op):
%pack = transform.structured.match ops{["tensor.pack"]} in %module_op
- : (!pdl.operation) -> !transform.op<"tensor.pack">
+ : (!transform.any_op) -> !transform.op<"tensor.pack">
transform.structured.lower_pack %pack : (!transform.op<"tensor.pack">)
-> (!transform.op<"tensor.pad">, !transform.op<"tensor.expand_shape">, !transform.op<"linalg.transpose">)
}
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
+^bb1(%module_op: !transform.any_op):
%pack = transform.structured.match ops{["tensor.pack"]} in %module_op
- : (!pdl.operation) -> !transform.op<"tensor.pack">
+ : (!transform.any_op) -> !transform.op<"tensor.pack">
transform.structured.lower_pack %pack : (!transform.op<"tensor.pack">)
-> (!transform.op<"tensor.pad">, !transform.op<"tensor.expand_shape">, !transform.op<"linalg.transpose">)
}
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
+^bb1(%module_op: !transform.any_op):
%unpack = transform.structured.match ops{["tensor.unpack"]} in %module_op
- : (!pdl.operation) -> !transform.op<"tensor.unpack">
+ : (!transform.any_op) -> !transform.op<"tensor.unpack">
transform.structured.lower_unpack %unpack : (!transform.op<"tensor.unpack">)
-> (!transform.op<"tensor.empty">,
!transform.op<"linalg.transpose">,
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
+^bb1(%module_op: !transform.any_op):
%unpack = transform.structured.match ops{["tensor.unpack"]} in %module_op
- : (!pdl.operation) -> !transform.op<"tensor.unpack">
+ : (!transform.any_op) -> !transform.op<"tensor.unpack">
transform.structured.lower_unpack %unpack : (!transform.op<"tensor.unpack">)
-> (!transform.op<"tensor.empty">,
!transform.op<"linalg.transpose">,
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
+^bb1(%module_op: !transform.any_op):
%pack = transform.structured.match ops{["tensor.pack"]} in %module_op
- : (!pdl.operation) -> !transform.op<"tensor.pack">
+ : (!transform.any_op) -> !transform.op<"tensor.pack">
transform.structured.lower_pack %pack : (!transform.op<"tensor.pack">)
-> (!transform.op<"tensor.pad">, !transform.op<"tensor.expand_shape">, !transform.op<"linalg.transpose">)
}
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
+^bb1(%module_op: !transform.any_op):
%pack = transform.structured.match ops{["tensor.pack"]} in %module_op
- : (!pdl.operation) -> !transform.op<"tensor.pack">
+ : (!transform.any_op) -> !transform.op<"tensor.pack">
transform.structured.lower_pack %pack : (!transform.op<"tensor.pack">)
-> (!transform.op<"tensor.pad">, !transform.op<"tensor.expand_shape">, !transform.op<"linalg.transpose">)
}
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
+^bb1(%module_op: !transform.any_op):
%pack = transform.structured.match ops{["tensor.pack"]} in %module_op
- : (!pdl.operation) -> !transform.op<"tensor.pack">
+ : (!transform.any_op) -> !transform.op<"tensor.pack">
transform.structured.lower_pack %pack : (!transform.op<"tensor.pack">)
-> (!transform.op<"tensor.pad">, !transform.op<"tensor.expand_shape">, !transform.op<"linalg.transpose">)
}
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
+^bb1(%module_op: !transform.any_op):
%pack = transform.structured.match ops{["tensor.pack"]} in %module_op
- : (!pdl.operation) -> !transform.op<"tensor.pack">
+ : (!transform.any_op) -> !transform.op<"tensor.pack">
transform.structured.lower_pack %pack : (!transform.op<"tensor.pack">)
-> (!transform.op<"tensor.pad">, !transform.op<"tensor.expand_shape">, !transform.op<"linalg.transpose">)
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.get_result %0[0] : (!pdl.operation) -> !transform.any_value
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.get_result %0[0] : (!transform.any_op) -> !transform.any_value
%2 = transform.structured.bufferize_to_allocation %1
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.get_result %0[0] : (!pdl.operation) -> !transform.any_value
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.get_result %0[0] : (!transform.any_op) -> !transform.any_value
%2 = transform.structured.bufferize_to_allocation %1
// Make sure that One-Shot Bufferize can bufferize the rest.
- %3 = transform.bufferization.one_shot_bufferize %arg1 : (!pdl.operation) -> !pdl.operation
+ %3 = transform.bufferization.one_shot_bufferize %arg1 : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.extract"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = test_produce_value_handle_to_argument_of_parent_block %0, 0 : (!pdl.operation) -> !transform.any_value
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.extract"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = test_produce_value_handle_to_argument_of_parent_block %0, 0 : (!transform.any_op) -> !transform.any_value
%2 = transform.structured.bufferize_to_allocation %1 {memory_space = 4}
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.extract"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = test_produce_value_handle_to_argument_of_parent_block %0, 0 : (!pdl.operation) -> !transform.any_value
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.extract"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = test_produce_value_handle_to_argument_of_parent_block %0, 0 : (!transform.any_op) -> !transform.any_value
%2 = transform.structured.bufferize_to_allocation %1 {memory_space = 4}
// Make sure that One-Shot Bufferize can bufferize the rest.
- %3 = transform.bufferization.one_shot_bufferize %arg1 : (!pdl.operation) -> !pdl.operation
+ %3 = transform.bufferization.one_shot_bufferize %arg1 : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["dummy.some_op"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.get_result %0[0] : (!pdl.operation) -> !transform.any_value
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["dummy.some_op"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.get_result %0[0] : (!transform.any_op) -> !transform.any_value
%2 = transform.structured.bufferize_to_allocation %1 {memory_space = 4}
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %match_name = transform.structured.match ops{["arith.constant"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.test_print_remark_at_operand %match_name, "matched op name" : !pdl.operation
- transform.test_consume_operand %match_name : !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %match_name = transform.structured.match ops{["arith.constant"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.test_print_remark_at_operand %match_name, "matched op name" : !transform.any_op
+ transform.test_consume_operand %match_name : !transform.any_op
- %match_attr = transform.structured.match ops{["arith.constant"]} attributes{my_attr} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.test_print_remark_at_operand %match_attr, "matched attr name" : !pdl.operation
- transform.test_consume_operand %match_attr : !pdl.operation
+ %match_attr = transform.structured.match ops{["arith.constant"]} attributes{my_attr} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.test_print_remark_at_operand %match_attr, "matched attr name" : !transform.any_op
+ transform.test_consume_operand %match_attr : !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%match_name = transform.structured.match
- ops{["arith.constant"]} filter_result_type = f32 in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.test_print_remark_at_operand %match_name, "matched op name" : !pdl.operation
- transform.test_consume_operand %match_name : !pdl.operation
+ ops{["arith.constant"]} filter_result_type = f32 in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.test_print_remark_at_operand %match_name, "matched op name" : !transform.any_op
+ transform.test_consume_operand %match_name : !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%match_attr = transform.structured.match
ops{["linalg.generic"]}
attributes{iterator_types = [
#linalg.iterator_type<parallel>,
#linalg.iterator_type<parallel>,
#linalg.iterator_type<parallel>]}
- in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.test_print_remark_at_operand %match_attr, "matched complex attr" : !pdl.operation
- transform.test_consume_operand %match_attr : !pdl.operation
+ in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.test_print_remark_at_operand %match_attr, "matched complex attr" : !transform.any_op
+ transform.test_consume_operand %match_attr : !transform.any_op
%no_match = transform.structured.match
attributes{iterator_types = [
#linalg.iterator_type<parallel>,
#linalg.iterator_type<parallel>,
#linalg.iterator_type<reduction>]}
- in %arg1 : (!pdl.operation) -> !pdl.operation
+ in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-remark @below {{0}}
- transform.test_print_number_of_associated_payload_ir_ops %no_match
+ transform.test_print_number_of_associated_payload_ir_ops %no_match : !transform.any_op
}
// CHECK-DAG: #[[$MAP13:.+]] = affine_map<() -> (13)>
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.multitile_sizes %0 { target_size = 3, dimension = 0 } : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.multitile_sizes %0 { target_size = 3, dimension = 0 } : (!transform.any_op) -> !transform.any_op
}
// CHECK-LABEL: @multitile_sizes_static
// -----
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%low_tile, %high_tile, %split_point =
transform.structured.multitile_sizes %0 { target_size = 3, dimension = 0 }
- : (!pdl.operation) -> !transform.param<i64>
+ : (!transform.any_op) -> !transform.param<i64>
// expected-remark @below {{2 : i64}}
transform.test_print_param %low_tile : !transform.param<i64>
// expected-remark @below {{3 : i64}}
// -----
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.multitile_sizes %0 { target_size = 3, divisor = 2, dimension = 0 } : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.multitile_sizes %0 { target_size = 3, divisor = 2, dimension = 0 } : (!transform.any_op) -> !transform.any_op
}
// CHECK: #[[$MAP_A:.+]] = affine_map<()[s0] -> ([[A_IMPL:s0 floordiv 2]])>
// -----
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{cannot compute parametric tile sizes for dynamically shaped payload op}}
transform.structured.multitile_sizes %0 { target_size = 3, divisor = 2, dimension = 0 }
- : (!pdl.operation) -> !transform.param<i64>
+ : (!transform.any_op) -> !transform.param<i64>
}
func.func @multitile_sizes_dynamic_gen(
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["tensor.from_elements"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.rewrite_in_destination_passing_style %0
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["tensor.from_elements"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.rewrite_in_destination_passing_style %0
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["tensor.from_elements"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.rewrite_in_destination_passing_style %0
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["tensor.generate"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.rewrite_in_destination_passing_style %0
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["tensor.pad"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.rewrite_in_destination_passing_style %0
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["tensor.pad"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.rewrite_in_destination_passing_style %0
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["tensor.pad"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.rewrite_in_destination_passing_style %0
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["tensor.pad"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.rewrite_in_destination_passing_style %0
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
// RUN: mlir-opt %s --test-transform-dialect-interpreter --split-input-file -verify-diagnostics | FileCheck %s
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1:2 = transform.structured.split %0 after 42 { dimension = 0 } : !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1:2 = transform.structured.split %0 after 42 { dimension = 0 } : !transform.any_op
}
func.func private @elem(%arg0: f32, %arg1: index, %arg2: index) -> f32
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1:2 = transform.structured.split %0 after 42 { dimension = 0 } : !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1:2 = transform.structured.split %0 after 42 { dimension = 0 } : !transform.any_op
}
func.func private @elem(%arg0: f32, %arg1: index, %arg2: index) -> f32
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.match ops{["func.call"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.split %0 after %1 { dimension = 0 } : !pdl.operation, !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.match ops{["func.call"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.split %0 after %1 { dimension = 0 } : !transform.any_op, !transform.any_op
}
func.func private @get_size() -> index
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1:2 = transform.structured.split %0 after 4 { dimension = 0 } : !pdl.operation
- %2:2 = transform.structured.split %1#1 after 16 { dimension = 1 } : !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1:2 = transform.structured.split %0 after 4 { dimension = 0 } : !transform.any_op
+ %2:2 = transform.structured.split %1#1 after 16 { dimension = 1 } : !transform.any_op
}
func.func private @elem(%arg0: f32, %arg1: index, %arg2: index) -> f32
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
// expected-error @below {{expects either a dynamic or a static split point to be provided}}
- %0:2 = "transform.structured.split"(%arg1) { dimension = 1, static_split_point = -9223372036854775808 } : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
+ %0:2 = "transform.structured.split"(%arg1) { dimension = 1, static_split_point = -9223372036854775808 } : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.match ops{["func.call"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.match ops{["func.call"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{expected dynamic split point handle to point to a single-result index-typed op}}
- transform.structured.split %0 after %1 { dimension = 0 } : !pdl.operation, !pdl.operation
+ transform.structured.split %0 after %1 { dimension = 0 } : !transform.any_op, !transform.any_op
}
func.func private @get_size() -> i64
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.match ops{["func.call"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.match ops{["func.call"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{expected the dynamic split point handle to point to as many operations (0) as the target handle (1)}}
- transform.structured.split %0 after %1 { dimension = 0 } : !pdl.operation, !pdl.operation
+ transform.structured.split %0 after %1 { dimension = 0 } : !transform.any_op, !transform.any_op
}
func.func private @get_size() -> i64
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["func.return"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["func.return"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{only applies to structured ops}}
- transform.structured.split %0 after 16 { dimension = 1 } : !pdl.operation
+ transform.structured.split %0 after 16 { dimension = 1 } : !transform.any_op
}
func.func @noop(%arg0: tensor<100xf32>, %arg1: tensor<100xf32>) -> tensor<100xf32> {
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{dimension 1 does not exist in target op}}
- transform.structured.split %0 after 16 { dimension = 1 } : !pdl.operation
+ transform.structured.split %0 after 16 { dimension = 1 } : !transform.any_op
}
func.func @one_d_static(%arg0: tensor<100xf32>, %arg1: tensor<100xf32>) -> tensor<100xf32> {
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{splitting does not produce the second part for a subset of targets}}
// expected-note @below {{expected splitting to produce the second part of all or none of the targets}}
- %1:2 = transform.structured.split %0 after 142 { dimension = 0 } : !pdl.operation
+ %1:2 = transform.structured.split %0 after 142 { dimension = 0 } : !transform.any_op
}
func.func private @elem(%arg0: f32, %arg1: index, %arg2: index) -> f32
// RUN: mlir-opt --test-transform-dialect-interpreter --split-input-file --verify-diagnostics %s | FileCheck %s
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:3 = transform.structured.tile %0 [4, 4, 4] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:3 = transform.structured.tile %0 [4, 4, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK-LABEL: func @tile_linalg_matmul(
// -----
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.match ops{["func.call"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %2, %loops:3 = transform.structured.tile %0 [%1, %1, 4] : (!pdl.operation, !pdl.operation, !pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.match ops{["func.call"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %2, %loops:3 = transform.structured.tile %0 [%1, %1, 4] : (!transform.any_op, !transform.any_op, !transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
func.func private @get_dynamic_tile_size() -> index
// -----
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-note @below {{for this parameter}}
%1 = transform.test_produce_integer_param_with_type i64 : !transform.param<i64>
// expected-error @below {{expected as many parameter values (0) as target ops (2)}}
transform.structured.tile %0 [%1, %1, %1]
- : (!pdl.operation, !transform.param<i64>, !transform.param<i64>, !transform.param<i64>)
- -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
+ : (!transform.any_op, !transform.param<i64>, !transform.param<i64>, !transform.param<i64>)
+ -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
func.func @tile_linalg_matmul(
// -----
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-note @below {{for this handle}}
- %1 = transform.structured.match ops{["arith.constant"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ %1 = transform.structured.match ops{["arith.constant"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{expected as many dynamic size-producing operations (0) as target ops (2)}}
transform.structured.tile %0 [%1, %1, 1]
- : (!pdl.operation, !pdl.operation, !pdl.operation)
- -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
+ : (!transform.any_op, !transform.any_op, !transform.any_op)
+ -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
func.func @tile_linalg_matmul(
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
+^bb1(%module_op: !transform.any_op):
%matmul = transform.structured.match ops{["linalg.matmul"]} in %module_op
- : (!pdl.operation) -> !transform.op<"linalg.matmul">
+ : (!transform.any_op) -> !transform.op<"linalg.matmul">
transform.structured.pack_greedily %matmul
matmul_packed_sizes = [8, 16, 32] matmul_inner_dims_order = [1, 2, 0]
: (!transform.op<"linalg.matmul">) -> !transform.op<"linalg.generic">
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
- %generic = transform.structured.match ops{["linalg.generic"]} in %module_op : (!pdl.operation) -> !transform.op<"linalg.generic">
+^bb1(%module_op: !transform.any_op):
+ %generic = transform.structured.match ops{["linalg.generic"]} in %module_op : (!transform.any_op) -> !transform.op<"linalg.generic">
transform.structured.pack_greedily %generic
matmul_packed_sizes = [8, 16, 32] matmul_inner_dims_order = [1, 2, 0]
: (!transform.op<"linalg.generic">) -> !transform.op<"linalg.generic">
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
- %generic = transform.structured.match ops{["linalg.generic"]} in %module_op : (!pdl.operation) -> !transform.op<"linalg.generic">
+^bb1(%module_op: !transform.any_op):
+ %generic = transform.structured.match ops{["linalg.generic"]} in %module_op : (!transform.any_op) -> !transform.op<"linalg.generic">
transform.structured.pack_greedily %generic
matmul_packed_sizes = [8, 16, 32] matmul_inner_dims_order = [1, 2, 0]
: (!transform.op<"linalg.generic">) -> !transform.op<"linalg.generic">
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
- %generic = transform.structured.match ops{["linalg.generic"]} in %module_op : (!pdl.operation) -> !transform.op<"linalg.generic">
+^bb1(%module_op: !transform.any_op):
+ %generic = transform.structured.match ops{["linalg.generic"]} in %module_op : (!transform.any_op) -> !transform.op<"linalg.generic">
transform.structured.pack_greedily %generic
matmul_packed_sizes = [8, 16, 32] matmul_inner_dims_order = [1, 2, 0]
: (!transform.op<"linalg.generic">) -> !transform.op<"linalg.generic">
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
+^bb1(%module_op: !transform.any_op):
%conv = transform.structured.match ops{["linalg.conv_2d_nchw_fchw"]} in %module_op
- : (!pdl.operation) -> !transform.op<"linalg.conv_2d_nchw_fchw">
+ : (!transform.any_op) -> !transform.op<"linalg.conv_2d_nchw_fchw">
transform.structured.pack_greedily %conv
matmul_packed_sizes = [8, 16, 32] matmul_inner_dims_order = [1, 2, 0]
: (!transform.op<"linalg.conv_2d_nchw_fchw">) -> !transform.op<"linalg.generic">
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
- %generic = transform.structured.match ops{["linalg.generic"]} in %module_op : (!pdl.operation) -> !transform.op<"linalg.generic">
+^bb1(%module_op: !transform.any_op):
+ %generic = transform.structured.match ops{["linalg.generic"]} in %module_op : (!transform.any_op) -> !transform.op<"linalg.generic">
transform.structured.pack_greedily %generic
matmul_packed_sizes = [8, 16, 32] matmul_inner_dims_order = [1, 2, 0]
: (!transform.op<"linalg.generic">) -> !transform.op<"linalg.generic">
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
- %generic = transform.structured.match ops{["linalg.generic"]} in %module_op : (!pdl.operation) -> !transform.op<"linalg.generic">
+^bb1(%module_op: !transform.any_op):
+ %generic = transform.structured.match ops{["linalg.generic"]} in %module_op : (!transform.any_op) -> !transform.op<"linalg.generic">
transform.structured.pack_greedily %generic
// In this spec, the "k" dimension is not packed but rather padded to the
// next multiple of 10 (i.e. 130).
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !pdl.operation):
- %generic = transform.structured.match ops{["linalg.generic"]} in %module_op : (!pdl.operation) -> !transform.op<"linalg.generic">
+^bb1(%module_op: !transform.any_op):
+ %generic = transform.structured.match ops{["linalg.generic"]} in %module_op : (!transform.any_op) -> !transform.op<"linalg.generic">
transform.structured.pack_greedily %generic
// In this spec, the "n" dimension is neither packed not unpacked.
// We don't end up with an innermost matmul after packing but only with an
^bb1(%arg1: !transform.any_op):
// Find the root and all producers.
%root = transform.structured.match attributes{"__root__"} in %arg1 : (!transform.any_op) -> !transform.any_op
- %producers = transform.structured.match attributes{"__producer__"} in %arg1 : (!transform.any_op) -> !pdl.operation
- %reversed_producers = transform.test_reverse_payload_ops %producers
+ %producers = transform.structured.match attributes{"__producer__"} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %reversed_producers = transform.test_reverse_payload_ops %producers : (!transform.any_op) -> !transform.any_op
// Tile the root.
%forall_op, %tiled_op = transform.structured.tile_to_forall_op %root num_threads [10, 20]
// Fuse all producers.
transform.structured.fuse_into_containing_op %reversed_producers into %forall_op
- : (!pdl.operation, !transform.any_op) -> !transform.any_op
+ : (!transform.any_op, !transform.any_op) -> !transform.any_op
}
}
func.func private @bar()
transform.with_pdl_patterns {
- ^bb0(%arg0: !pdl.operation):
+ ^bb0(%arg0: !transform.any_op):
pdl.pattern @func : benefit(1) {
%0 = pdl.operands
%1 = pdl.types
pdl.rewrite %2 with "transform.dialect"
}
- transform.sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = pdl_match @func in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = replicate num(%0) %arg1 : !pdl.operation, !pdl.operation
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
+ %0 = pdl_match @func in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = replicate num(%0) %arg1 : !transform.any_op, !transform.any_op
// expected-remark @below {{2}}
- test_print_number_of_associated_payload_ir_ops %1
- %2 = replicate num(%0) %1 : !pdl.operation, !pdl.operation
+ test_print_number_of_associated_payload_ir_ops %1 : !transform.any_op
+ %2 = replicate num(%0) %1 : !transform.any_op, !transform.any_op
// expected-remark @below {{4}}
- test_print_number_of_associated_payload_ir_ops %2
+ test_print_number_of_associated_payload_ir_ops %2 : !transform.any_op
}
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @const : benefit(1) {
%r = pdl.types
%0 = pdl.operation "arith.constant" -> (%r : !pdl.range<type>)
pdl.rewrite %0 with "transform.dialect"
}
- transform.sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %f = pdl_match @const in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.foreach %f : !pdl.operation {
- ^bb2(%arg2: !pdl.operation):
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ %f = pdl_match @const in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.foreach %f : !transform.any_op {
+ ^bb2(%arg2: !transform.any_op):
// expected-remark @below {{1}}
- transform.test_print_number_of_associated_payload_ir_ops %arg2
- transform.test_print_remark_at_operand %arg2, "transform applied" : !pdl.operation
+ transform.test_print_number_of_associated_payload_ir_ops %arg2 : !transform.any_op
+ transform.test_print_remark_at_operand %arg2, "transform applied" : !transform.any_op
}
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @const : benefit(1) {
%r = pdl.types
%0 = pdl.operation "arith.constant" -> (%r : !pdl.range<type>)
pdl.rewrite %0 with "transform.dialect"
}
- transform.sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %f = pdl_match @execute_region in %arg1 : (!pdl.operation) -> !pdl.operation
- %results = transform.foreach %f : !pdl.operation -> !pdl.operation {
- ^bb2(%arg2: !pdl.operation):
- %g = transform.pdl_match @const in %arg2 : (!pdl.operation) -> !pdl.operation
- transform.yield %g : !pdl.operation
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ %f = pdl_match @execute_region in %arg1 : (!transform.any_op) -> !transform.any_op
+ %results = transform.foreach %f : !transform.any_op -> !transform.any_op {
+ ^bb2(%arg2: !transform.any_op):
+ %g = transform.pdl_match @const in %arg2 : (!transform.any_op) -> !transform.any_op
+ transform.yield %g : !transform.any_op
}
// expected-remark @below {{3}}
- transform.test_print_number_of_associated_payload_ir_ops %results
- transform.test_print_remark_at_operand %results, "transform applied" : !pdl.operation
+ transform.test_print_number_of_associated_payload_ir_ops %results : !transform.any_op
+ transform.test_print_remark_at_operand %results, "transform applied" : !transform.any_op
}
}
}
transform.sequence failures(propagate) {
-^bb1(%fun: !pdl.operation):
- %muli = transform.structured.match ops{["arith.muli"]} in %fun : (!pdl.operation) -> !pdl.operation
- %h:2 = split_handle %muli : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
+^bb1(%fun: !transform.any_op):
+ %muli = transform.structured.match ops{["arith.muli"]} in %fun : (!transform.any_op) -> !transform.any_op
+ %h:2 = split_handle %muli : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
// expected-remark @below {{1}}
- transform.test_print_number_of_associated_payload_ir_ops %h#0
- %muli_2 = transform.structured.match ops{["arith.muli"]} in %fun : (!pdl.operation) -> !pdl.operation
+ transform.test_print_number_of_associated_payload_ir_ops %h#0 : !transform.any_op
+ %muli_2 = transform.structured.match ops{["arith.muli"]} in %fun : (!transform.any_op) -> !transform.any_op
// expected-error @below {{expected to contain 3 payload ops but it contains 2 payload ops}}
- %h_2:3 = split_handle %muli_2 : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation)
+ %h_2:3 = split_handle %muli_2 : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(suppress) {
-^bb1(%fun: !pdl.operation):
- %muli = transform.structured.match ops{["arith.muli"]} in %fun : (!pdl.operation) -> !pdl.operation
- %h:2 = split_handle %muli : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
+^bb1(%fun: !transform.any_op):
+ %muli = transform.structured.match ops{["arith.muli"]} in %fun : (!transform.any_op) -> !transform.any_op
+ %h:2 = split_handle %muli : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
// expected-remark @below {{1}}
- transform.test_print_number_of_associated_payload_ir_ops %h#0
- %muli_2 = transform.structured.match ops{["arith.muli"]} in %fun : (!pdl.operation) -> !pdl.operation
+ transform.test_print_number_of_associated_payload_ir_ops %h#0 : !transform.any_op
+ %muli_2 = transform.structured.match ops{["arith.muli"]} in %fun : (!transform.any_op) -> !transform.any_op
// Silenceable failure and all handles are now empty.
- %h_2:3 = split_handle %muli_2 : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation)
+ %h_2:3 = split_handle %muli_2 : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
// expected-remark @below {{0}}
- transform.test_print_number_of_associated_payload_ir_ops %h_2#0
+ transform.test_print_number_of_associated_payload_ir_ops %h_2#0 : !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%fun: !pdl.operation):
- %muli_2 = transform.structured.match ops{["arith.muli"]} in %fun : (!pdl.operation) -> !pdl.operation
+^bb1(%fun: !transform.any_op):
+ %muli_2 = transform.structured.match ops{["arith.muli"]} in %fun : (!transform.any_op) -> !transform.any_op
// No error, last result handle is empty.
- %h:3 = split_handle %muli_2 {fail_on_payload_too_small = false} : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation)
+ %h:3 = split_handle %muli_2 {fail_on_payload_too_small = false} : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
// expected-remark @below {{1}}
- transform.test_print_number_of_associated_payload_ir_ops %h#0
+ transform.test_print_number_of_associated_payload_ir_ops %h#0 : !transform.any_op
// expected-remark @below {{1}}
- transform.test_print_number_of_associated_payload_ir_ops %h#1
+ transform.test_print_number_of_associated_payload_ir_ops %h#1 : !transform.any_op
// expected-remark @below {{0}}
- transform.test_print_number_of_associated_payload_ir_ops %h#2
+ transform.test_print_number_of_associated_payload_ir_ops %h#2 : !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%fun: !pdl.operation):
- %muli_2 = transform.structured.match ops{["arith.muli"]} in %fun : (!pdl.operation) -> !pdl.operation
- %h:2 = split_handle %muli_2 {overflow_result = 0} : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
+^bb1(%fun: !transform.any_op):
+ %muli_2 = transform.structured.match ops{["arith.muli"]} in %fun : (!transform.any_op) -> !transform.any_op
+ %h:2 = split_handle %muli_2 {overflow_result = 0} : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
// expected-remark @below {{3}}
- transform.test_print_number_of_associated_payload_ir_ops %h#0
+ transform.test_print_number_of_associated_payload_ir_ops %h#0 : !transform.any_op
// expected-remark @below {{1}}
- transform.test_print_number_of_associated_payload_ir_ops %h#1
+ transform.test_print_number_of_associated_payload_ir_ops %h#1 : !transform.any_op
}
// -----
"other_dialect.other_op"() : () -> ()
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @some : benefit(1) {
%0 = pdl.operation "test.some_op"
pdl.rewrite %0 with "transform.dialect"
}
- sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = pdl_match @some in %arg1 : (!pdl.operation) -> !pdl.operation
- %2 = transform.cast %0 : !pdl.operation to !transform.test_dialect_op
- transform.cast %2 : !transform.test_dialect_op to !pdl.operation
+ sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ %0 = pdl_match @some in %arg1 : (!transform.any_op) -> !transform.any_op
+ %2 = transform.cast %0 : !transform.any_op to !transform.test_dialect_op
+ transform.cast %2 : !transform.test_dialect_op to !transform.any_op
}
}
return
}
-transform.sequence -> !pdl.operation failures(propagate) {
-^bb1(%fun: !pdl.operation):
- %muli = transform.structured.match ops{["arith.muli"]} in %fun : (!pdl.operation) -> !pdl.operation
+transform.sequence -> !transform.any_op failures(propagate) {
+^bb1(%fun: !transform.any_op):
+ %muli = transform.structured.match ops{["arith.muli"]} in %fun : (!transform.any_op) -> !transform.any_op
// expected-error @below {{expected to contain 3 payload ops but it contains 2 payload ops}}
- %h_2:3 = split_handle %muli : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation)
+ %h_2:3 = split_handle %muli : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
/// Test that yield does not crash in the presence of silenceable error in
/// propagate mode.
- yield %fun : !pdl.operation
+ yield %fun : !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["test.replace_me"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["test.replace_me"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-remark @below {{2 iterations}}
- transform.test_tracked_rewrite %0 : (!pdl.operation) -> ()
+ transform.test_tracked_rewrite %0 : (!transform.any_op) -> ()
// One replacement op (test.drop_mapping) is dropped from the mapping.
// expected-remark @below {{2}}
- test_print_number_of_associated_payload_ir_ops %0
+ test_print_number_of_associated_payload_ir_ops %0 : !transform.any_op
}
: Op<Transform_Dialect, "test_reverse_payload_ops",
[FunctionalStyleTransformOpTrait, MemoryEffectsOpInterface,
DeclareOpInterfaceMethods<TransformOpInterface>]> {
- let arguments = (ins PDL_Operation:$target);
- let results = (outs PDL_Operation:$result);
- let assemblyFormat = "$target attr-dict";
+ let arguments = (ins TransformHandleTypeInterface:$target);
+ let results = (outs TransformHandleTypeInterface:$result);
+ let assemblyFormat = "$target attr-dict `:` functional-type(operands, results)";
let cppNamespace = "::mlir::test";
}
: Op<Transform_Dialect, "test_print_number_of_associated_payload_ir_ops",
[DeclareOpInterfaceMethods<TransformOpInterface>,
DeclareOpInterfaceMethods<MemoryEffectsOpInterface>]> {
- let arguments = (ins PDL_Operation:$handle);
- let assemblyFormat = "$handle attr-dict";
+ let arguments = (ins TransformHandleTypeInterface:$handle);
+ let assemblyFormat = "$handle attr-dict `:` type($handle)";
let cppNamespace = "::mlir::test";
}