1 ; RUN: opt < %s -enable-coroutines -O0 -S
3 %async_func_ptr = type <{ i32, i32 }>
5 %swift.context = type { %swift.context*, void (%swift.context*)*, i64 }
6 %swift.type = type { i64 }
7 %FlatMapSeq = type <{}>
8 %swift.error = type opaque
9 %swift.opaque = type opaque
11 @repoTU = global %async_func_ptr <{ i32 trunc (i64 sub (i64 ptrtoint (void (%Tsq*, %swift.context*, %swift.type*, %FlatMapSeq*)* @repo to i64), i64 ptrtoint (%async_func_ptr* @repoTU to i64)) to i32), i32 20 }>, section "__TEXT,__const", align 8
13 ; Function Attrs: nounwind
14 declare token @llvm.coro.id.async(i32, i32, i32, i8*) #0
16 ; Function Attrs: nounwind
17 declare i8* @llvm.coro.begin(token, i8* writeonly) #0
19 ; Function Attrs: nounwind
20 declare i8* @llvm.coro.async.resume() #0
22 define hidden i8* @__swift_async_resume_project_context(i8* %0) {
27 define swifttailcc void @repo(%Tsq* %0, %swift.context* %1, %swift.type* %arg, %FlatMapSeq* %2) #1 {
29 %swifterror = alloca swifterror %swift.error*, align 8
30 %3 = call token @llvm.coro.id.async(i32 20, i32 16, i32 1, i8* bitcast (%async_func_ptr* @repoTU to i8*))
31 %4 = call i8* @llvm.coro.begin(token %3, i8* null)
32 %5 = bitcast i8* undef to %swift.opaque*
35 6: ; preds = %21, %15, %entry
36 br i1 undef, label %7, label %23
39 br i1 undef, label %8, label %16
42 %initializeWithTake35 = bitcast i8* undef to %swift.opaque* (%swift.opaque*, %swift.opaque*, %swift.type*)*
43 %9 = call %swift.opaque* %initializeWithTake35(%swift.opaque* noalias %5, %swift.opaque* noalias undef, %swift.type* undef) #0
44 %10 = call i8* @llvm.coro.async.resume()
45 %11 = bitcast i8* %10 to void (%swift.context*)*
46 %12 = call { i8*, %swift.error* } (i32, i8*, i8*, ...) @llvm.coro.suspend.async.sl_p0i8p0s_swift.error.4.220.413.429.445.461.672.683ss(i32 256, i8* %10, i8* bitcast (i8* (i8*)* @__swift_async_resume_project_context to i8*), i8* bitcast (void (i8*, %Tsq*, %swift.context*, %swift.opaque*, %swift.type*, i8**)* @__swift_suspend_dispatch_5.23 to i8*), i8* undef, %Tsq* undef, %swift.context* undef, %swift.opaque* %5, %swift.type* undef, i8** undef)
47 br i1 undef, label %25, label %13
50 br i1 undef, label %14, label %15
59 br i1 undef, label %26, label %17
62 br i1 undef, label %18, label %22
65 br i1 undef, label %27, label %19
68 br i1 undef, label %20, label %21
82 24: ; preds = %23, %22, %20, %14
94 28: ; preds = %27, %26, %25
98 define dso_local swifttailcc void @__swift_suspend_dispatch_2.18() {
103 define dso_local swifttailcc void @__swift_suspend_dispatch_5.19() {
108 define dso_local swifttailcc void @__swift_suspend_dispatch_2.20() {
113 define dso_local swifttailcc void @__swift_suspend_dispatch_4.21() {
118 define dso_local swifttailcc void @__swift_suspend_dispatch_5.22() {
123 define dso_local swifttailcc void @__swift_suspend_dispatch_5.23(i8* %0, %Tsq* %1, %swift.context* %2, %swift.opaque* %3, %swift.type* %4, i8** %5) {
128 ; Function Attrs: nounwind
129 declare { i8*, %swift.error* } @llvm.coro.suspend.async.sl_p0i8p0s_swift.error.4.220.413.429.445.461.672.683ss(i32, i8*, i8*, ...) #0
131 attributes #0 = { nounwind }
132 attributes #1 = { "tune-cpu"="generic" }
134 !llvm.linker.options = !{!0}