@@ -2855,7 +2855,21 @@ bb0(%0 : @owned $Klass):
2855
2855
%2 = open_existential_ref %1 : $AnyObject to $@opened("7CAE06CE-5F10-11E4-AF13-C82A1428F987", AnyObject) Self
2856
2856
%f = function_ref @use_generic_obj_guaranteed : $@convention(thin) <τ_0_0> (@guaranteed τ_0_0) -> ()
2857
2857
apply %f<@opened("7CAE06CE-5F10-11E4-AF13-C82A1428F987", AnyObject) Self>(%2) : $@convention(thin) <τ_0_0> (@guaranteed τ_0_0) -> ()
2858
+ %3 = unchecked_ref_cast %2 : $@opened("7CAE06CE-5F10-11E4-AF13-C82A1428F987", AnyObject) Self to $Builtin.NativeObject
2859
+ return %3 : $Builtin.NativeObject
2860
+ }
2858
2861
2862
+ // CHECK-LABEL: sil [ossa] @collapse_existential_pack_unpack_unchecked_ref_cast_owned4 :
2863
+ // CHECK: apply {{.*}}<Klass>
2864
+ // CHECK: } // end sil function 'collapse_existential_pack_unpack_unchecked_ref_cast_owned4'
2865
+ sil [ossa] @collapse_existential_pack_unpack_unchecked_ref_cast_owned4 : $@convention(thin) (@owned Klass) -> @owned Builtin.NativeObject {
2866
+ bb0(%0 : @owned $Klass):
2867
+ %1 = init_existential_ref %0 : $Klass : $Klass, $AnyObject
2868
+ %f1 = function_ref @use_anyobject_guaranteed : $@convention(thin) (@guaranteed AnyObject) -> ()
2869
+ apply %f1(%1) : $@convention(thin) (@guaranteed AnyObject) -> ()
2870
+ %2 = open_existential_ref %1 : $AnyObject to $@opened("7CAE06CE-5F10-11E4-AF13-C82A1428F987", AnyObject) Self
2871
+ %f2 = function_ref @use_generic_obj_guaranteed : $@convention(thin) <τ_0_0> (@guaranteed τ_0_0) -> ()
2872
+ apply %f2<@opened("7CAE06CE-5F10-11E4-AF13-C82A1428F987", AnyObject) Self>(%2) : $@convention(thin) <τ_0_0> (@guaranteed τ_0_0) -> ()
2859
2873
%3 = unchecked_ref_cast %2 : $@opened("7CAE06CE-5F10-11E4-AF13-C82A1428F987", AnyObject) Self to $Builtin.NativeObject
2860
2874
return %3 : $Builtin.NativeObject
2861
2875
}
0 commit comments