Lines Matching refs:async

1 // RUN: mlir-opt %s -async-runtime-ref-counting-opt | FileCheck %s
3 func.func private @consume_token(%arg0: !async.token)
6 func.func @cancellable_operations_0(%arg0: !async.token) {
7 // CHECK-NOT: async.runtime.add_ref
8 // CHECK-NOT: async.runtime.drop_ref
9 async.runtime.add_ref %arg0 {count = 1 : i64} : !async.token
10 async.runtime.drop_ref %arg0 {count = 1 : i64} : !async.token
16 func.func @cancellable_operations_1(%arg0: !async.token) {
17 // CHECK-NOT: async.runtime.add_ref
18 async.runtime.add_ref %arg0 {count = 1 : i64} : !async.token
20 call @consume_token(%arg0): (!async.token) -> ()
21 // CHECK-NOT: async.runtime.drop_ref
22 async.runtime.drop_ref %arg0 {count = 1 : i64} : !async.token
28 func.func @cancellable_operations_2(%arg0: !async.token) {
29 // CHECK: async.runtime.await
30 // CHECK-NEXT: async.runtime.await
31 // CHECK-NEXT: async.runtime.await
33 async.runtime.add_ref %arg0 {count = 1 : i64} : !async.token
34 async.runtime.await %arg0 : !async.token
35 async.runtime.drop_ref %arg0 {count = 1 : i64} : !async.token
36 async.runtime.await %arg0 : !async.token
37 async.runtime.add_ref %arg0 {count = 1 : i64} : !async.token
38 async.runtime.await %arg0 : !async.token
39 async.runtime.drop_ref %arg0 {count = 1 : i64} : !async.token
44 func.func @cancellable_operations_3(%arg0: !async.token) {
46 async.runtime.add_ref %arg0 {count = 1 : i64} : !async.token
48 call @consume_token(%arg0): (!async.token) -> ()
49 // CHECK-NOT: async.runtime.drop_ref
50 async.runtime.drop_ref %arg0 {count = 1 : i64} : !async.token
51 // CHECK: async.runtime.await
52 async.runtime.await %arg0 : !async.token
58 func.func @not_cancellable_operations_0(%arg0: !async.token) {
60 async.runtime.add_ref %arg0 {count = 1 : i64} : !async.token
62 call @consume_token(%arg0): (!async.token) -> ()
63 // CHECK: async.runtime.await
64 async.runtime.await %arg0 : !async.token
65 // CHECK: async.runtime.drop_ref
66 async.runtime.drop_ref %arg0 {count = 1 : i64} : !async.token