Lines Matching +full:- +full:- +full:token

1 // RUN: mlir-opt %s -async-runtime-ref-counting-opt | FileCheck %s
3 func.func private @consume_token(%arg0: !async.token)
5 // CHECK-LABEL: @cancellable_operations_0
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
15 // CHECK-LABEL: @cancellable_operations_1
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
27 // CHECK-LABEL: @cancellable_operations_2
28 func.func @cancellable_operations_2(%arg0: !async.token) {
30 // CHECK-NEXT: async.runtime.await
31 // CHECK-NEXT: async.runtime.await
32 // CHECK-NEXT: return
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
43 // CHECK-LABEL: @cancellable_operations_3
44 func.func @cancellable_operations_3(%arg0: !async.token) {
45 // CHECK-NOT: add_ref
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
52 async.runtime.await %arg0 : !async.token
57 // CHECK-LABEL: @not_cancellable_operations_0
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) -> ()
64 async.runtime.await %arg0 : !async.token
66 async.runtime.drop_ref %arg0 {count = 1 : i64} : !async.token