@@ -179,6 +179,24 @@ public func usePrespecializedEntryPoints(wrapperStruct: ReferenceWrapperStruct,
179179 useInternalThing ( SomeClass ( ) )
180180}
181181
182+ // OPT: sil @$s22pre_specialize_layouts46usePrespecializedEntryPointsWithMarkerProtocol1ty0a20_specialized_module_C09SomeClassC_tF : $@convention(thin) (@guaranteed SomeClass) -> () {
183+ // OPT: bb0([[P1:%.*]] : $SomeClass):
184+ // OPT: [[R1:%.*]] = alloc_stack $SomeClass
185+ // OPT: [[F1:%.*]] = function_ref @$s30pre_specialized_module_layouts38publicPrespecializedWithMarkerProtocolyxxs8SendableRzlFyXl_Ts5 : $@convention(thin) (@guaranteed AnyObject) -> @owned AnyObject
186+ // OPT: [[R2:%.*]] = unchecked_addr_cast [[R1]] : $*SomeClass to $*AnyObject
187+ // OPT: [[A1:%.*]] = unchecked_ref_cast [[P1]] : $SomeClass to $AnyObject
188+ // OPT: [[R3:%.*]] = apply [[F1]]([[A1]]) : $@convention(thin) (@guaranteed AnyObject) -> @owned AnyObject
189+ // OPT: store [[R3]] to [[R2]] : $*AnyObject
190+ // OPT: [[A2:%.*]] = load [[R1]] : $*SomeClass
191+ // OPT: [[F2:%.*]] = function_ref @$s22pre_specialize_layouts7consumeyyxlF0a20_specialized_module_C09SomeClassC_Tg5 : $@convention(thin) (@guaranteed SomeClass) -> ()
192+ // OPT: apply [[F2]]([[A2]]) : $@convention(thin) (@guaranteed SomeClass) -> ()
193+ // OPT: strong_release [[A2]] : $SomeClass
194+ // OPT: dealloc_stack [[R1]] : $*SomeClass
195+ // OPT: } // end sil function '$s22pre_specialize_layouts46usePrespecializedEntryPointsWithMarkerProtocol1ty0a20_specialized_module_C09SomeClassC_tF'
196+ public func usePrespecializedEntryPointsWithMarkerProtocol( t: SomeClass ) {
197+ consume ( publicPrespecializedWithMarkerProtocol ( t) )
198+ }
199+
182200// OPT: sil @$s22pre_specialize_layouts34usePrespecializedThrowsEntryPointsyyKF : $@convention(thin) () -> @error any Error {
183201// OPT: [[F1:%.*]] = function_ref @$s30pre_specialized_module_layouts26publicPrespecializedThrowsyxxKlFSi_Ts5 : $@convention(thin) (Int) -> (Int, @error any Error)
184202// OPT: try_apply [[F1]]({{%.*}}) : $@convention(thin) (Int) -> (Int, @error any Error)
@@ -222,6 +240,21 @@ public func usePresepcializedMultipleIndirectResults(_ c: SomeClass, _ d: SomeOt
222240 consume ( publicPresepcializedMultipleIndirectResults ( xs, ys, x) )
223241}
224242
243+ // OPT: sil @$s22pre_specialize_layouts58usePresepcializedMultipleIndirectResultsWithMarkerProtocolyy0a20_specialized_module_C09SomeClassC_AA0n5OtherO0Cs5Int64VtF : $@convention(thin) (@guaranteed SomeClass, @guaranteed SomeOtherClass, Int64) -> () {
244+ // OPT: {{bb.*}}([[P1:%.*]] : $SomeClass, [[P2:%.*]] : $SomeOtherClass, [[P3:%.*]] : $Int64):
245+ // OPT: [[R1:%.*]] = alloc_stack $SomeOtherClass
246+ // OPT: [[R2:%.*]] = alloc_stack $SomeClass
247+ // OPT: [[F1:%.*]] = function_ref @$s30pre_specialized_module_layouts61publicPresepcializedMultipleIndirectResultsWithMarkerProtocolyq__s5Int64Vxtx_q_ADts8SendableRzr0_lFyXl_yXlTs5 : $@convention(thin) (@guaranteed AnyObject, @guaranteed AnyObject, Int64) -> (@out AnyObject, Int64, @out AnyObject)
248+ // OPT: [[R3:%.*]] = unchecked_addr_cast [[R1]] : $*SomeOtherClass to $*AnyObject
249+ // OPT: [[R4:%.*]] = unchecked_addr_cast [[R2]] : $*SomeClass to $*AnyObject
250+ // OPT: [[A1:%.*]] = unchecked_ref_cast [[P1]] : $SomeClass to $AnyObject
251+ // OPT: [[A2:%.*]] = unchecked_ref_cast [[P2]] : $SomeOtherClass to $AnyObject
252+ // OPT: apply [[F1]]([[R3]], [[R4]], [[A1]], [[A2]], [[P3]]) : $@convention(thin) (@guaranteed AnyObject, @guaranteed AnyObject, Int64) -> (@out AnyObject, Int64, @out AnyObject)
253+ // OPT: } // end sil function '$s22pre_specialize_layouts58usePresepcializedMultipleIndirectResultsWithMarkerProtocolyy0a20_specialized_module_C09SomeClassC_AA0n5OtherO0Cs5Int64VtF'
254+ public func usePresepcializedMultipleIndirectResultsWithMarkerProtocol( _ c: SomeClass , _ d: SomeOtherClass , _ x: Int64 ) {
255+ consume ( publicPresepcializedMultipleIndirectResultsWithMarkerProtocol ( c, d, x) )
256+ }
257+
225258// OPT: sil [noinline] @$s22pre_specialize_layouts15usePartialApply1y0a20_specialized_module_C09SomeClassCAFcAF_tF : $@convention(thin) (@guaranteed SomeClass) -> @owned @callee_guaranteed (@guaranteed SomeClass) -> @owned SomeClass {
226259// OPT: [[F1:%.*]] = function_ref @$s22pre_specialize_layouts15usePartialApply1y0a20_specialized_module_C09SomeClassCAFcAF_tF0deF5InnerL_1xxx_tlFyXl_Ts5 : $@convention(thin) (@guaranteed AnyObject, @guaranteed SomeClass) -> @owned AnyObject
227260// OPT: [[R1:%.*]] = partial_apply [callee_guaranteed] [[F1]]({{%.*}}) : $@convention(thin) (@guaranteed AnyObject, @guaranteed SomeClass) -> @owned AnyObject
0 commit comments