func.func @use_after_free_branching_control_flow() {
// expected-note @below {{allocated here}}
- %0 = transform.test_produce_self_handle_or_forward_operand
+ %0 = transform.test_produce_self_handle_or_forward_operand : () -> !transform.any_op
transform.test_transform_op_with_regions {
"transform.test_branching_transform_op_terminator"() : () -> ()
},
"transform.test_branching_transform_op_terminator"()[^bb1, ^bb2] : () -> ()
^bb1:
// expected-note @below {{freed here}}
- transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand"
+ transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
"transform.test_branching_transform_op_terminator"()[^bb3] : () -> ()
^bb2:
"transform.test_branching_transform_op_terminator"()[^bb3] : () -> ()
^bb3:
// expected-warning @below {{operand #0 may be used after free}}
- transform.sequence %0 : !pdl.operation failures(propagate) {
- ^bb0(%arg0: !pdl.operation):
+ transform.sequence %0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg0: !transform.any_op):
}
"transform.test_branching_transform_op_terminator"() : () -> ()
}
func.func @use_after_free_in_nested_op() {
// expected-note @below {{allocated here}}
- %0 = transform.test_produce_self_handle_or_forward_operand
+ %0 = transform.test_produce_self_handle_or_forward_operand : () -> !transform.any_op
// expected-note @below {{freed here}}
transform.test_transform_op_with_regions {
"transform.test_branching_transform_op_terminator"() : () -> ()
^bb0:
"transform.test_branching_transform_op_terminator"()[^bb1, ^bb2] : () -> ()
^bb1:
- transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand"
+ transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
"transform.test_branching_transform_op_terminator"()[^bb3] : () -> ()
^bb2:
"transform.test_branching_transform_op_terminator"()[^bb3] : () -> ()
"transform.test_branching_transform_op_terminator"() : () -> ()
}
// expected-warning @below {{operand #0 may be used after free}}
- transform.sequence %0 : !pdl.operation failures(propagate) {
- ^bb0(%arg0: !pdl.operation):
+ transform.sequence %0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg0: !transform.any_op):
}
return
}
func.func @use_after_free_recursive_side_effects() {
transform.sequence failures(propagate) {
- ^bb0(%arg0: !pdl.operation):
+ ^bb0(%arg0: !transform.any_op):
// expected-note @below {{allocated here}}
- %0 = transform.sequence %arg0 : !pdl.operation -> !pdl.operation failures(propagate) attributes { ord = 1 } {
- ^bb1(%arg1: !pdl.operation):
- yield %arg1 : !pdl.operation
+ %0 = transform.sequence %arg0 : !transform.any_op -> !transform.any_op failures(propagate) attributes { ord = 1 } {
+ ^bb1(%arg1: !transform.any_op):
+ yield %arg1 : !transform.any_op
}
- transform.sequence %0 : !pdl.operation failures(propagate) attributes { ord = 2 } {
- ^bb2(%arg2: !pdl.operation):
+ transform.sequence %0 : !transform.any_op failures(propagate) attributes { ord = 2 } {
+ ^bb2(%arg2: !transform.any_op):
}
- transform.sequence %0 : !pdl.operation failures(propagate) attributes { ord = 3 } {
- ^bb3(%arg3: !pdl.operation):
+ transform.sequence %0 : !transform.any_op failures(propagate) attributes { ord = 3 } {
+ ^bb3(%arg3: !transform.any_op):
}
// `transform.sequence` has recursive side effects so it has the same "free"
// as the child op it contains.
// expected-note @below {{freed here}}
- transform.sequence %0 : !pdl.operation failures(propagate) attributes { ord = 4 } {
- ^bb4(%arg4: !pdl.operation):
- test_consume_operand_of_op_kind_or_fail %0, "transform.sequence"
+ transform.sequence %0 : !transform.any_op failures(propagate) attributes { ord = 4 } {
+ ^bb4(%arg4: !transform.any_op):
+ test_consume_operand_of_op_kind_or_fail %0, "transform.sequence" : !transform.any_op
}
// expected-warning @below {{operand #0 may be used after free}}
- transform.sequence %0 : !pdl.operation failures(propagate) attributes { ord = 5 } {
- ^bb3(%arg3: !pdl.operation):
+ transform.sequence %0 : !transform.any_op failures(propagate) attributes { ord = 5 } {
+ ^bb3(%arg3: !transform.any_op):
}
}
return
func.func @use_after_free() {
transform.sequence failures(propagate) {
- ^bb0(%arg0: !pdl.operation):
+ ^bb0(%arg0: !transform.any_op):
// expected-note @below {{allocated here}}
- %0 = transform.sequence %arg0 : !pdl.operation -> !pdl.operation failures(propagate) attributes { ord = 1 } {
- ^bb1(%arg1: !pdl.operation):
- yield %arg1 : !pdl.operation
+ %0 = transform.sequence %arg0 : !transform.any_op -> !transform.any_op failures(propagate) attributes { ord = 1 } {
+ ^bb1(%arg1: !transform.any_op):
+ yield %arg1 : !transform.any_op
}
- transform.sequence %0 : !pdl.operation failures(propagate) attributes { ord = 2 } {
- ^bb2(%arg2: !pdl.operation):
+ transform.sequence %0 : !transform.any_op failures(propagate) attributes { ord = 2 } {
+ ^bb2(%arg2: !transform.any_op):
}
- transform.sequence %0 : !pdl.operation failures(propagate) attributes { ord = 3 } {
- ^bb3(%arg3: !pdl.operation):
+ transform.sequence %0 : !transform.any_op failures(propagate) attributes { ord = 3 } {
+ ^bb3(%arg3: !transform.any_op):
}
// expected-note @below {{freed here}}
- test_consume_operand_of_op_kind_or_fail %0, "transform.sequence"
+ test_consume_operand_of_op_kind_or_fail %0, "transform.sequence" : !transform.any_op
// expected-warning @below {{operand #0 may be used after free}}
- transform.sequence %0 : !pdl.operation failures(propagate) attributes { ord = 5 } {
- ^bb3(%arg3: !pdl.operation):
+ transform.sequence %0 : !transform.any_op failures(propagate) attributes { ord = 5 } {
+ ^bb3(%arg3: !transform.any_op):
}
}
return
// be reported as use-after-free.
func.func @use_after_free_self_cycle() {
// expected-note @below {{allocated here}}
- %0 = transform.test_produce_self_handle_or_forward_operand
+ %0 = transform.test_produce_self_handle_or_forward_operand : () -> !transform.any_op
transform.test_transform_op_with_regions {
"transform.test_branching_transform_op_terminator"() : () -> ()
},
"transform.test_branching_transform_op_terminator"()[^bb1] : () -> ()
^bb1:
// expected-warning @below {{operand #0 may be used after free}}
- transform.sequence %0 : !pdl.operation failures(propagate) {
- ^bb0(%arg0: !pdl.operation):
+ transform.sequence %0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg0: !transform.any_op):
}
// expected-warning @below {{operand #0 may be used after free}}
// expected-note @below {{freed here}}
- transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand"
+ transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
"transform.test_branching_transform_op_terminator"()[^bb1, ^bb2] : () -> ()
^bb2:
"transform.test_branching_transform_op_terminator"() : () -> ()
// use-after-free.
func.func @use_after_free_cycle() {
// expected-note @below {{allocated here}}
- %0 = transform.test_produce_self_handle_or_forward_operand
+ %0 = transform.test_produce_self_handle_or_forward_operand : () -> !transform.any_op
transform.test_transform_op_with_regions {
"transform.test_branching_transform_op_terminator"() : () -> ()
},
^bb1:
// expected-warning @below {{operand #0 may be used after free}}
// expected-note @below {{freed here}}
- transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand"
+ transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
"transform.test_branching_transform_op_terminator"()[^bb2, ^bb3] : () -> ()
^bb2:
"transform.test_branching_transform_op_terminator"()[^bb1] : () -> ()
// This should not crash.
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
- alternatives %arg0 : !pdl.operation {
- ^bb0(%arg1: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
+ alternatives %arg0 : !transform.any_op {
+ ^bb0(%arg1: !transform.any_op):
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @return : benefit(1) {
%0 = operands
%1 = types
rewrite %2 with "transform.dialect"
}
- sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
+ sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
// expected-note @below {{handle to invalidated ops}}
- %0 = pdl_match @return in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
+ %0 = pdl_match @return in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = get_closest_isolated_parent %0 : (!transform.any_op) -> !transform.any_op
// expected-note @below {{invalidated by this transform op that consumes its operand #0}}
- test_consume_operand %1 : !pdl.operation
+ test_consume_operand %1 : !transform.any_op
// expected-error @below {{op uses a handle invalidated by a previously executed transform op}}
- test_print_remark_at_operand %0, "remark" : !pdl.operation
+ test_print_remark_at_operand %0, "remark" : !transform.any_op
}
}
func.func private @func2()
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @func : benefit(1) {
%0 = operands
%1 = types
rewrite %2 with "transform.dialect"
}
- sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = pdl_match @func in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = pdl_match @return in %arg1 : (!pdl.operation) -> !pdl.operation
- %2 = replicate num(%0) %1 : !pdl.operation, !pdl.operation
+ sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ %0 = pdl_match @func in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = pdl_match @return in %arg1 : (!transform.any_op) -> !transform.any_op
+ %2 = replicate num(%0) %1 : !transform.any_op, !transform.any_op
// expected-error @below {{a handle passed as operand #0 and consumed by this operation points to a payload entity more than once}}
- test_consume_operand %2 : !pdl.operation
- test_print_remark_at_operand %0, "remark" : !pdl.operation
+ test_consume_operand %2 : !transform.any_op
+ test_print_remark_at_operand %0, "remark" : !transform.any_op
}
}
module {
transform.sequence failures(propagate) {
- ^bb0(%0: !pdl.operation):
- %1 = transform.test_copy_payload %0
+ ^bb0(%0: !transform.any_op):
+ %1 = transform.test_copy_payload %0 : (!transform.any_op) -> !transform.any_op
// expected-note @below {{handle to invalidated ops}}
- %2 = transform.test_copy_payload %0
+ %2 = transform.test_copy_payload %0 : (!transform.any_op) ->!transform.any_op
// expected-note @below {{invalidated by this transform op that consumes its operand #0}}
- transform.test_consume_operand %1 : !pdl.operation
+ transform.test_consume_operand %1 : !transform.any_op
// expected-error @below {{op uses a handle invalidated by a previously executed transform op}}
- transform.test_consume_operand %2 : !pdl.operation
+ transform.test_consume_operand %2 : !transform.any_op
}
}
module {
transform.sequence failures(propagate) {
- ^bb0(%0: !pdl.operation):
- %1 = transform.test_copy_payload %0
+ ^bb0(%0: !transform.any_op):
+ %1 = transform.test_copy_payload %0 : (!transform.any_op) -> !transform.any_op
// expected-note @below {{handle to invalidated ops}}
- %2 = transform.test_copy_payload %0
+ %2 = transform.test_copy_payload %0 : (!transform.any_op) -> !transform.any_op
// Consuming two handles in the same operation is invalid if they point
// to overlapping sets of payload IR ops.
//
// expected-error @below {{op uses a handle invalidated by a previously executed transform op}}
// expected-note @below {{invalidated by this transform op that consumes its operand #0 and invalidates all handles to payload IR entities}}
- transform.test_consume_operand %1, %2 : !pdl.operation
+ transform.test_consume_operand %1, %2 : !transform.any_op, !transform.any_op
}
}
module {
transform.sequence failures(propagate) {
- ^bb0(%0: !pdl.operation):
- %1 = transform.test_copy_payload %0
- %2 = transform.test_copy_payload %0
- transform.merge_handles %1, %2 { deduplicate } : !pdl.operation
+ ^bb0(%0: !transform.any_op):
+ %1 = transform.test_copy_payload %0 : (!transform.any_op) -> !transform.any_op
+ %2 = transform.test_copy_payload %0 : (!transform.any_op) -> !transform.any_op
+ transform.merge_handles %1, %2 { deduplicate } : !transform.any_op
}
}
// -----
// RUN: --split-input-file --verify-diagnostics
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation, %arg1: !transform.param<i64>, %arg2: !transform.param<i64>):
+^bb0(%arg0: !transform.any_op, %arg1: !transform.param<i64>, %arg2: !transform.param<i64>):
// expected-remark @below {{1 : i64, 2 : i64, 3 : i64}}
transform.test_print_param %arg1 : !transform.param<i64>
// expected-remark @below {{42 : i64, 45 : i64}}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation, %arg1: !transform.any_op, %arg2: !transform.param<i64>):
+^bb0(%arg0: !transform.any_op, %arg1: !transform.any_op, %arg2: !transform.param<i64>):
// expected-error @above {{wrong kind of value provided for top-level operation handle}}
}
// expected-error @below {{operation expects 3 extra value bindings, but 2 were provided to the interpreter}}
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation, %arg1: !transform.param<i64>, %arg2: !transform.param<i64>, %arg3: !transform.param<i64>):
+^bb0(%arg0: !transform.any_op, %arg1: !transform.param<i64>, %arg2: !transform.param<i64>, %arg3: !transform.param<i64>):
}
// expected-note @below {{nested in another possible top-level op}}
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error @below {{expects operands to be provided for a nested op}}
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
+ ^bb1(%arg1: !transform.any_op):
}
}
// expected-error @below {{expected children ops to implement TransformOpInterface}}
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-note @below {{op without interface}}
arith.constant 42.0 : f32
}
// -----
// expected-error @below {{expects the types of the terminator operands to match the types of the result}}
-%0 = transform.sequence -> !pdl.operation failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+%0 = transform.sequence -> !transform.any_op failures(propagate) {
+^bb0(%arg0: !transform.any_op):
// expected-note @below {{terminator}}
transform.yield
}
^bb0(%arg0: !transform.any_op):
// expected-error @below {{expects the type of the block argument to match the type of the operand}}
transform.sequence %arg0: !transform.any_op failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
+ ^bb1(%arg1: !transform.op<"builtin.module">):
transform.yield
}
}
// expected-note @below {{nested in another possible top-level op}}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error @below {{expects operands to be provided for a nested op}}
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
+ ^bb1(%arg1: !transform.any_op):
}
}
// expected-error @below {{expects only one non-pattern op in its body}}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-note @below {{first non-pattern op}}
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
+ ^bb1(%arg1: !transform.any_op):
}
// expected-note @below {{second non-pattern op}}
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
+ ^bb1(%arg1: !transform.any_op):
}
}
// expected-error @below {{expects only pattern and top-level transform ops in its body}}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-note @below {{offending op}}
"test.something"() : () -> ()
}
// expected-note @below {{parent operation}}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error @below {{op cannot be nested}}
- transform.with_pdl_patterns %arg0 : !pdl.operation {
- ^bb1(%arg1: !pdl.operation):
+ transform.with_pdl_patterns %arg0 : !transform.any_op {
+ ^bb1(%arg1: !transform.any_op):
}
}
// expected-error @below {{op expects at least one non-pattern op}}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @some : benefit(1) {
%0 = pdl.operation "test.foo"
pdl.rewrite %0 with "transform.dialect"
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error @below {{op expects at least one non-pattern op}}
- with_pdl_patterns %arg0 : !pdl.operation {
- ^bb1(%arg1: !pdl.operation):
+ with_pdl_patterns %arg0 : !transform.any_op {
+ ^bb1(%arg1: !transform.any_op):
}
}
// expected-error @below {{expects a single-block region}}
"transform.test_transform_unrestricted_op_no_interface"() ({
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
"test.potential_terminator"() : () -> ()
^bb1:
"test.potential_terminator"() : () -> ()
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error @below {{result #0 has more than one potential consumer}}
- %0 = test_produce_self_handle_or_forward_operand
+ %0 = test_produce_self_handle_or_forward_operand : () -> !transform.any_op
// expected-note @below {{used here as operand #0}}
- test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand"
+ test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
// expected-note @below {{used here as operand #0}}
- test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand"
+ test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error @below {{result #0 has more than one potential consumer}}
- %0 = test_produce_self_handle_or_forward_operand
+ %0 = test_produce_self_handle_or_forward_operand : () -> !transform.any_op
// expected-note @below {{used here as operand #0}}
- test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand"
+ test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
// expected-note @below {{used here as operand #0}}
- transform.sequence %0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- test_consume_operand_of_op_kind_or_fail %arg1, "transform.test_produce_self_handle_or_forward_operand"
+ transform.sequence %0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ test_consume_operand_of_op_kind_or_fail %arg1, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
}
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error @below {{result #0 has more than one potential consumer}}
- %0 = test_produce_self_handle_or_forward_operand
+ %0 = test_produce_self_handle_or_forward_operand : () -> !transform.any_op
// expected-note @below {{used here as operand #0}}
- test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand"
- transform.sequence %0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
+ test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
+ transform.sequence %0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
// expected-note @below {{used here as operand #0}}
- test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand"
+ test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
}
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error @below {{result #0 has more than one potential consumer}}
- %0 = test_produce_self_handle_or_forward_operand
+ %0 = test_produce_self_handle_or_forward_operand : () -> !transform.any_op
// expected-note @below {{used here as operand #0}}
- test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand"
+ test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
// expected-note @below {{used here as operand #0}}
- transform.sequence %0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- transform.sequence %arg1 : !pdl.operation failures(propagate) {
- ^bb2(%arg2: !pdl.operation):
- test_consume_operand_of_op_kind_or_fail %arg2, "transform.test_produce_self_handle_or_forward_operand"
+ transform.sequence %0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ transform.sequence %arg1 : !transform.any_op failures(propagate) {
+ ^bb2(%arg2: !transform.any_op):
+ test_consume_operand_of_op_kind_or_fail %arg2, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
}
}
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
// expected-error @below {{expects at least one region}}
transform.alternatives
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
// expected-error @below {{expects terminator operands to have the same type as results of the operation}}
- %2 = transform.alternatives %arg1 : !pdl.operation -> !pdl.operation {
- ^bb2(%arg2: !pdl.operation):
- transform.yield %arg2 : !pdl.operation
+ %2 = transform.alternatives %arg1 : !transform.any_op -> !transform.any_op {
+ ^bb2(%arg2: !transform.any_op):
+ transform.yield %arg2 : !transform.any_op
}, {
- ^bb2(%arg2: !pdl.operation):
+ ^bb2(%arg2: !transform.any_op):
// expected-note @below {{terminator}}
transform.yield
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error @below {{result #0 has more than one potential consumer}}
- %0 = test_produce_self_handle_or_forward_operand
+ %0 = test_produce_self_handle_or_forward_operand : () -> !transform.any_op
// expected-note @below {{used here as operand #0}}
- transform.foreach %0 : !pdl.operation {
- ^bb1(%arg1: !pdl.operation):
- transform.test_consume_operand %arg1 : !pdl.operation
+ transform.foreach %0 : !transform.any_op {
+ ^bb1(%arg1: !transform.any_op):
+ transform.test_consume_operand %arg1 : !transform.any_op
}
// expected-note @below {{used here as operand #0}}
- transform.test_consume_operand %0 : !pdl.operation
+ transform.test_consume_operand %0 : !transform.any_op
}
// -----
// RUN: mlir-opt %s | mlir-opt | FileCheck %s
// CHECK: transform.sequence
-// CHECK: ^{{.+}}(%{{.+}}: !pdl.operation):
+// CHECK: ^{{.+}}(%{{.+}}: !transform.any_op):
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
- // CHECK: sequence %{{.+}} : !pdl.operation
- // CHECK: ^{{.+}}(%{{.+}}: !pdl.operation):
- sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
+ // CHECK: sequence %{{.+}} : !transform.any_op
+ // CHECK: ^{{.+}}(%{{.+}}: !transform.any_op):
+ sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
}
}
// CHECK: transform.with_pdl_patterns
-// CHECK: ^{{.+}}(%[[ARG:.+]]: !pdl.operation):
+// CHECK: ^{{.+}}(%[[ARG:.+]]: !transform.any_op):
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
- // CHECK: sequence %[[ARG]] : !pdl.operation
- sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
+ // CHECK: sequence %[[ARG]] : !transform.any_op
+ sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
}
}
// Using the same value multiple times without consuming it is fine.
// CHECK: transform.sequence
-// CHECK: %[[V:.+]] = sequence %{{.*}} : !pdl.operation -> !pdl.operation
+// CHECK: %[[V:.+]] = sequence %{{.*}} : !transform.any_op -> !transform.any_op
// CHECK: sequence %[[V]]
// CHECK: sequence %[[V]]
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
- %0 = transform.sequence %arg0 : !pdl.operation -> !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- yield %arg1 : !pdl.operation
+^bb0(%arg0: !transform.any_op):
+ %0 = transform.sequence %arg0 : !transform.any_op -> !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ yield %arg1 : !transform.any_op
}
- transform.sequence %0 : !pdl.operation failures(propagate) {
- ^bb2(%arg2: !pdl.operation):
+ transform.sequence %0 : !transform.any_op failures(propagate) {
+ ^bb2(%arg2: !transform.any_op):
}
- transform.sequence %0 : !pdl.operation failures(propagate) {
- ^bb3(%arg3: !pdl.operation):
+ transform.sequence %0 : !transform.any_op failures(propagate) {
+ ^bb3(%arg3: !transform.any_op):
}
}
// CHECK: transform.sequence
// CHECK: foreach
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
- transform.foreach %arg0 : !pdl.operation {
- ^bb1(%arg1: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
+ transform.foreach %arg0 : !transform.any_op {
+ ^bb1(%arg1: !transform.any_op):
}
}
// CHECK: transform.sequence
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
- // CHECK: cast %{{.*}} : !pdl.operation to !transform.any_op
- %0 = cast %arg0: !pdl.operation to !transform.any_op
+^bb0(%arg0: !transform.any_op):
+ // CHECK: cast %{{.*}} : !transform.any_op to !transform.any_op
+ %0 = cast %arg0: !transform.any_op to !transform.any_op
// CHECK: cast %{{.*}} : !transform.any_op to !transform.op<"builtin.module">
%1 = cast %0: !transform.any_op to !transform.op<"builtin.module">
}
// CHECK: print
// CHECK: print
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
- transform.print %arg0 : !pdl.operation
+^bb0(%arg0: !transform.any_op):
+ transform.print %arg0 : !transform.any_op
transform.print
- transform.print %arg0 {name = "test"} : !pdl.operation
+ transform.print %arg0 {name = "test"} : !transform.any_op
transform.print {name = "test"}
}
transform.test_transform_op
// CHECK: = transform.test_produce_self_handle_or_forward_operand {foo = "bar"}
-%0 = transform.test_produce_self_handle_or_forward_operand { foo = "bar" }
+%0 = transform.test_produce_self_handle_or_forward_operand { foo = "bar" } : () -> !transform.any_op
// CHECK: transform.test_consume_operand_of_op_kind_or_fail %{{.*}},
-transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand"
+transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
// Ensure that the extension type is roundtripped correctly.
-// CHECK: transform.cast %{{.*}} : !pdl.operation to !transform.test_dialect_op
-%1 = transform.cast %0: !pdl.operation to !transform.test_dialect_op
+// CHECK: transform.cast %{{.*}} : !transform.any_op to !transform.test_dialect_op
+%1 = transform.cast %0: !transform.any_op to !transform.test_dialect_op
transform.sequence failures(propagate) {
^bb0(%arg0: !transform.any_op):
- %0 = transform.test_produce_self_handle_or_forward_operand { foo = "bar" }
+ %0 = transform.test_produce_self_handle_or_forward_operand { foo = "bar" } : () -> !transform.any_op
// expected-remark @below {{succeeded}}
- transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand"
+ transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
}
// -----
transform.sequence failures(propagate) {
^bb0(%arg0: !transform.any_op):
- %0 = transform.test_produce_self_handle_or_forward_operand { foo = "bar" }
+ %0 = transform.test_produce_self_handle_or_forward_operand { foo = "bar" } : () -> !transform.any_op
// expected-error @below {{expected the operand to be associated a payload op of kind transform.sequence got transform.test_produce_self_handle_or_forward_operand}}
- transform.test_consume_operand_of_op_kind_or_fail %0, "transform.sequence"
+ transform.test_consume_operand_of_op_kind_or_fail %0, "transform.sequence" : !transform.any_op
}
// -----
// to detect double-consumption.
transform.sequence failures(propagate) {
^bb0(%arg0: !transform.any_op):
- %0 = transform.test_produce_self_handle_or_forward_operand { foo = "bar" }
- %1 = transform.test_copy_payload %0
+ %0 = transform.test_produce_self_handle_or_forward_operand { foo = "bar" } : () -> !transform.any_op
+ %1 = transform.test_copy_payload %0 : (!transform.any_op) -> !transform.any_op
// expected-remark @below {{succeeded}}
- transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand"
+ transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
- sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
+ sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
// expected-remark @below {{applying transformation "a"}}
test_transform_op "a"
// expected-remark @below {{applying transformation "b"}}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
- %0 = test_produce_self_handle_or_forward_operand
- sequence %0 : !pdl.operation failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
+ %0 = test_produce_self_handle_or_forward_operand : () -> !transform.any_op
+ sequence %0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
// expected-remark @below {{succeeded}}
- test_consume_operand_of_op_kind_or_fail %arg1, "transform.test_produce_self_handle_or_forward_operand"
+ test_consume_operand_of_op_kind_or_fail %arg1, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
}
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
- %0 = sequence %arg0 : !pdl.operation -> !pdl.operation failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %1 = test_produce_self_handle_or_forward_operand
- yield %1 : !pdl.operation
+^bb0(%arg0: !transform.any_op):
+ %0 = sequence %arg0 : !transform.any_op -> !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
+ %1 = test_produce_self_handle_or_forward_operand : () -> !transform.any_op
+ yield %1 : !transform.any_op
}
// expected-remark @below {{succeeded}}
- test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand"
+ test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
}
// -----
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
- sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = pdl_match @some in %arg1 : (!pdl.operation) -> !pdl.operation
- test_print_remark_at_operand %0, "matched" : !pdl.operation
+^bb0(%arg0: !transform.any_op):
+ sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
+ %0 = pdl_match @some in %arg1 : (!transform.any_op) -> !transform.any_op
+ test_print_remark_at_operand %0, "matched" : !transform.any_op
}
pdl.pattern @some : benefit(1) {
}
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
- %m = get_closest_isolated_parent %f : (!pdl.operation) -> !pdl.operation
- test_print_remark_at_operand %m, "parent function" : !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
+ %m = get_closest_isolated_parent %f : (!transform.any_op) -> !transform.any_op
+ test_print_remark_at_operand %m, "parent function" : !transform.any_op
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @match_func : benefit(1) {
%0 = pdl.operands
%1 = pdl.types
pdl.rewrite %2 with "transform.dialect"
}
- transform.sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
// This is necessary to run the transformation on something other than the
// top-level module, "alternatives" cannot be run on that.
- %0 = pdl_match @match_func in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.alternatives %0 : !pdl.operation {
- ^bb2(%arg2: !pdl.operation):
- %1 = transform.test_produce_self_handle_or_forward_operand
+ %0 = pdl_match @match_func in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.alternatives %0 : !transform.any_op {
+ ^bb2(%arg2: !transform.any_op):
+ %1 = transform.test_produce_self_handle_or_forward_operand : () -> !transform.any_op
// This operation fails, which triggers the next alternative without
// reporting the error.
- transform.test_consume_operand_of_op_kind_or_fail %1, "transform.sequence"
+ transform.test_consume_operand_of_op_kind_or_fail %1, "transform.sequence" : !transform.any_op
}, {
- ^bb2(%arg2: !pdl.operation):
- %1 = transform.test_produce_self_handle_or_forward_operand
+ ^bb2(%arg2: !transform.any_op):
+ %1 = transform.test_produce_self_handle_or_forward_operand : () -> !transform.any_op
// expected-remark @below {{succeeded}}
- transform.test_consume_operand_of_op_kind_or_fail %1, "transform.test_produce_self_handle_or_forward_operand"
+ transform.test_consume_operand_of_op_kind_or_fail %1, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
}
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @match_call : benefit(1) {
%0 = pdl.operands
%1 = pdl.types
pdl.rewrite %2 with "transform.dialect"
}
- transform.sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = pdl_match @match_call in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ %0 = pdl_match @match_call in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = get_closest_isolated_parent %0 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{all alternatives failed}}
- transform.alternatives %1 : !pdl.operation {
- ^bb2(%arg2: !pdl.operation):
- %2 = transform.pdl_match @match_call in %arg2 : (!pdl.operation) -> !pdl.operation
+ transform.alternatives %1 : !transform.any_op {
+ ^bb2(%arg2: !transform.any_op):
+ %2 = transform.pdl_match @match_call in %arg2 : (!transform.any_op) -> !transform.any_op
// expected-remark @below {{applying}}
- transform.test_emit_remark_and_erase_operand %2, "applying" {fail_after_erase}
+ transform.test_emit_remark_and_erase_operand %2, "applying" {fail_after_erase} : !transform.any_op
}
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @match_call : benefit(1) {
%0 = pdl.operands
%1 = pdl.types
pdl.rewrite %2 with "transform.dialect"
}
- transform.sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = pdl_match @match_call in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- transform.alternatives %1 : !pdl.operation {
- ^bb2(%arg2: !pdl.operation):
- %2 = transform.pdl_match @match_call in %arg2 : (!pdl.operation) -> !pdl.operation
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ %0 = pdl_match @match_call in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = get_closest_isolated_parent %0 : (!transform.any_op) -> !transform.any_op
+ transform.alternatives %1 : !transform.any_op {
+ ^bb2(%arg2: !transform.any_op):
+ %2 = transform.pdl_match @match_call in %arg2 : (!transform.any_op) -> !transform.any_op
// expected-remark @below {{applying}}
- transform.test_emit_remark_and_erase_operand %2, "applying" {fail_after_erase}
+ transform.test_emit_remark_and_erase_operand %2, "applying" {fail_after_erase} : !transform.any_op
}, {
- ^bb2(%arg2: !pdl.operation):
- %2 = transform.pdl_match @match_call in %arg2 : (!pdl.operation) -> !pdl.operation
- transform.test_print_remark_at_operand %2, "still here" : !pdl.operation
+ ^bb2(%arg2: !transform.any_op):
+ %2 = transform.pdl_match @match_call in %arg2 : (!transform.any_op) -> !transform.any_op
+ transform.test_print_remark_at_operand %2, "still here" : !transform.any_op
// This alternative succeeds.
}, {
- ^bb2(%arg2: !pdl.operation):
+ ^bb2(%arg2: !transform.any_op):
// This alternative is never run, so we must not have a remark here.
- %2 = transform.pdl_match @match_call in %arg2 : (!pdl.operation) -> !pdl.operation
- transform.test_emit_remark_and_erase_operand %2, "should not happen" {fail_after_erase}
+ %2 = transform.pdl_match @match_call in %arg2 : (!transform.any_op) -> !transform.any_op
+ transform.test_emit_remark_and_erase_operand %2, "should not happen" {fail_after_erase} : !transform.any_op
}
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @match_call : benefit(1) {
%0 = pdl.operands
%1 = pdl.types
pdl.rewrite %2 with "transform.dialect"
}
- transform.sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = pdl_match @match_call in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- transform.alternatives %1 : !pdl.operation {
- ^bb2(%arg2: !pdl.operation):
- %2 = transform.pdl_match @match_call in %arg2 : (!pdl.operation) -> !pdl.operation
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ %0 = pdl_match @match_call in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = get_closest_isolated_parent %0 : (!transform.any_op) -> !transform.any_op
+ transform.alternatives %1 : !transform.any_op {
+ ^bb2(%arg2: !transform.any_op):
+ %2 = transform.pdl_match @match_call in %arg2 : (!transform.any_op) -> !transform.any_op
// expected-remark @below {{applying}}
- transform.test_emit_remark_and_erase_operand %2, "applying" {fail_after_erase}
+ transform.test_emit_remark_and_erase_operand %2, "applying" {fail_after_erase} : !transform.any_op
}, {
- ^bb2(%arg2: !pdl.operation):
- %2 = transform.pdl_match @match_call in %arg2 : (!pdl.operation) -> !pdl.operation
+ ^bb2(%arg2: !transform.any_op):
+ %2 = transform.pdl_match @match_call in %arg2 : (!transform.any_op) -> !transform.any_op
// expected-remark @below {{applying second time}}
- transform.test_emit_remark_and_erase_operand %2, "applying second time"
+ transform.test_emit_remark_and_erase_operand %2, "applying second time" : !transform.any_op
}
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @match_call : benefit(1) {
%0 = pdl.operands
%1 = pdl.types
pdl.rewrite %2 with "transform.dialect"
}
- transform.sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = pdl_match @match_call in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.alternatives %1 : !pdl.operation -> !pdl.operation {
- ^bb2(%arg2: !pdl.operation):
- %3 = transform.pdl_match @match_call in %arg2 : (!pdl.operation) -> !pdl.operation
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ %0 = pdl_match @match_call in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = get_closest_isolated_parent %0 : (!transform.any_op) -> !transform.any_op
+ %2 = transform.alternatives %1 : !transform.any_op -> !transform.any_op {
+ ^bb2(%arg2: !transform.any_op):
+ %3 = transform.pdl_match @match_call in %arg2 : (!transform.any_op) -> !transform.any_op
// expected-remark @below {{applying}}
- transform.test_emit_remark_and_erase_operand %3, "applying" {fail_after_erase}
- %4 = transform.test_produce_self_handle_or_forward_operand %3
- transform.yield %4 : !pdl.operation
+ transform.test_emit_remark_and_erase_operand %3, "applying" {fail_after_erase} : !transform.any_op
+ %4 = transform.test_produce_self_handle_or_forward_operand %3 : (!transform.any_op) -> !transform.any_op
+ transform.yield %4 : !transform.any_op
}, {
- ^bb2(%arg2: !pdl.operation):
- %4 = transform.test_produce_self_handle_or_forward_operand
- transform.yield %4 : !pdl.operation
+ ^bb2(%arg2: !transform.any_op):
+ %4 = transform.test_produce_self_handle_or_forward_operand : () -> !transform.any_op
+ transform.yield %4 : !transform.any_op
}
// The first alternative failed, so the returned value is taken from the
// second alternative, associated test_produce_self_handle_or_forward_operand rather
// than pdl_match.
// expected-remark @below {{succeeded}}
- transform.test_consume_operand_of_op_kind_or_fail %2, "transform.test_produce_self_handle_or_forward_operand"
+ transform.test_consume_operand_of_op_kind_or_fail %2, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
}
}
}
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
+ ^bb1(%arg1: !transform.any_op):
// expected-error @below {{scope must not contain the transforms being applied}}
- transform.alternatives %arg1 : !pdl.operation {
- ^bb2(%arg2: !pdl.operation):
- %0 = transform.test_produce_self_handle_or_forward_operand
- transform.test_consume_operand_of_op_kind_or_fail %0, "transform.sequence"
+ transform.alternatives %arg1 : !transform.any_op {
+ ^bb2(%arg2: !transform.any_op):
+ %0 = transform.test_produce_self_handle_or_forward_operand : () -> !transform.any_op
+ transform.test_consume_operand_of_op_kind_or_fail %0, "transform.sequence" : !transform.any_op
}, {
- ^bb2(%arg2: !pdl.operation):
- %0 = transform.test_produce_self_handle_or_forward_operand
- transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand"
+ ^bb2(%arg2: !transform.any_op):
+ %0 = transform.test_produce_self_handle_or_forward_operand : () -> !transform.any_op
+ transform.test_consume_operand_of_op_kind_or_fail %0, "transform.test_produce_self_handle_or_forward_operand" : !transform.any_op
}
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @match_const : benefit(1) {
%0 = pdl.operands
%1 = pdl.types
}
- sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.pdl_match @match_const in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.loop.get_parent_for %0 : (!pdl.operation) -> !pdl.operation
+ sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.pdl_match @match_const in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.loop.get_parent_for %0 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{only isolated-from-above ops can be alternative scopes}}
- alternatives %1 : !pdl.operation {
- ^bb2(%arg2: !pdl.operation):
+ alternatives %1 : !transform.any_op {
+ ^bb2(%arg2: !transform.any_op):
}
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @some : 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 @some in %arg1 : (!pdl.operation) -> !pdl.operation
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
+ %0 = pdl_match @some in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{application of transform.test_wrong_number_of_results expected to produce 3 results (actually produced 1).}}
// expected-note @below {{if you need variadic results, consider a generic `apply` instead of the specialized `applyToOne`.}}
- transform.test_wrong_number_of_results %0
+ transform.test_wrong_number_of_results %0 : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @some : 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 @some in %arg1 : (!pdl.operation) -> !pdl.operation
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
+ %0 = pdl_match @some in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{application of transform.test_wrong_number_of_multi_results expected to produce 1 results (actually produced 0)}}
// expected-note @below {{if you need variadic results, consider a generic `apply` instead of the specialized `applyToOne`.}}
- transform.test_wrong_number_of_multi_results %0
+ transform.test_wrong_number_of_multi_results %0 : (!transform.any_op) -> (!transform.any_op)
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @some : 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 @some in %arg1 : (!pdl.operation) -> !pdl.operation
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
+ %0 = pdl_match @some in %arg1 : (!transform.any_op) -> !transform.any_op
// Transform matches 3 ops and produces 2 results.
- %1:2 = transform.test_correct_number_of_multi_results %0
+ %1:2 = transform.test_correct_number_of_multi_results %0 : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @some : 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 @some in %arg1 : (!pdl.operation) -> !pdl.operation
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
+ %0 = pdl_match @some in %arg1 : (!transform.any_op) -> !transform.any_op
// Transform fails to match any but still produces 2 results.
- %1:2 = transform.test_correct_number_of_multi_results %0
+ %1:2 = transform.test_correct_number_of_multi_results %0 : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @some : 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 @some in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.test_mixed_null_and_non_null_results %0
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
+ %0 = pdl_match @some in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.test_mixed_null_and_non_null_results %0 : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @addi : 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 @addi in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = pdl_match @subi in %arg1 : (!pdl.operation) -> !pdl.operation
- %2 = merge_handles %0, %1 : !pdl.operation
- test_print_remark_at_operand %2, "matched" : !pdl.operation
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
+ %0 = pdl_match @addi in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = pdl_match @subi in %arg1 : (!transform.any_op) -> !transform.any_op
+ %2 = merge_handles %0, %1 : !transform.any_op
+ test_print_remark_at_operand %2, "matched" : !transform.any_op
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @some : 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 @some in %arg1 : (!pdl.operation) -> !pdl.operation
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
+ %0 = pdl_match @some in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{failed to apply}}
- transform.test_mixed_sucess_and_silenceable %0
+ transform.test_mixed_success_and_silenceable %0 : !transform.any_op
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @some : benefit(1) {
%0 = pdl.operands
%1 = pdl.types
pdl.rewrite %2 with "transform.dialect"
}
- transform.sequence %arg0 : !pdl.operation failures(suppress) {
- ^bb0(%arg1: !pdl.operation):
- %0 = pdl_match @some in %arg1 : (!pdl.operation) -> !pdl.operation
+ transform.sequence %arg0 : !transform.any_op failures(suppress) {
+ ^bb0(%arg1: !transform.any_op):
+ %0 = pdl_match @some in %arg1 : (!transform.any_op) -> !transform.any_op
// Not expecting error here because we are suppressing it.
// expected-remark @below {{foo}}
- test_emit_remark_and_erase_operand %0, "foo" {fail_after_erase}
+ test_emit_remark_and_erase_operand %0, "foo" {fail_after_erase} : !transform.any_op
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @some : 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 @some in %arg1 : (!pdl.operation) -> !pdl.operation
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
+ %0 = pdl_match @some in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{silenceable error}}
// expected-remark @below {{foo}}
- test_emit_remark_and_erase_operand %0, "foo" {fail_after_erase}
+ test_emit_remark_and_erase_operand %0, "foo" {fail_after_erase} : !transform.any_op
}
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %addi = transform.structured.match ops{["arith.addi"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %muli = get_producer_of_operand %addi[0] : (!pdl.operation) -> !pdl.operation
- transform.test_print_remark_at_operand %muli, "found muli" : !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %addi = transform.structured.match ops{["arith.addi"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %muli = get_producer_of_operand %addi[0] : (!transform.any_op) -> !transform.any_op
+ transform.test_print_remark_at_operand %muli, "found muli" : !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %muli = transform.structured.match ops{["arith.muli"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %muli = transform.structured.match ops{["arith.muli"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{could not find a producer for operand number: 0 of}}
- %bbarg = get_producer_of_operand %muli[0] : (!pdl.operation) -> !pdl.operation
+ %bbarg = get_producer_of_operand %muli[0] : (!transform.any_op) -> !transform.any_op
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %muli = transform.structured.match ops{["arith.muli"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %addi = get_consumers_of_result %muli[0] : (!pdl.operation) -> !pdl.operation
- transform.test_print_remark_at_operand %addi, "found addi" : !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %muli = transform.structured.match ops{["arith.muli"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %addi = get_consumers_of_result %muli[0] : (!transform.any_op) -> !transform.any_op
+ transform.test_print_remark_at_operand %addi, "found addi" : !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %muli = transform.structured.match ops{["arith.muli"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %muli = transform.structured.match ops{["arith.muli"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{handle must be mapped to exactly one payload op}}
- %bbarg = get_consumers_of_result %muli[0] : (!pdl.operation) -> !pdl.operation
+ %bbarg = get_consumers_of_result %muli[0] : (!transform.any_op) -> !transform.any_op
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %muli = transform.structured.match ops{["arith.muli"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %muli = transform.structured.match ops{["arith.muli"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{result number overflow}}
- %bbarg = get_consumers_of_result %muli[1] : (!pdl.operation) -> !pdl.operation
+ %bbarg = get_consumers_of_result %muli[1] : (!transform.any_op) -> !transform.any_op
}
"other_dialect.other_op"() : () -> ()
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @other : benefit(1) {
%0 = pdl.operation "other_dialect.other_op"
pdl.rewrite %0 with "transform.dialect"
}
- sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = pdl_match @other in %arg1 : (!pdl.operation) -> !pdl.operation
+ sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ %0 = pdl_match @other in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{expected the payload operation to belong to the 'test' dialect}}
- %2 = transform.cast %0 : !pdl.operation to !transform.test_dialect_op
- transform.cast %2 : !transform.test_dialect_op to !pdl.operation
+ %2 = transform.cast %0 : !transform.any_op to !transform.test_dialect_op
+ transform.cast %2 : !transform.test_dialect_op to !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.op<"test.some_op">
- transform.cast %2 : !transform.op<"test.some_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.op<"test.some_op">
+ transform.cast %2 : !transform.op<"test.some_op"> to !transform.any_op
}
}
"other_dialect.other_op"() : () -> ()
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @other : benefit(1) {
%0 = pdl.operation "other_dialect.other_op"
pdl.rewrite %0 with "transform.dialect"
}
- sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = pdl_match @other in %arg1 : (!pdl.operation) -> !pdl.operation
+ sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ %0 = pdl_match @other in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{incompatible payload operation name}}
- %2 = transform.cast %0 : !pdl.operation to !transform.op<"test.some_op">
- transform.cast %2 : !transform.op<"test.some_op"> to !pdl.operation
+ %2 = transform.cast %0 : !transform.any_op to !transform.op<"test.some_op">
+ transform.cast %2 : !transform.op<"test.some_op"> to !transform.any_op
}
}
// -----
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
- transform.sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = pdl_match @some in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb0(%arg0: !transform.any_op):
+ transform.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
+ %0 = pdl_match @some in %arg1 : (!transform.any_op) -> !transform.any_op
// here, the handles nested under are {%arg0, %arg1, %0}
// expected-remark @below {{3 handles nested under}}
- transform.test_report_number_of_tracked_handles_nested_under %arg1
+ transform.test_report_number_of_tracked_handles_nested_under %arg1 : !transform.any_op
// expected-remark @below {{erased}}
- transform.test_emit_remark_and_erase_operand %0, "erased"
+ transform.test_emit_remark_and_erase_operand %0, "erased" : !transform.any_op
// here, the handles nested under are only {%arg0, %arg1}
// expected-remark @below {{2 handles nested under}}
- transform.test_report_number_of_tracked_handles_nested_under %arg1
+ transform.test_report_number_of_tracked_handles_nested_under %arg1 : !transform.any_op
}
pdl.pattern @some : benefit(1) {
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
- %0 = transform.structured.match ops{["func.func"]} in %arg0 : (!pdl.operation) -> !pdl.operation
- %1 = transform.test_produce_param_with_number_of_test_ops %0 : !pdl.operation
+^bb0(%arg0: !transform.any_op):
+ %0 = transform.structured.match ops{["func.func"]} in %arg0 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.test_produce_param_with_number_of_test_ops %0 : !transform.any_op
// expected-remark @below {{1 : i32, 3 : i32}}
transform.test_print_param %1 : !transform.test_dialect_param
%2 = transform.test_add_to_param %1, 100
// expected-note @below {{associated payload op}}
module {
transform.sequence failures(propagate) {
- ^bb0(%arg0: !pdl.operation):
+ ^bb0(%arg0: !transform.any_op):
// expected-remark @below {{extension absent}}
- test_check_if_test_extension_present %arg0
+ test_check_if_test_extension_present %arg0 : !transform.any_op
test_add_test_extension "A"
// expected-remark @below {{extension present, A}}
- test_check_if_test_extension_present %arg0
+ test_check_if_test_extension_present %arg0 : !transform.any_op
test_remove_test_extension
// expected-remark @below {{extension absent}}
- test_check_if_test_extension_present %arg0
+ test_check_if_test_extension_present %arg0 : !transform.any_op
}
}
// expected-note @below {{associated payload op}}
module {
transform.sequence failures(propagate) {
- ^bb0(%arg0: !pdl.operation):
+ ^bb0(%arg0: !transform.any_op):
test_add_test_extension "A"
test_remove_test_extension
test_add_test_extension "B"
// expected-remark @below {{extension present, B}}
- test_check_if_test_extension_present %arg0
+ test_check_if_test_extension_present %arg0 : !transform.any_op
}
}
// expected-note @below {{associated payload op}}
module {
transform.sequence failures(propagate) {
- ^bb0(%arg0: !pdl.operation):
+ ^bb0(%arg0: !transform.any_op):
test_add_test_extension "A"
// expected-remark @below {{extension present, A}}
- test_check_if_test_extension_present %arg0
+ test_check_if_test_extension_present %arg0 : !transform.any_op
// expected-note @below {{associated payload op}}
- test_remap_operand_to_self %arg0
+ test_remap_operand_to_self %arg0 : (!transform.any_op) -> !transform.any_op
// expected-remark @below {{extension present, A}}
- test_check_if_test_extension_present %arg0
+ test_check_if_test_extension_present %arg0 : !transform.any_op
}
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
test_add_test_extension "A"
// This is okay because we are replacing the top-level module operation
// (0 results) with this operation that has _more_ (1) results.
- %dummy = test_remap_operand_to_self %arg0 : !pdl.operation
+ %dummy = test_remap_operand_to_self %arg0 : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
test_add_test_extension "A"
- %dummy = test_remap_operand_to_self %arg0 : !pdl.operation
+ %dummy = test_remap_operand_to_self %arg0 : (!transform.any_op) -> !transform.any_op
// This is still okay. Even though we are replacing the previous
// operation with (1 result) with this operation that has less (0) results,
// there is no handle to the result, hence no issue with value handle update.
- test_remap_operand_to_self %dummy
+ test_remap_operand_to_self %dummy : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
test_add_test_extension "A"
// expected-error @below {{cannot replace an op with another op producing fewer results while tracking handles}}
- %dummy = test_remap_operand_to_self %arg0 : !pdl.operation
- %valuehandle = transform.get_result %dummy[0] : (!pdl.operation) -> !transform.any_value
- test_remap_operand_to_self %dummy
+ %dummy = test_remap_operand_to_self %arg0 : (!transform.any_op) -> !transform.any_op
+ %valuehandle = transform.get_result %dummy[0] : (!transform.any_op) -> !transform.any_value
+ test_remap_operand_to_self %dummy : (!transform.any_op) -> ()
}
// -----
module {
transform.sequence failures(suppress) {
- ^bb0(%arg0: !pdl.operation):
+ ^bb0(%arg0: !transform.any_op):
// expected-error @below {{TestTransformStateExtension missing}}
- test_remap_operand_to_self %arg0
+ test_remap_operand_to_self %arg0 : (!transform.any_op) -> !transform.any_op
}
}
: Op<Transform_Dialect, "test_produce_self_handle_or_forward_operand",
[DeclareOpInterfaceMethods<TransformOpInterface>,
DeclareOpInterfaceMethods<MemoryEffectsOpInterface>]> {
- let arguments = (ins Optional<PDL_Operation>:$operand);
- let results = (outs PDL_Operation:$res);
- let assemblyFormat = "($operand^)? attr-dict";
+ let arguments = (ins Optional<TransformHandleTypeInterface>:$operand);
+ let results = (outs TransformHandleTypeInterface:$res);
+ let assemblyFormat =
+ "($operand^)? attr-dict `:` functional-type($operand, $res)";
let cppNamespace = "::mlir::test";
}
DeclareOpInterfaceMethods<MemoryEffectsOpInterface>]> {
let arguments = (ins
Transform_AnyHandleOrParamType:$operand,
- Optional<PDL_Operation>:$second_operand);
- let assemblyFormat = "$operand (`,` $second_operand^)? attr-dict `:` type($operand)";
+ Optional<TransformHandleTypeInterface>:$second_operand);
+ let assemblyFormat =
+ "$operand (`,` $second_operand^)? attr-dict `:` type($operand)"
+ "(`,` type($second_operand)^)?";
let cppNamespace = "::mlir::test";
}
[DeclareOpInterfaceMethods<TransformOpInterface>,
DeclareOpInterfaceMethods<MemoryEffectsOpInterface>]> {
let arguments = (ins
- PDL_Operation:$operand,
+ TransformHandleTypeInterface:$operand,
StrAttr:$op_kind);
- let assemblyFormat = "$operand `,` $op_kind attr-dict";
+ let assemblyFormat =
+ "$operand `,` $op_kind attr-dict `:` type($operand)";
let cppNamespace = "::mlir::test";
}
: Op<Transform_Dialect, "test_check_if_test_extension_present",
[DeclareOpInterfaceMethods<TransformOpInterface>,
DeclareOpInterfaceMethods<MemoryEffectsOpInterface>]> {
- let arguments = (ins PDL_Operation:$operand);
- let assemblyFormat = "$operand attr-dict";
+ let arguments = (ins TransformHandleTypeInterface:$operand);
+ let assemblyFormat = "$operand attr-dict `:` type($operand)";
let cppNamespace = "::mlir::test";
}
: Op<Transform_Dialect, "test_remap_operand_to_self",
[DeclareOpInterfaceMethods<TransformOpInterface>,
DeclareOpInterfaceMethods<MemoryEffectsOpInterface>]> {
- let arguments = (ins PDL_Operation:$operand);
+ let arguments = (ins TransformHandleTypeInterface:$operand);
let results = (outs Optional<TransformHandleTypeInterface>:$out);
- let assemblyFormat = "$operand attr-dict (`:` type($out)^)?";
+ let assemblyFormat = "$operand attr-dict `:` functional-type($operand, $out)";
let cppNamespace = "::mlir::test";
}
[DeclareOpInterfaceMethods<TransformOpInterface>,
DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
FunctionalStyleTransformOpTrait]> {
- let arguments = (ins PDL_Operation:$target, StrAttr:$remark,
+ let arguments = (ins TransformHandleTypeInterface:$target, StrAttr:$remark,
UnitAttr:$fail_after_erase);
- let assemblyFormat = "$target `,` $remark attr-dict";
+ let assemblyFormat = "$target `,` $remark attr-dict `:` type($target)";
let cppNamespace = "::mlir::test";
}
: Op<Transform_Dialect, "test_wrong_number_of_results",
[FunctionalStyleTransformOpTrait, MemoryEffectsOpInterface,
TransformEachOpTrait, TransformOpInterface]> {
- let arguments = (ins PDL_Operation:$target);
- let results = (outs PDL_Operation:$a,
- PDL_Operation:$b,
- PDL_Operation:$c);
- let assemblyFormat = "$target attr-dict";
+ let arguments = (ins TransformHandleTypeInterface:$target);
+ let results = (outs TransformHandleTypeInterface:$a,
+ TransformHandleTypeInterface:$b,
+ TransformHandleTypeInterface:$c);
+ let assemblyFormat =
+ "$target attr-dict `:` functional-type(operands, results)";
let cppNamespace = "::mlir::test";
let extraClassDeclaration = [{
::mlir::DiagnosedSilenceableFailure applyToOne(
: Op<Transform_Dialect, "test_wrong_number_of_multi_results",
[FunctionalStyleTransformOpTrait, MemoryEffectsOpInterface,
TransformEachOpTrait, 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($target, $result)";
let cppNamespace = "::mlir::test";
let extraClassDeclaration = [{
::mlir::DiagnosedSilenceableFailure applyToOne(
: Op<Transform_Dialect, "test_correct_number_of_multi_results",
[FunctionalStyleTransformOpTrait, MemoryEffectsOpInterface,
TransformEachOpTrait, TransformOpInterface]> {
- let arguments = (ins PDL_Operation:$target);
- let results = (outs PDL_Operation:$result1,
- PDL_Operation:$result2);
- let assemblyFormat = "$target attr-dict";
+ let arguments = (ins TransformHandleTypeInterface:$target);
+ let results = (outs TransformHandleTypeInterface:$result1,
+ TransformHandleTypeInterface:$result2);
+ let assemblyFormat =
+ "$target attr-dict `:` functional-type(operands, results)";
let cppNamespace = "::mlir::test";
let extraClassDeclaration = [{
::mlir::DiagnosedSilenceableFailure applyToOne(
: Op<Transform_Dialect, "test_mixed_null_and_non_null_results",
[FunctionalStyleTransformOpTrait, MemoryEffectsOpInterface,
TransformEachOpTrait, TransformOpInterface]> {
- let arguments = (ins PDL_Operation:$target);
- let results = (outs PDL_Operation:$null,
- PDL_Operation:$non_null);
- let assemblyFormat = "$target attr-dict";
+ let arguments = (ins TransformHandleTypeInterface:$target);
+ let results = (outs TransformHandleTypeInterface:$null,
+ TransformHandleTypeInterface:$non_null);
+ let assemblyFormat =
+ "$target attr-dict `:` functional-type(operands, results)";
let cppNamespace = "::mlir::test";
let extraClassDeclaration = [{
::mlir::DiagnosedSilenceableFailure applyToOne(
}
def TestMixedSuccessAndSilenceableOp
- : Op<Transform_Dialect, "test_mixed_sucess_and_silenceable",
+ : Op<Transform_Dialect, "test_mixed_success_and_silenceable",
[FunctionalStyleTransformOpTrait, MemoryEffectsOpInterface,
TransformEachOpTrait, TransformOpInterface]> {
- let arguments = (ins PDL_Operation:$target);
+ let arguments = (ins TransformHandleTypeInterface:$target);
let results = (outs);
- let assemblyFormat = "$target attr-dict";
+ let assemblyFormat = "$target attr-dict `:` type($target)";
let cppNamespace = "::mlir::test";
let extraClassDeclaration = [{
::mlir::DiagnosedSilenceableFailure applyToOne(
: Op<Transform_Dialect, "test_copy_payload",
[DeclareOpInterfaceMethods<TransformOpInterface>,
DeclareOpInterfaceMethods<MemoryEffectsOpInterface>]> {
- let arguments = (ins PDL_Operation:$handle);
- let results = (outs PDL_Operation:$copy);
+ let arguments = (ins TransformHandleTypeInterface:$handle);
+ let results = (outs TransformHandleTypeInterface:$copy);
let cppNamespace = "::mlir::test";
- let assemblyFormat = "$handle attr-dict";
+ let assemblyFormat =
+ "$handle attr-dict `:` functional-type(operands, results)";
}
def TestReportNumberOfTrackedHandlesNestedUnder
: Op<Transform_Dialect, "test_report_number_of_tracked_handles_nested_under",
[DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
DeclareOpInterfaceMethods<TransformOpInterface>]> {
- let arguments = (ins PDL_Operation:$target);
- let assemblyFormat = "$target attr-dict";
+ let arguments = (ins TransformHandleTypeInterface:$target);
+ let assemblyFormat = "$target attr-dict `:` type($target)";
let cppNamespace = "::mlir::test";
}