|
14 | 14 | }
|
15 | 15 |
|
16 | 16 | // CHECK-LABEL: define{{.*}} @async_continuation(
|
| 17 | +// CHECK: [[tsk_addr:%.*]] = alloca %swift.task* |
| 18 | +// CHECK: [[exe_addr:%.*]] = alloca %swift.executor* |
| 19 | +// CHECK: [[ctxt_addr:%.*]] = alloca %swift.context* |
17 | 20 | // CHECK: [[cont_context:%.*]] = alloca %swift.async_continuation_context
|
18 | 21 | // CHECK: [[result_storage:%.*]] = alloca i32
|
19 | 22 | // CHECK: call token @llvm.coro.id.async
|
20 | 23 | // CHECK: call i8* @llvm.coro.begin(
|
21 | 24 | // Create UnsafeContinuation<Int32>.
|
22 |
| -// CHECK: [[tmp0:%.*]] = bitcast %swift.task* %0 to i8* |
| 25 | +// CHECK: [[tsk:%.*]] = load %swift.task*, %swift.task** [[tsk_addr]] |
| 26 | +// CHECK: [[tmp0:%.*]] = bitcast %swift.task* [[tsk]] to i8* |
23 | 27 | // CHECK: [[tmp1:%.*]] = insertvalue %TSV undef, i8* [[tmp0]], 0
|
24 | 28 | // CHECK: [[continuation:%.*]] = insertvalue %T12_Concurrency18UnsafeContinuationV undef, %TSV [[tmp1]], 0
|
25 | 29 | // Initialize the async continuation context.
|
26 | 30 | // CHECK: [[context_addr:%.*]] = getelementptr inbounds %swift.async_continuation_context, %swift.async_continuation_context* [[cont_context]], i32 0, i32 0
|
27 |
| -// CHECK: store %swift.context* %2, %swift.context** [[context_addr]] |
| 31 | +// CHECK: [[ctxt:%.*]] = load %swift.context*, %swift.context** [[ctxt_addr]] |
| 32 | +// CHECK: store %swift.context* [[ctxt]], %swift.context** [[context_addr]] |
28 | 33 | // CHECK: [[error_addr:%.*]] = getelementptr inbounds %swift.async_continuation_context, %swift.async_continuation_context* [[cont_context]], i32 0, i32 2
|
29 | 34 | // CHECK: store %swift.error* null, %swift.error** [[error_addr]]
|
30 | 35 | // CHECK: [[result_addr:%.*]] = getelementptr inbounds %swift.async_continuation_context, %swift.async_continuation_context* [[cont_context]], i32 0, i32 3
|
31 | 36 | // CHECK: [[result_storage_as_opaque:%.*]] = bitcast i32* [[result_storage]] to %swift.opaque*
|
32 | 37 | // CHECK: store %swift.opaque* [[result_storage_as_opaque]], %swift.opaque** [[result_addr]]
|
33 | 38 | // CHECK: [[exectuor_addr:%.*]] = getelementptr inbounds %swift.async_continuation_context, %swift.async_continuation_context* [[cont_context]], i32 0, i32 4
|
34 |
| -// CHECK: store %swift.executor* %1, %swift.executor** [[exectuor_addr]] |
| 39 | +// CHECK: [[exe:%.*]] = load %swift.executor*, %swift.executor** [[exe_addr]] |
| 40 | +// CHECK: store %swift.executor* [[exe]], %swift.executor** [[exectuor_addr]] |
35 | 41 | // Initialize the async task with the continuation function and async continuation context.
|
36 |
| -// CHECK: [[task_continuation_fn_addr:%.*]] = getelementptr inbounds %swift.task, %swift.task* %0, i32 0, i32 3 |
| 42 | +// CHECK: [[task_continuation_fn_addr:%.*]] = getelementptr inbounds %swift.task, %swift.task* [[tsk]], i32 0, i32 3 |
37 | 43 | // CHECK: [[continuation_fn:%.*]] = call i8* @llvm.coro.async.resume()
|
38 | 44 | // CHECK: store i8* [[continuation_fn]], i8** [[task_continuation_fn_addr]]
|
39 |
| -// CHECK: [[task_resume_context_addr:%.*]] = getelementptr inbounds %swift.task, %swift.task* %0, i32 0, i32 4 |
| 45 | +// CHECK: [[task_resume_context_addr:%.*]] = getelementptr inbounds %swift.task, %swift.task* [[tsk]], i32 0, i32 4 |
40 | 46 | // CHECK: [[cont_context2:%.*]] = bitcast %swift.async_continuation_context* [[cont_context]] to %swift.context*
|
41 | 47 | // CHECK: store %swift.context* [[cont_context2]], %swift.context** [[task_resume_context_addr]]
|
42 | 48 | // Initialize the synchronization variable.
|
43 |
| -// CHECK: [[synchronization_addr:%.*]] = getelementptr inbounds %swift.async_continuation_context, %swift.async_continuation_context* %3, i32 0, i32 1 |
| 49 | +// CHECK: [[synchronization_addr:%.*]] = getelementptr inbounds %swift.async_continuation_context, %swift.async_continuation_context* [[cont_context]], i32 0, i32 1 |
44 | 50 | // CHECK: store atomic {{(i64|i32)}} 0, {{(i64|i32)}}* [[synchronization_addr]] release
|
45 | 51 | // Do some stuff.
|
46 | 52 | // CHECK: call swiftcc void @not_async_test()
|
47 | 53 | // Arrive at the await_async_continuation point.
|
48 |
| -// CHECK: [[synchronization_addr_before_await:%.*]] = getelementptr inbounds %swift.async_continuation_context, %swift.async_continuation_context* %3, i32 0, i32 1 |
| 54 | +// CHECK: [[synchronization_addr_before_await:%.*]] = getelementptr inbounds %swift.async_continuation_context, %swift.async_continuation_context* [[cont_context]], i32 0, i32 1 |
49 | 55 | // CHECK: [[first_at_sync_pt:%.*]] = cmpxchg {{(i64|i32)}}* [[synchronization_addr_before_await]], {{(i64|i32)}} 0, {{(i64|i32)}} 1 release acquire
|
50 | 56 | // CHECK: [[first_at_sync_pt_bool:%.*]] = extractvalue { {{(i64|i32)}}, i1 } [[first_at_sync_pt]], 1
|
51 | 57 | // CHECK: br i1 [[first_at_sync_pt_bool]], label %await.async.abort, label %await.async.maybe.resume
|
|
0 commit comments