@@ -27,11 +27,11 @@ entry(%c : $SwiftClass, %d : $SwiftClass):
2727sil @use_closure : $@async @convention(thin) (@noescape @async @callee_guaranteed () -> ()) -> ()
2828
2929// CHECK: define{{( dllexport)?}}{{( protected)?}} swift{{(tail)?}}cc void @partial_apply_class(
30- sil @partial_apply_class : $@async @convention(thin) (SwiftClass) -> @async @callee_owned () -> () {
30+ sil @partial_apply_class : $@async @convention(thin) (SwiftClass) -> @async @callee_guaranteed () -> () {
3131entry(%c : $SwiftClass):
3232 %f = function_ref @partially_applyable_to_class : $@async @convention(thin) (@owned SwiftClass) -> ()
33- %g = partial_apply %f(%c) : $@async @convention(thin) (@owned SwiftClass) -> ()
34- return %g : $@async @callee_owned () -> ()
33+ %g = partial_apply [callee_guaranteed] %f(%c) : $@async @convention(thin) (@owned SwiftClass) -> ()
34+ return %g : $@async @callee_guaranteed () -> ()
3535}
3636
3737// CHECK: define{{( dllexport)?}}{{( protected)?}} swift{{(tail)?}}cc void @partial_apply_class_on_stack(
@@ -67,14 +67,14 @@ entry(%i : $Int, %t : $*T):
6767return %i : $Int
6868}
6969
70- sil @partial_apply_generic_capture : $@async @convention(thin) (Int) -> @async @callee_owned (Int) -> Int {
70+ sil @partial_apply_generic_capture : $@async @convention(thin) (Int) -> @async @callee_guaranteed (Int) -> Int {
7171entry(%x : $Int):
7272 %a = alloc_stack $Int
7373 store %x to %a : $*Int
7474 %f = function_ref @generic_captured_param : $@async @convention(thin) <T> (Int, @inout T) -> Int
75- %p = partial_apply %f<Int>(%a) : $@async @convention(thin) <T> (Int, @inout T) -> Int
75+ %p = partial_apply [callee_guaranteed] %f<Int>(%a) : $@async @convention(thin) <T> (Int, @inout T) -> Int
7676 dealloc_stack %a : $*Int
77- return %p : $@async @callee_owned (Int) -> Int
77+ return %p : $@async @callee_guaranteed (Int) -> Int
7878}
7979
8080sil public @generic_captured_and_open_param : $@async @convention(thin) <T> (@in T, @inout T) -> @out T {
@@ -85,11 +85,11 @@ entry(%o : $*T, %i : $*T, %io : $*T):
8585
8686
8787// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swift{{(tail)?}}cc void @partial_apply_open_generic_capture(
88- sil @partial_apply_open_generic_capture : $@async @convention(thin) <T> (@inout T) -> @async @callee_owned (@in T) -> @out T {
88+ sil @partial_apply_open_generic_capture : $@async @convention(thin) <T> (@inout T) -> @async @callee_guaranteed (@in T) -> @out T {
8989entry(%a : $*T):
9090 %f = function_ref @generic_captured_and_open_param : $@async @convention(thin) <U> (@in U, @inout U) -> @out U
91- %p = partial_apply %f<T>(%a) : $@async @convention(thin) <U> (@in U, @inout U) -> @out U
92- return %p : $@async @callee_owned (@in T) -> @out T
91+ %p = partial_apply [callee_guaranteed] %f<T>(%a) : $@async @convention(thin) <U> (@in U, @inout U) -> @out U
92+ return %p : $@async @callee_guaranteed (@in T) -> @out T
9393}
9494
9595/*****************************************************************************/
@@ -105,11 +105,11 @@ entry(%i : $Int, %c : $SwiftClass):
105105
106106// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swift{{(tail)?}}cc void @partial_apply_guaranteed_class_param(
107107
108- sil @partial_apply_guaranteed_class_param : $@async @convention(thin) (@owned SwiftClass) -> @async @callee_owned (Int) -> Int {
108+ sil @partial_apply_guaranteed_class_param : $@async @convention(thin) (@owned SwiftClass) -> @async @callee_guaranteed (Int) -> Int {
109109bb0(%x : $SwiftClass):
110110 %f = function_ref @guaranteed_captured_class_param : $@async @convention(thin) (Int, @guaranteed SwiftClass) -> Int
111- %p = partial_apply %f(%x) : $@async @convention(thin) (Int, @guaranteed SwiftClass) -> Int
112- return %p : $@async @callee_owned (Int) -> Int
111+ %p = partial_apply [callee_guaranteed] %f(%x) : $@async @convention(thin) (Int, @guaranteed SwiftClass) -> Int
112+ return %p : $@async @callee_guaranteed (Int) -> Int
113113}
114114
115115sil public @indirect_guaranteed_captured_class_param : $@async @convention(thin) (Int, @in_guaranteed SwiftClass) -> Int {
@@ -121,11 +121,11 @@ entry(%i : $Int, %c : $*SwiftClass):
121121// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swift{{(tail)?}}cc void @partial_apply_indirect_guaranteed_class_param(
122122// CHECK-LABEL: define internal swift{{(tail)?}}cc void @"$s40indirect_guaranteed_captured_class_paramTA"(
123123
124- sil @partial_apply_indirect_guaranteed_class_param : $@async @convention(thin) (@in SwiftClass) -> @async @callee_owned (Int) -> Int {
124+ sil @partial_apply_indirect_guaranteed_class_param : $@async @convention(thin) (@in SwiftClass) -> @async @callee_guaranteed (Int) -> Int {
125125bb0(%x : $*SwiftClass):
126126 %f = function_ref @indirect_guaranteed_captured_class_param : $@async @convention(thin) (Int, @in_guaranteed SwiftClass) -> Int
127- %p = partial_apply %f(%x) : $@async @convention(thin) (Int, @in_guaranteed SwiftClass) -> Int
128- return %p : $@async @callee_owned (Int) -> Int
127+ %p = partial_apply [callee_guaranteed] %f(%x) : $@async @convention(thin) (Int, @in_guaranteed SwiftClass) -> Int
128+ return %p : $@async @callee_guaranteed (Int) -> Int
129129}
130130
131131sil public @indirect_consumed_captured_class_param : $@async @convention(thin) (Int, @in SwiftClass) -> Int {
@@ -137,11 +137,11 @@ entry(%i : $Int, %c : $*SwiftClass):
137137// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swift{{(tail)?}}cc void @partial_apply_indirect_consumed_class_param(
138138// CHECK-LABEL: define internal swift{{(tail)?}}cc void @"$s38indirect_consumed_captured_class_paramTA"(
139139
140- sil @partial_apply_indirect_consumed_class_param : $@async @convention(thin) (@in SwiftClass) -> @async @callee_owned (Int) -> Int {
140+ sil @partial_apply_indirect_consumed_class_param : $@async @convention(thin) (@in SwiftClass) -> @async @callee_guaranteed (Int) -> Int {
141141bb0(%x : $*SwiftClass):
142142 %f = function_ref @indirect_consumed_captured_class_param : $@async @convention(thin) (Int, @in SwiftClass) -> Int
143- %p = partial_apply %f(%x) : $@async @convention(thin) (Int, @in SwiftClass) -> Int
144- return %p : $@async @callee_owned (Int) -> Int
143+ %p = partial_apply [callee_guaranteed] %f(%x) : $@async @convention(thin) (Int, @in SwiftClass) -> Int
144+ return %p : $@async @callee_guaranteed (Int) -> Int
145145}
146146
147147/*****************************************************************************/
@@ -161,11 +161,11 @@ entry(%i : $Int, %c : $SwiftClassPair):
161161// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swift{{(tail)?}}cc void @partial_apply_guaranteed_class_pair_param(
162162// CHECK-LABEL: define internal swift{{(tail)?}}cc void @"$s36guaranteed_captured_class_pair_paramTA"(
163163
164- sil @partial_apply_guaranteed_class_pair_param : $@async @convention(thin) (@owned SwiftClassPair) -> @async @callee_owned (Int) -> Int {
164+ sil @partial_apply_guaranteed_class_pair_param : $@async @convention(thin) (@owned SwiftClassPair) -> @async @callee_guaranteed (Int) -> Int {
165165bb0(%x : $SwiftClassPair):
166166 %f = function_ref @guaranteed_captured_class_pair_param : $@async @convention(thin) (Int, @guaranteed SwiftClassPair) -> Int
167- %p = partial_apply %f(%x) : $@async @convention(thin) (Int, @guaranteed SwiftClassPair) -> Int
168- return %p : $@async @callee_owned (Int) -> Int
167+ %p = partial_apply [callee_guaranteed] %f(%x) : $@async @convention(thin) (Int, @guaranteed SwiftClassPair) -> Int
168+ return %p : $@async @callee_guaranteed (Int) -> Int
169169}
170170
171171sil public @indirect_guaranteed_captured_class_pair_param : $@async @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> Int {
@@ -177,11 +177,11 @@ entry(%i : $Int, %c : $*SwiftClassPair):
177177// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swift{{(tail)?}}cc void @partial_apply_indirect_guaranteed_class_pair_param(
178178// CHECK-LABEL: define internal swift{{(tail)?}}cc void @"$s45indirect_guaranteed_captured_class_pair_paramTA"(
179179
180- sil @partial_apply_indirect_guaranteed_class_pair_param : $@async @convention(thin) (@in SwiftClassPair) -> @async @callee_owned (Int) -> Int {
180+ sil @partial_apply_indirect_guaranteed_class_pair_param : $@async @convention(thin) (@in SwiftClassPair) -> @async @callee_guaranteed (Int) -> Int {
181181bb0(%x : $*SwiftClassPair):
182182 %f = function_ref @indirect_guaranteed_captured_class_pair_param : $@async @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> Int
183- %p = partial_apply %f(%x) : $@async @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> Int
184- return %p : $@async @callee_owned (Int) -> Int
183+ %p = partial_apply [callee_guaranteed] %f(%x) : $@async @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> Int
184+ return %p : $@async @callee_guaranteed (Int) -> Int
185185}
186186
187187sil public @indirect_consumed_captured_class_pair_param : $@async @convention(thin) (Int, @in SwiftClassPair) -> Int {
@@ -194,11 +194,11 @@ entry(%i : $Int, %c : $*SwiftClassPair):
194194// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swift{{(tail)?}}cc void @partial_apply_indirect_consumed_class_pair_param(
195195// CHECK-LABEL: define internal swift{{(tail)?}}cc void @"$s43indirect_consumed_captured_class_pair_paramTA"(
196196
197- sil @partial_apply_indirect_consumed_class_pair_param : $@async @convention(thin) (@in SwiftClassPair) -> @async @callee_owned (Int) -> Int {
197+ sil @partial_apply_indirect_consumed_class_pair_param : $@async @convention(thin) (@in SwiftClassPair) -> @async @callee_guaranteed (Int) -> Int {
198198bb0(%x : $*SwiftClassPair):
199199 %f = function_ref @indirect_consumed_captured_class_pair_param : $@async @convention(thin) (Int, @in SwiftClassPair) -> Int
200- %p = partial_apply %f(%x) : $@async @convention(thin) (Int, @in SwiftClassPair) -> Int
201- return %p : $@async @callee_owned (Int) -> Int
200+ %p = partial_apply [callee_guaranteed] %f(%x) : $@async @convention(thin) (Int, @in SwiftClassPair) -> Int
201+ return %p : $@async @callee_guaranteed (Int) -> Int
202202}
203203
204204sil public @captured_fixed_and_dependent_params : $@async @convention(thin) <A> (@owned SwiftClass, @in A, Int) -> () {
@@ -209,11 +209,11 @@ entry(%c : $SwiftClass, %a : $*A, %i : $Int):
209209
210210// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swift{{(tail)?}}cc void @partial_apply_indirect_non_fixed_layout
211211// CHECK-LABEL: define internal swift{{(tail)?}}cc void @"$s35captured_fixed_and_dependent_paramsTA"(
212- sil @partial_apply_indirect_non_fixed_layout : $@async @convention(thin) <T> (@owned SwiftClass, @in T, Int) -> @async @callee_owned () -> () {
212+ sil @partial_apply_indirect_non_fixed_layout : $@async @convention(thin) <T> (@owned SwiftClass, @in T, Int) -> @async @callee_guaranteed () -> () {
213213bb0(%a : $SwiftClass, %b : $*T, %c : $Int):
214214 %f = function_ref @captured_fixed_and_dependent_params : $@async @convention(thin) <B> (@owned SwiftClass, @in B, Int) -> ()
215- %p = partial_apply %f<T>(%a, %b, %c) : $@async @convention(thin) <C> (@owned SwiftClass, @in C, Int) -> ()
216- return %p : $@async @callee_owned () -> ()
215+ %p = partial_apply [callee_guaranteed] %f<T>(%a, %b, %c) : $@async @convention(thin) <C> (@owned SwiftClass, @in C, Int) -> ()
216+ return %p : $@async @callee_guaranteed () -> ()
217217}
218218
219219sil public @captured_dependent_out_param : $@async @convention(thin) <A> (@in A) -> @out A {
@@ -222,19 +222,19 @@ entry(%o : $*A, %i : $*A):
222222 unreachable
223223}
224224
225- sil @partial_apply_with_out_param : $@async @convention(thin) <T> (@in T) -> @async @callee_owned () -> @out T {
225+ sil @partial_apply_with_out_param : $@async @convention(thin) <T> (@in T) -> @async @callee_guaranteed () -> @out T {
226226bb0(%x : $*T):
227227 %f = function_ref @captured_dependent_out_param : $@async @convention(thin) <B> (@in B) -> @out B
228- %p = partial_apply %f<T>(%x) : $@async @convention(thin) <C> (@in C) -> @out C
229- return %p : $@async @callee_owned () -> @out T
228+ %p = partial_apply [callee_guaranteed] %f<T>(%x) : $@async @convention(thin) <C> (@in C) -> @out C
229+ return %p : $@async @callee_guaranteed () -> @out T
230230}
231231
232232// CHECK-LABEL: define internal swift{{(tail)?}}cc void @"$s28captured_dependent_out_paramTA"(
233233
234- sil @partial_apply_dynamic_with_out_param : $@async @convention(thin) <T> (Int32, @owned @async @callee_owned (Int32) -> @out T) -> @async @callee_owned () -> @out T {
235- bb0(%x : $Int32, %f : $@async @callee_owned (Int32) -> @out T):
236- %p = partial_apply %f(%x) : $@async @callee_owned (Int32) -> @out T
237- return %p : $@async @callee_owned () -> @out T
234+ sil @partial_apply_dynamic_with_out_param : $@async @convention(thin) <T> (Int32, @owned @async @callee_guaranteed (Int32) -> @out T) -> @async @callee_guaranteed () -> @out T {
235+ bb0(%x : $Int32, %f : $@async @callee_guaranteed (Int32) -> @out T):
236+ %p = partial_apply [callee_guaranteed] %f(%x) : $@async @callee_guaranteed (Int32) -> @out T
237+ return %p : $@async @callee_guaranteed () -> @out T
238238}
239239
240240// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swift{{(tail)?}}cc void @partial_apply_dynamic_with_out_param(
@@ -254,17 +254,17 @@ bb0(%0 : $Base):
254254 return %1 : $C
255255}
256256
257- sil public_external @receive_closure : $@async @convention(thin) <C where C : Base> (@owned @async @callee_owned () -> (@owned C)) -> ()
257+ sil public_external @receive_closure : $@async @convention(thin) <C where C : Base> (@owned @async @callee_guaranteed () -> (@owned C)) -> ()
258258
259259// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swift{{(tail)?}}cc void @test_partial_apply(
260260
261261sil @test_partial_apply : $@async @convention(thin) (@owned Base) -> () {
262262bb0(%0 : $Base):
263263 %1 = function_ref @parametric_casting_closure : $@async @convention(thin) <C where C : Base> (@owned Base) -> @owned C
264- %6 = partial_apply %1<Sub>() : $@async @convention(thin) <C where C : Base> (@owned Base) -> @owned C
265- %2 = partial_apply %1<Sub>(%0) : $@async @convention(thin) <C where C : Base> (@owned Base) -> @owned C
266- %3 = function_ref @receive_closure : $@async @convention(thin) <C where C : Base> (@owned @async @callee_owned () -> (@owned C)) -> ()
267- %4 = apply %3<Sub>(%2) : $@async @convention(thin) <C where C : Base> (@owned @async @callee_owned () -> (@owned C)) -> ()
264+ %6 = partial_apply [callee_guaranteed] %1<Sub>() : $@async @convention(thin) <C where C : Base> (@owned Base) -> @owned C
265+ %2 = partial_apply [callee_guaranteed] %1<Sub>(%0) : $@async @convention(thin) <C where C : Base> (@owned Base) -> @owned C
266+ %3 = function_ref @receive_closure : $@async @convention(thin) <C where C : Base> (@owned @async @callee_guaranteed () -> (@owned C)) -> ()
267+ %4 = apply %3<Sub>(%2) : $@async @convention(thin) <C where C : Base> (@owned @async @callee_guaranteed () -> (@owned C)) -> ()
268268 %5 = tuple ()
269269 return %5 : $()
270270}
@@ -283,7 +283,7 @@ entry(%i : $Int):
283283sil @partial_apply_complex_generic_function : $@async @convention(thin) <T where T : P2, T.Y : P2> (Int) -> () {
284284bb0(%0 : $Int):
285285 %fn = function_ref @complex_generic_function : $@async @convention(thin) <T where T : P2, T.Y : P2> (Int) -> ()
286- %pa = partial_apply %fn <T>(%0) : $@async @convention(thin) <T where T : P2, T.Y : P1, T.Y : P2> (Int) -> ()
286+ %pa = partial_apply [callee_guaranteed] %fn <T>(%0) : $@async @convention(thin) <T where T : P2, T.Y : P1, T.Y : P2> (Int) -> ()
287287 %result = tuple ()
288288 return %result : $()
289289}
@@ -300,7 +300,7 @@ sil hidden @generic_function : $@async @convention(thin) <T> () -> () {
300300sil @partial_apply_with_generic_type : $@async @convention(thin) <U: P2> () -> () {
301301bb0:
302302 %fn = function_ref @generic_function : $@async @convention(thin) <T> () -> ()
303- %pa = partial_apply %fn <ComplexBoundedType<U>>() : $@async @convention(thin) <T> () -> ()
303+ %pa = partial_apply [callee_guaranteed] %fn <ComplexBoundedType<U>>() : $@async @convention(thin) <T> () -> ()
304304 %result = tuple ()
305305 return %result : $()
306306}
@@ -314,7 +314,7 @@ sil hidden_external @concrete_witness_method : $@async @convention(witness_metho
314314sil hidden @partial_apply_witness_method : $@async @convention(thin) (Int) -> () {
315315bb0(%0 : $Int):
316316 %fn = function_ref @concrete_witness_method : $@async @convention(witness_method: P0) (Int, Int) -> ()
317- %pa = partial_apply %fn (%0) : $@async @convention(witness_method: P0) (Int, Int) -> ()
317+ %pa = partial_apply [callee_guaranteed] %fn (%0) : $@async @convention(witness_method: P0) (Int, Int) -> ()
318318 %result = tuple ()
319319 return %result : $()
320320}
@@ -332,11 +332,11 @@ entry(%i : $Int):
332332}
333333
334334// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swift{{(tail)?}}cc void @partial_apply_generic_indirect_return(
335- sil @partial_apply_generic_indirect_return : $@async @convention(thin) (Int) -> @async @callee_owned () -> @owned GenericEnum<Int> {
335+ sil @partial_apply_generic_indirect_return : $@async @convention(thin) (Int) -> @async @callee_guaranteed () -> @owned GenericEnum<Int> {
336336 bb0(%0 : $Int):
337337 %fn = function_ref @generic_indirect_return :$@async @convention(thin) <T> (Int) -> @owned GenericEnum<T>
338- %pa = partial_apply %fn<Int> (%0) : $@async @convention(thin) <T> (Int) -> @owned GenericEnum<T>
339- return %pa : $@async @callee_owned () -> @owned GenericEnum<Int>
338+ %pa = partial_apply [callee_guaranteed] %fn<Int> (%0) : $@async @convention(thin) <T> (Int) -> @owned GenericEnum<T>
339+ return %pa : $@async @callee_guaranteed () -> @owned GenericEnum<Int>
340340}
341341
342342// Crash on partial apply of a generic enum.
@@ -351,11 +351,11 @@ entry(%i : $Int):
351351}
352352
353353// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swift{{(tail)?}}cc void @partial_apply_generic_indirect_return2(
354- sil @partial_apply_generic_indirect_return2 : $@async @convention(thin) (Int) -> @async @callee_owned () -> @owned GenericEnum2<Int> {
354+ sil @partial_apply_generic_indirect_return2 : $@async @convention(thin) (Int) -> @async @callee_guaranteed () -> @owned GenericEnum2<Int> {
355355 bb0(%0 : $Int):
356356 %fn = function_ref @generic_indirect_return2 :$@async @convention(thin) <T> (Int) -> @owned GenericEnum2<T>
357- %pa = partial_apply %fn<Int> (%0) : $@async @convention(thin) <T> (Int) -> @owned GenericEnum2<T>
358- return %pa : $@async @callee_owned () -> @owned GenericEnum2<Int>
357+ %pa = partial_apply [callee_guaranteed] %fn<Int> (%0) : $@async @convention(thin) <T> (Int) -> @owned GenericEnum2<T>
358+ return %pa : $@async @callee_guaranteed () -> @owned GenericEnum2<Int>
359359}
360360
361361struct SwiftStruct {}
@@ -368,11 +368,11 @@ entry(%t : $@thin SwiftStruct.Type, %c : $SwiftClass):
368368
369369// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swift{{(tail)?}}cc void @partial_apply_thin_type(
370370
371- sil @partial_apply_thin_type : $@async @convention(thin) (@thin SwiftStruct.Type, @owned SwiftClass) -> @async @callee_owned () -> () {
371+ sil @partial_apply_thin_type : $@async @convention(thin) (@thin SwiftStruct.Type, @owned SwiftClass) -> @async @callee_guaranteed () -> () {
372372entry(%0: $@thin SwiftStruct.Type, %1: $SwiftClass):
373373 %fun = function_ref @fun : $@async @convention(thin) (@thin SwiftStruct.Type, @owned SwiftClass) -> ()
374- %closure = partial_apply %fun (%0, %1) : $@async @convention(thin) (@thin SwiftStruct.Type, @owned SwiftClass) -> ()
375- return %closure : $@async @callee_owned () -> ()
374+ %closure = partial_apply [callee_guaranteed] %fun (%0, %1) : $@async @convention(thin) (@thin SwiftStruct.Type, @owned SwiftClass) -> ()
375+ return %closure : $@async @callee_guaranteed () -> ()
376376}
377377
378378sil @afun : $@async @convention(thin) (Int) -> @error Error
0 commit comments