@@ -47,55 +47,6 @@ bb0(%0 : $*T, %1 : $*T):
47
47
return %9 : $()
48
48
} // end sil function 'testInliningOfGenerics'
49
49
50
- sil hidden @P_combine : $@convention(method) <Self where Self : P><T> (@in T, @guaranteed Self) -> @owned @callee_owned (@in T) -> Bool {
51
- bb0(%0 : $*T, %1 : $Self):
52
- // function_ref P.(combine<A> (first : A1) -> (A1) -> Bool).(closure #1)
53
- %4 = function_ref @_TFFE50generic_inlining_partial_apply_opened_existentialsPS_1P7combineurFT5firstqd___Fqd__SbU_Fqd__Sb : $@convention(thin) <τ_0_0 where τ_0_0 : P><τ_1_0> (@in τ_1_0) -> Bool
54
- %5 = partial_apply %4<Self, T>() : $@convention(thin) <τ_0_0 where τ_0_0 : P><τ_1_0> (@in τ_1_0) -> Bool
55
- destroy_addr %0 : $*T
56
- return %5 : $@callee_owned (@in T) -> Bool
57
- } // end sil function 'P_combine'
58
-
59
- // P.(combine<A> (first : A1) -> (A1) -> Bool).(closure #1)
60
- sil shared @_TFFE50generic_inlining_partial_apply_opened_existentialsPS_1P7combineurFT5firstqd___Fqd__SbU_Fqd__Sb : $@convention(thin) <Self where Self : P><T> (@in T) -> Bool {
61
- bb0(%0 : $*T):
62
- %2 = integer_literal $Builtin.Int1, -1
63
- %3 = struct $Bool (%2 : $Builtin.Int1)
64
- destroy_addr %0 : $*T
65
- return %3 : $Bool
66
- } // end sil function '_TFFE50generic_inlining_partial_apply_opened_existentialsPS_1P7combineurFT5firstqd___Fqd__SbU_Fqd__Sb'
67
-
68
-
69
- // Check that P_combine is not inlined into the generic function, because
70
- // doing so would result in a partial_apply instruction, with an opened existential
71
- // in the substitution list. And this cannot be handled by the IRGen yet.
72
- // CHECK-LABEL: sil @dont_inline_callee_with_opened_existential_in_partial_apply_substitution_list
73
- // CHECK: [[FUN_REF:%[0-9]+]] = function_ref @P_combine
74
- // CHECK: apply [[FUN_REF]]
75
- // CHECK: end sil function 'dont_inline_callee_with_opened_existential_in_partial_apply_substitution_list'
76
- sil @dont_inline_callee_with_opened_existential_in_partial_apply_substitution_list : $@convention(thin) <T where T : P> (@owned P) -> @owned @callee_owned (@owned T) -> Bool {
77
- bb0(%0 : $P):
78
- %2 = open_existential_ref %0 : $P to $@opened("41B148C8-F49C-11E6-BE69-A45E60E99281") P
79
- // function_ref P.combine<A> (first : A1) -> (A1) -> Bool
80
- %3 = function_ref @P_combine : $@convention(method) <τ_0_0 where τ_0_0 : P><τ_1_0> (@in τ_1_0, @guaranteed τ_0_0) -> @owned @callee_owned (@in τ_1_0) -> Bool
81
- %4 = open_existential_ref %0 : $P to $@opened("41B14A4E-F49C-11E6-BE69-A45E60E99281") P
82
- %5 = witness_method $@opened("41B14A4E-F49C-11E6-BE69-A45E60E99281") P, #P.getSelf : <Self where Self : P> (Self) -> () -> Self, %4 : $@opened("41B14A4E-F49C-11E6-BE69-A45E60E99281") P : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@guaranteed τ_0_0) -> @owned τ_0_0
83
- %6 = apply %5<@opened("41B14A4E-F49C-11E6-BE69-A45E60E99281") P>(%4) : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@guaranteed τ_0_0) -> @owned τ_0_0
84
- %7 = init_existential_ref %6 : $@opened("41B14A4E-F49C-11E6-BE69-A45E60E99281") P : $@opened("41B14A4E-F49C-11E6-BE69-A45E60E99281") P, $P
85
- %8 = alloc_stack $P
86
- store %7 to %8 : $*P
87
- %10 = apply %3<@opened("41B148C8-F49C-11E6-BE69-A45E60E99281") P, P>(%8, %2) : $@convention(method) <τ_0_0 where τ_0_0 : P><τ_1_0> (@in τ_1_0, @guaranteed τ_0_0) -> @owned @callee_owned (@in τ_1_0) -> Bool
88
- // function_ref thunk
89
- %11 = function_ref @thunk1 : $@convention(thin) (@owned P, @owned @callee_owned (@in P) -> Bool) -> Bool
90
- %12 = partial_apply %11(%10) : $@convention(thin) (@owned P, @owned @callee_owned (@in P) -> Bool) -> Bool
91
- // function_ref thunk
92
- %13 = function_ref @thunk2 : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@owned τ_0_0, @owned @callee_owned (@owned P) -> Bool) -> Bool
93
- %14 = partial_apply %13<T>(%12) : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@owned τ_0_0, @owned @callee_owned (@owned P) -> Bool) -> Bool
94
- dealloc_stack %8 : $*P
95
- strong_release %0 : $P
96
- return %14 : $@callee_owned (@owned T) -> Bool
97
- } // end sil function 'dont_inline_callee_with_opened_existential_in_partial_apply_substitution_list'
98
-
99
50
// thunk
100
51
sil shared [transparent] [reabstraction_thunk] @thunk1 : $@convention(thin) (@owned P, @owned @callee_owned (@in P) -> Bool) -> Bool {
101
52
bb0(%0 : $P, %1 : $@callee_owned (@in P) -> Bool):
0 commit comments