llvm-project
35 строк · 1.3 Кб
1// RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline="builtin.module(func.func(test-clone))" | FileCheck %s
2
3module {
4func.func @fixpoint(%arg1 : i32) -> i32 {
5%r = "test.use"(%arg1) ({
6%r2 = "test.use2"(%arg1) ({
7"test.yield2"(%arg1) : (i32) -> ()
8}) : (i32) -> i32
9"test.yield"(%r2) : (i32) -> ()
10}) : (i32) -> i32
11return %r : i32
12}
13}
14
15// CHECK: notifyOperationInserted: test.use
16// CHECK-NEXT: notifyOperationInserted: test.use2
17// CHECK-NEXT: notifyOperationInserted: test.yield2
18// CHECK-NEXT: notifyOperationInserted: test.yield
19// CHECK-NEXT: notifyOperationInserted: func.return
20
21// CHECK: func @fixpoint(%[[arg0:.+]]: i32) -> i32 {
22// CHECK-NEXT: %[[i0:.+]] = "test.use"(%[[arg0]]) ({
23// CHECK-NEXT: %[[r2:.+]] = "test.use2"(%[[arg0]]) ({
24// CHECK-NEXT: "test.yield2"(%[[arg0]]) : (i32) -> ()
25// CHECK-NEXT: }) : (i32) -> i32
26// CHECK-NEXT: "test.yield"(%[[r2]]) : (i32) -> ()
27// CHECK-NEXT: }) : (i32) -> i32
28// CHECK-NEXT: %[[i1:.+]] = "test.use"(%[[i0]]) ({
29// CHECK-NEXT: %[[r2:.+]] = "test.use2"(%[[i0]]) ({
30// CHECK-NEXT: "test.yield2"(%[[i0]]) : (i32) -> ()
31// CHECK-NEXT: }) : (i32) -> i32
32// CHECK-NEXT: "test.yield"(%[[r2]]) : (i32) -> ()
33// CHECK-NEXT: }) : (i32) -> i32
34// CHECK-NEXT: return %[[i1]] : i32
35// CHECK-NEXT: }
36