Debian Codegraph @

mlir/test/Examples/transform/Ch3/ops.mlir

raw
1 // RUN: transform-opt-ch3 %s --transform-interpreter \
2 // RUN: --allow-unregistered-dialect --split-input-file | FileCheck %s
3
4 // ****************************** IMPORTANT NOTE ******************************
5 //
6 // If you are changing this file, you may also need to change
7 // mlir/docs/Tutorials/Transform accordingly.
8 //
9 // ****************************************************************************
10
11 func.func private @orig()
12 func.func private @updated()
13
14 // CHECK-LABEL: func @test1
15 func.func @test1() {
16 // CHECK: call @updated
17 call @orig() : () -> ()
18 return
19 }
20
21 module attributes {transform.with_named_sequence} {
22 transform.named_sequence @__transform_main(%arg0: !transform.any_op) {
23 %call = transform.structured.match ops{["func.call"]} in %arg0 : (!transform.any_op) -> !transform.op<"func.call">
24 // CHECK: transform.my.change_call_target %{{.*}}, "updated" : !transform.op<"func.call">
25 transform.my.change_call_target %call, "updated" : !transform.op<"func.call">
26 transform.yield
27 }
28 }
29
30 // -----
31
32 func.func private @orig()
33
34 // CHECK-LABEL: func @test2
35 func.func @test2() {
36 // CHECK: "my.mm4"
37 call @orig() : () -> ()
38 return
39 }
40
41 module attributes {transform.with_named_sequence} {
42 transform.named_sequence @__transform_main(%arg0: !transform.any_op) {
43 %call = transform.structured.match ops{["func.call"]} in %arg0 : (!transform.any_op) -> !transform.my.call_op_interface
44 // CHECK: transform.my.call_to_op %{{.*}} : (!transform.my.call_op_interface) -> !transform.any_op
45 transform.my.call_to_op %call : (!transform.my.call_op_interface) -> !transform.any_op
46 transform.yield
47 }
48 }