33target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
44target triple = "arm64-apple-macos99.99"
55
6- %coro_func_pointer = type <{ i32 , i32 }>
6+ %coro_func_pointer = type <{ i32 , i32 , i64 }>
77
88; CHECK-LABEL: %func.Frame = type { ptr }
99; CHECK-LABEL: %big_types.Frame = type { <32 x i8>, [16 x i8], i64, ptr, %Integer8 }
1010
11- ; CHECK-LABEL: @func_cfp = constant <{ i32, i32 }>
11+ ; CHECK-LABEL: @func_cfp = constant <{ i32, i32, i64 }>
1212; CHECK-SAME: <{
1313; CHECK-SAME: i32 trunc
1414; CHECK-SAME: i32 16
1515; CHECK-SAME: }>
16- @func_cfp = constant <{ i32 , i32 }>
16+ @func_cfp = constant <{ i32 , i32 , i64 }>
1717 <{ i32 trunc ( ; offset to @func from @func_cfp
1818 i64 sub (
1919 i64 ptrtoint (ptr @func to i64 ),
2020 i64 ptrtoint (ptr getelementptr inbounds (<{ i32 , i32 }>, ptr @func_cfp , i32 0 , i32 1 ) to i64 )
2121 )
2222 to i32 ),
23- i32 64 ; frame size
23+ i32 64 , ; frame size
24+ i64 1010101010 ; type_id
2425}>
2526
26- @big_types_cfp = constant <{ i32 , i32 }>
27+ @big_types_cfp = constant <{ i32 , i32 , i64 }>
2728 <{ i32 trunc ( ; offset to @func from @big_types_cfp
2829 i64 sub (
2930 i64 ptrtoint (ptr @big_types to i64 ),
3031 i64 ptrtoint (ptr getelementptr inbounds (<{ i32 , i32 }>, ptr @big_types_cfp , i32 0 , i32 1 ) to i64 )
3132 )
3233 to i32 ),
33- i32 64 ; frame size
34+ i32 64 , ; frame size
35+ i64 1010101010 ; type_id
3436}>
3537
3638
9092 ptr nonnull @allocate ,
9193 ptr nonnull @deallocate ,
9294 ptr nonnull @allocate_frame ,
93- ptr nonnull @deallocate_frame
95+ ptr nonnull @deallocate_frame ,
96+ i64 1010101010
9497 )
9598 %handle = call ptr @llvm.coro.begin (token %id , ptr null )
9699 %load = load i32 , ptr %array
@@ -114,9 +117,9 @@ cleanup:
114117
115118declare void @continuation_prototype (ptr , ptr )
116119
117- declare swiftcorocc noalias ptr @allocate (ptr %frame , ptr swiftcoro %cator , i32 %size )
120+ declare swiftcorocc noalias ptr @allocate (ptr %frame , ptr swiftcoro %cator , i32 %size , i64 %typeid )
118121declare void @deallocate (ptr %frame , ptr swiftcoro %cator , ptr %ptr )
119- declare swiftcorocc noalias ptr @allocate_frame (ptr %frame , ptr swiftcoro %cator , i32 %size )
122+ declare swiftcorocc noalias ptr @allocate_frame (ptr %frame , ptr swiftcoro %cator , i32 %size , i64 %typeid )
120123declare void @deallocate_frame (ptr %frame , ptr swiftcoro %cator , ptr %ptr )
121124
122125declare void @use (ptr %ptr )
@@ -146,7 +149,8 @@ define swiftcorocc { ptr, ptr } @big_types(ptr noalias %frame, ptr swiftcoro %al
146149 ptr nonnull @allocate ,
147150 ptr nonnull @deallocate ,
148151 ptr nonnull @allocate_frame ,
149- ptr nonnull @deallocate_frame
152+ ptr nonnull @deallocate_frame ,
153+ i64 1010101010
150154 )
151155 %handle = tail call ptr @llvm.coro.begin (token %id , ptr null )
152156 call void @llvm.lifetime.start.p0 (i64 1 , ptr nonnull %element_addr )
@@ -168,14 +172,15 @@ define swiftcorocc { ptr, ptr } @big_types(ptr noalias %frame, ptr swiftcoro %al
168172}
169173
170174declare i32 @getSize ()
171- @allocating_something_else_cfp = constant <{ i32 , i32 }>
175+ @allocating_something_else_cfp = constant <{ i32 , i32 , i64 }>
172176 <{ i32 trunc ( ; offset to @func from @allocating_something_else_cfp
173177 i64 sub (
174178 i64 ptrtoint (ptr @allocating_something_else to i64 ),
175179 i64 ptrtoint (ptr getelementptr inbounds (<{ i32 , i32 }>, ptr @allocating_something_else_cfp , i32 0 , i32 1 ) to i64 )
176180 )
177181 to i32 ),
178- i32 64 ; frame size
182+ i32 64 , ; frame size
183+ i64 1010101010 ; type_id
179184}>
180185declare { ptr , ptr } @allocating_something_else (ptr noalias %frame , ptr swiftcoro %allocator )
181186
@@ -210,14 +215,15 @@ declare { ptr, ptr } @allocating_something_else(ptr noalias %frame, ptr swiftcor
210215; CHECK-SAME: ptr swiftcoro %1,
211216; CHECK-SAME: ptr
212217; CHECK-SAME: )
213- @allocating_something_cfp = constant <{ i32 , i32 }>
218+ @allocating_something_cfp = constant <{ i32 , i32 , i64 }>
214219 <{ i32 trunc ( ; offset to @func from @allocating_something_cfp
215220 i64 sub (
216221 i64 ptrtoint (ptr @allocating_something to i64 ),
217222 i64 ptrtoint (ptr getelementptr inbounds (<{ i32 , i32 }>, ptr @allocating_something_cfp , i32 0 , i32 1 ) to i64 )
218223 )
219224 to i32 ),
220- i32 64 ; frame size
225+ i32 64 , ; frame size
226+ i64 1010101010 ; type_id
221227}>
222228define { ptr , ptr } @allocating_something (ptr noalias %frame , ptr swiftcoro %allocator ) {
223229entry:
@@ -231,7 +237,8 @@ entry:
231237 ptr nonnull @allocate ,
232238 ptr nonnull @deallocate ,
233239 ptr nonnull @allocate_frame ,
234- ptr nonnull @deallocate_frame
240+ ptr nonnull @deallocate_frame ,
241+ i64 1010101010
235242 )
236243 %hdl = call ptr @llvm.coro.begin (token %id , ptr null )
237244 %size = call i32 @getSize ()
@@ -240,7 +247,7 @@ entry:
240247
241248 %callee_frame_size = load i32 , ptr getelementptr inbounds nuw (%coro_func_pointer , ptr @allocating_something_else_cfp , i32 0 , i32 1 ), align 8
242249 %callee_frame_size_64 = zext i32 %callee_frame_size to i64
243- %callee_frame_token = call token @llvm.coro.alloca.alloc.frame.i64 (i64 %callee_frame_size_64 , i32 16 )
250+ %callee_frame_token = call token @llvm.coro.alloca.alloc.frame.i64 (i64 %callee_frame_size_64 , i32 16 , i64 1010101010 )
244251 %callee_frame = call ptr @llvm.coro.alloca.get (token %callee_frame_token )
245252 call void @llvm.lifetime.start.p0 (i64 -1 , ptr %callee_frame )
246253 %allocating_something_else = call ptr @llvm.coro.prepare.retcon (ptr @allocating_something_else )
0 commit comments