mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This pass removes `copy_addr` instructions. However, it has some problems which causes compiler crashes. It's not worth fixing these bugs because 1. Most copy_addrs can be eliminated by TempRValueElimination and TempLValueElimination. 2. Once we have opaque value we don't need copy_addr elimination, anyway. rdar://162212460
696 lines
48 KiB
Plaintext
696 lines
48 KiB
Plaintext
// RUN: %target-sil-opt -sil-print-types -wmo -enable-sil-verify-all %s -inline -sil-combine -generic-specializer -allocbox-to-stack -lower-aggregate-instrs -mem2reg -devirtualizer -inline -dead-arg-signature-opt -dce | %FileCheck %s
|
|
import Builtin
|
|
import Swift
|
|
import SwiftShims
|
|
|
|
internal protocol SomeProtocol : AnyObject {
|
|
func foo() -> Int32
|
|
}
|
|
|
|
internal class SomeClass : SomeProtocol {
|
|
func foo() -> Int32
|
|
}
|
|
|
|
@inline(never) internal func wrap_foo_cp(a: SomeProtocol) -> Int32
|
|
|
|
func cp()
|
|
|
|
internal protocol SomeNoClassProtocol {
|
|
func foo() -> Int32
|
|
}
|
|
|
|
internal class SomeNoClass : SomeNoClassProtocol {
|
|
func foo() -> Int32
|
|
}
|
|
|
|
@inline(never) internal func wrap_foo_ncp(a: SomeNoClassProtocol) -> Int32
|
|
|
|
@inline(never) func ncp()
|
|
|
|
internal protocol SomeClassProtocolComp : AnyObject {
|
|
func foo() -> Int32
|
|
}
|
|
|
|
internal protocol SomeOtherClassProtocolComp : AnyObject {
|
|
func bar() -> Int32
|
|
}
|
|
|
|
internal class SomeClassComp : SomeClassProtocolComp, SomeOtherClassProtocolComp {
|
|
func foo() -> Int32
|
|
func bar() -> Int32
|
|
}
|
|
|
|
@inline(never) internal func wrap_foo_bar_cpc(a: SomeClassProtocolComp & SomeOtherClassProtocolComp) -> Int32
|
|
|
|
func cpc()
|
|
|
|
internal protocol SomeNoClassProtocolComp {
|
|
func foo() -> Int32
|
|
}
|
|
|
|
internal protocol SomeOtherNoClassProtocolComp {
|
|
func bar() -> Int32
|
|
}
|
|
|
|
internal class SomeNoClassComp : SomeNoClassProtocolComp, SomeOtherNoClassProtocolComp {
|
|
func foo() -> Int32
|
|
func bar() -> Int32
|
|
}
|
|
|
|
@inline(never) internal func wrap_no_foo_bar_comp_ncpc(a: SomeNoClassProtocolComp & SomeOtherNoClassProtocolComp) -> Int32
|
|
|
|
@inline(never) func ncpc()
|
|
|
|
internal protocol P : AnyObject {
|
|
func foo() -> Int32
|
|
}
|
|
|
|
internal class K : P {
|
|
func foo() -> Int32
|
|
}
|
|
internal class KPrime : P {
|
|
func foo() -> Int32
|
|
}
|
|
|
|
@inline(never) internal func do_not_optimize_cp(a: P) -> Int32
|
|
|
|
internal protocol PP : AnyObject {
|
|
func foo() -> Int32
|
|
}
|
|
|
|
internal class KK : PP {
|
|
func foo() -> Int32
|
|
}
|
|
internal class KKPrime : PP {
|
|
func foo() -> Int32
|
|
}
|
|
|
|
@inline(never) internal func wrap_inout_cp(a: inout PP) -> Int32
|
|
|
|
@inline(never) func do_not_optimize_inout_cp()
|
|
|
|
internal protocol PPP {
|
|
func foo() -> Int32
|
|
}
|
|
|
|
internal class KKK : PPP {
|
|
func foo() -> Int32
|
|
}
|
|
|
|
@inline(never) internal func wrap_inout_ncp(a: inout PPP) -> Int32
|
|
|
|
@inline(never) func inout_ncp()
|
|
|
|
internal protocol PPPP {
|
|
func foo() -> Int32
|
|
}
|
|
|
|
internal struct SSSS : PPPP {
|
|
func foo() -> Int32
|
|
}
|
|
|
|
@inline(never) internal func wrap_struct_inout_ncp(a: inout PPPP) -> Int32
|
|
|
|
@inline(never) func struct_inout_ncp()
|
|
|
|
|
|
sil hidden @$s21existential_transform9SomeClassC3foos5Int32VyF : $@convention(method) (@guaranteed SomeClass) -> Int32 {
|
|
bb0(%0 : $SomeClass):
|
|
%1 = integer_literal $Builtin.Int32, 10
|
|
%2 = struct $Int32 (%1 : $Builtin.Int32)
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform9SomeClassC3foos5Int32VyF'
|
|
|
|
sil private [transparent] [thunk] @$s21existential_transform9SomeClassCAA0C8ProtocolA2aDP3foos5Int32VyFTW : $@convention(witness_method: SomeProtocol) (@guaranteed SomeClass) -> Int32 {
|
|
bb0(%0 : $SomeClass):
|
|
%1 = class_method %0 : $SomeClass, #SomeClass.foo : (SomeClass) -> () -> Int32, $@convention(method) (@guaranteed SomeClass) -> Int32
|
|
%2 = apply %1(%0) : $@convention(method) (@guaranteed SomeClass) -> Int32
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform9SomeClassCAA0C8ProtocolA2aDP3foos5Int32VyFTW'
|
|
|
|
sil hidden [signature_optimized_thunk] [heuristic_always_inline] @$s21existential_transform11wrap_foo_cp1as5Int32VAA12SomeProtocol_p_tF : $@convention(thin) (@guaranteed SomeProtocol) -> Int32 {
|
|
bb0(%0 : $SomeProtocol):
|
|
%1 = function_ref @$s21existential_transform11wrap_foo_cp1as5Int32VAA12SomeProtocol_p_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : SomeProtocol> (@guaranteed τ_0_0) -> Int32
|
|
%2 = open_existential_ref %0 : $SomeProtocol to $@opened("CC97E160-AC7C-11E8-B742-D0817AD4059B", SomeProtocol) Self
|
|
%3 = apply %1<@opened("CC97E160-AC7C-11E8-B742-D0817AD4059B", SomeProtocol) Self>(%2) : $@convention(thin) <τ_0_0 where τ_0_0 : SomeProtocol> (@guaranteed τ_0_0) -> Int32
|
|
return %3 : $Int32
|
|
} // end sil function '$s21existential_transform11wrap_foo_cp1as5Int32VAA12SomeProtocol_p_tF'
|
|
|
|
// CHECK-LABEL: sil hidden @$s21existential_transform2cpyyF : $@convention(thin) () -> () {
|
|
// CHECK: bb0:
|
|
// CHECK: %0 = alloc_ref $SomeClass
|
|
// CHECK: debug_value %0 : $SomeClass, let, name "self", argno 1
|
|
// CHECK: %2 = function_ref @$s21existential_transform11wrap_foo_cp1as5Int32VAA12SomeProtocol_p_tFTf4e_n4main0G5ClassC_Tg5 : $@convention(thin) (@guaranteed SomeClass) -> Int32
|
|
// CHECK: %3 = apply %2(%0) : $@convention(thin) (@guaranteed SomeClass) -> Int32
|
|
// CHECK: strong_release %0 : $SomeClass
|
|
// CHECK: %5 = tuple ()
|
|
// CHECK: return %5 : $()
|
|
// CHECK-LABEL: } // end sil function '$s21existential_transform2cpyyF'
|
|
sil hidden @$s21existential_transform2cpyyF : $@convention(thin) () -> () {
|
|
bb0:
|
|
%0 = alloc_ref $SomeClass
|
|
debug_value %0 : $SomeClass, let, name "self", argno 1
|
|
%2 = init_existential_ref %0 : $SomeClass : $SomeClass, $SomeProtocol
|
|
debug_value %2 : $SomeProtocol, let, name "magic1"
|
|
%4 = function_ref @$s21existential_transform11wrap_foo_cp1as5Int32VAA12SomeProtocol_p_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : SomeProtocol> (@guaranteed τ_0_0) -> Int32
|
|
%5 = open_existential_ref %2 : $SomeProtocol to $@opened("CC97E55C-AC7C-11E8-B742-D0817AD4059B", SomeProtocol) Self
|
|
%6 = apply %4<@opened("CC97E55C-AC7C-11E8-B742-D0817AD4059B", SomeProtocol) Self>(%5) : $@convention(thin) <τ_0_0 where τ_0_0 : SomeProtocol> (@guaranteed τ_0_0) -> Int32
|
|
strong_release %0 : $SomeClass
|
|
%8 = tuple ()
|
|
return %8 : $()
|
|
} // end sil function '$s21existential_transform2cpyyF'
|
|
|
|
sil hidden @$s21existential_transform11SomeNoClassC3foos5Int32VyF : $@convention(method) (@guaranteed SomeNoClass) -> Int32 {
|
|
bb0(%0 : $SomeNoClass):
|
|
%1 = integer_literal $Builtin.Int32, 10
|
|
%2 = struct $Int32 (%1 : $Builtin.Int32)
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform11SomeNoClassC3foos5Int32VyF'
|
|
|
|
sil private [transparent] [thunk] @$s21existential_transform11SomeNoClassCAA0cdE8ProtocolA2aDP3foos5Int32VyFTW : $@convention(witness_method: SomeNoClassProtocol) (@in_guaranteed SomeNoClass) -> Int32 {
|
|
bb0(%0 : $*SomeNoClass):
|
|
%1 = load %0 : $*SomeNoClass
|
|
%2 = class_method %1 : $SomeNoClass, #SomeNoClass.foo : (SomeNoClass) -> () -> Int32, $@convention(method) (@guaranteed SomeNoClass) -> Int32
|
|
%3 = apply %2(%1) : $@convention(method) (@guaranteed SomeNoClass) -> Int32
|
|
return %3 : $Int32
|
|
} // end sil function '$s21existential_transform11SomeNoClassCAA0cdE8ProtocolA2aDP3foos5Int32VyFTW'
|
|
|
|
sil hidden [signature_optimized_thunk] [heuristic_always_inline] @$s21existential_transform12wrap_foo_ncp1as5Int32VAA19SomeNoClassProtocol_p_tF : $@convention(thin) (@in_guaranteed SomeNoClassProtocol) -> Int32 {
|
|
bb0(%0 : $*SomeNoClassProtocol):
|
|
%1 = function_ref @$s21existential_transform12wrap_foo_ncp1as5Int32VAA19SomeNoClassProtocol_p_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : SomeNoClassProtocol> (@in_guaranteed τ_0_0) -> Int32
|
|
%2 = open_existential_addr immutable_access %0 : $*SomeNoClassProtocol to $*@opened("CC97FCD6-AC7C-11E8-B742-D0817AD4059B", SomeNoClassProtocol) Self
|
|
%3 = apply %1<@opened("CC97FCD6-AC7C-11E8-B742-D0817AD4059B", SomeNoClassProtocol) Self>(%2) : $@convention(thin) <τ_0_0 where τ_0_0 : SomeNoClassProtocol> (@in_guaranteed τ_0_0) -> Int32
|
|
return %3 : $Int32
|
|
} // end sil function '$s21existential_transform12wrap_foo_ncp1as5Int32VAA19SomeNoClassProtocol_p_tF'
|
|
|
|
// CHECK-LABEL: sil hidden [noinline] @$s21existential_transform3ncpyyF : $@convention(thin) () -> () {
|
|
// CHECK: bb0:
|
|
// CHECK: %[[ALLOCREF:[0-9]+]] = alloc_ref $SomeNoClass
|
|
// CHECK: debug_value %[[ALLOCREF]] : $SomeNoClass, let, name "self", argno 1
|
|
// CHECK: %[[FUNC:[0-9]+]] = function_ref @$s21existential_transform12wrap_foo_ncp1as5Int32VAA19SomeNoClassProtocol_p_tFTf4e_n4main0ghI0C_Tg5 : $@convention(thin) (@guaranteed SomeNoClass) -> Int32
|
|
// CHECK: %[[RES:[0-9]+]] = apply %[[FUNC]](%[[ALLOCREF]]) : $@convention(thin) (@guaranteed SomeNoClass) -> Int32
|
|
// CHECK: strong_release %[[ALLOCREF]] : $SomeNoClass
|
|
// CHECK: %[[RET:[0-9]+]] = tuple ()
|
|
// CHECK: return %[[RET]] : $()
|
|
// CHECK-LABEL: } // end sil function '$s21existential_transform3ncpyyF'
|
|
sil hidden [noinline] @$s21existential_transform3ncpyyF : $@convention(thin) () -> () {
|
|
bb0:
|
|
%0 = alloc_stack $SomeNoClassProtocol, let, name "magic2"
|
|
%1 = alloc_ref $SomeNoClass
|
|
debug_value %1 : $SomeNoClass, let, name "self", argno 1
|
|
%3 = init_existential_addr %0 : $*SomeNoClassProtocol, $SomeNoClass
|
|
store %1 to %3 : $*SomeNoClass
|
|
%5 = function_ref @$s21existential_transform12wrap_foo_ncp1as5Int32VAA19SomeNoClassProtocol_p_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : SomeNoClassProtocol> (@in_guaranteed τ_0_0) -> Int32
|
|
%6 = open_existential_addr mutable_access %0 : $*SomeNoClassProtocol to $*@opened("CC9800F0-AC7C-11E8-B742-D0817AD4059B", SomeNoClassProtocol) Self
|
|
%7 = apply %5<@opened("CC9800F0-AC7C-11E8-B742-D0817AD4059B", SomeNoClassProtocol) Self>(%6) : $@convention(thin) <τ_0_0 where τ_0_0 : SomeNoClassProtocol> (@in_guaranteed τ_0_0) -> Int32
|
|
destroy_addr %0 : $*SomeNoClassProtocol
|
|
dealloc_stack %0 : $*SomeNoClassProtocol
|
|
%10 = tuple ()
|
|
return %10 : $()
|
|
} // end sil function '$s21existential_transform3ncpyyF'
|
|
|
|
sil hidden @$s21existential_transform13SomeClassCompC3foos5Int32VyF : $@convention(method) (@guaranteed SomeClassComp) -> Int32 {
|
|
bb0(%0 : $SomeClassComp):
|
|
%1 = integer_literal $Builtin.Int32, 10
|
|
%2 = struct $Int32 (%1 : $Builtin.Int32)
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform13SomeClassCompC3foos5Int32VyF'
|
|
|
|
sil hidden @$s21existential_transform13SomeClassCompC3bars5Int32VyF : $@convention(method) (@guaranteed SomeClassComp) -> Int32 {
|
|
bb0(%0 : $SomeClassComp):
|
|
%1 = integer_literal $Builtin.Int32, 20
|
|
%2 = struct $Int32 (%1 : $Builtin.Int32)
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform13SomeClassCompC3bars5Int32VyF'
|
|
|
|
sil private [transparent] [thunk] @$s21existential_transform13SomeClassCompCAA0cd8ProtocolE0A2aDP3foos5Int32VyFTW : $@convention(witness_method: SomeClassProtocolComp) (@guaranteed SomeClassComp) -> Int32 {
|
|
bb0(%0 : $SomeClassComp):
|
|
%1 = class_method %0 : $SomeClassComp, #SomeClassComp.foo : (SomeClassComp) -> () -> Int32, $@convention(method) (@guaranteed SomeClassComp) -> Int32
|
|
%2 = apply %1(%0) : $@convention(method) (@guaranteed SomeClassComp) -> Int32
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform13SomeClassCompCAA0cd8ProtocolE0A2aDP3foos5Int32VyFTW'
|
|
|
|
sil private [transparent] [thunk] @$s21existential_transform13SomeClassCompCAA0c5Otherd8ProtocolE0A2aDP3bars5Int32VyFTW : $@convention(witness_method: SomeClassProtocolComp) (@guaranteed SomeClassComp) -> Int32 {
|
|
bb0(%0 : $SomeClassComp):
|
|
%1 = class_method %0 : $SomeClassComp, #SomeClassComp.bar : (SomeClassComp) -> () -> Int32, $@convention(method) (@guaranteed SomeClassComp) -> Int32
|
|
%2 = apply %1(%0) : $@convention(method) (@guaranteed SomeClassComp) -> Int32
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform13SomeClassCompCAA0c5Otherd8ProtocolE0A2aDP3bars5Int32VyFTW'
|
|
|
|
sil hidden [signature_optimized_thunk] [heuristic_always_inline] @$s21existential_transform16wrap_foo_bar_cpc1as5Int32VAA21SomeClassProtocolComp_AA0h5OtherijK0p_tF : $@convention(thin) (@guaranteed SomeClassProtocolComp & SomeOtherClassProtocolComp) -> Int32 {
|
|
bb0(%0 : $SomeClassProtocolComp & SomeOtherClassProtocolComp):
|
|
%1 = function_ref @$s21existential_transform16wrap_foo_bar_cpc1as5Int32VAA21SomeClassProtocolComp_AA0h5OtherijK0p_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : SomeClassProtocolComp, τ_0_0 : SomeOtherClassProtocolComp> (@guaranteed τ_0_0) -> Int32
|
|
%2 = open_existential_ref %0 : $SomeClassProtocolComp & SomeOtherClassProtocolComp to $@opened("CC981856-AC7C-11E8-B742-D0817AD4059B", SomeClassProtocolComp & SomeOtherClassProtocolComp) Self
|
|
%3 = apply %1<@opened("CC981856-AC7C-11E8-B742-D0817AD4059B", SomeClassProtocolComp & SomeOtherClassProtocolComp) Self>(%2) : $@convention(thin) <τ_0_0 where τ_0_0 : SomeClassProtocolComp, τ_0_0 : SomeOtherClassProtocolComp> (@guaranteed τ_0_0) -> Int32
|
|
return %3 : $Int32
|
|
} // end sil function '$s21existential_transform16wrap_foo_bar_cpc1as5Int32VAA21SomeClassProtocolComp_AA0h5OtherijK0p_tF'
|
|
|
|
// CHECK-LABEL: sil hidden @$s21existential_transform3cpcyyF : $@convention(thin) () -> () {
|
|
// CHECK: bb0:
|
|
// CHECK: %0 = alloc_ref $SomeClassComp
|
|
// CHECK: debug_value %0 : $SomeClassComp, let, name "self", argno 1
|
|
// CHECK: %2 = function_ref @$s21existential_transform16wrap_foo_bar_cpc1as5Int32VAA21SomeClassProtocolComp_AA0h5OtherijK0p_tFTf4e_n4main0hiK0C_Tg5 : $@convention(thin) (@guaranteed SomeClassComp) -> Int32
|
|
// CHECK: %3 = apply %2(%0) : $@convention(thin) (@guaranteed SomeClassComp) -> Int32
|
|
// CHECK: strong_release %0 : $SomeClassComp
|
|
// CHECK: %5 = tuple ()
|
|
// CHECK: return %5 : $()
|
|
// CHECK-LABEL: } // end sil function '$s21existential_transform3cpcyyF'
|
|
sil hidden @$s21existential_transform3cpcyyF : $@convention(thin) () -> () {
|
|
bb0:
|
|
%0 = alloc_ref $SomeClassComp
|
|
debug_value %0 : $SomeClassComp, let, name "self", argno 1
|
|
%2 = init_existential_ref %0 : $SomeClassComp : $SomeClassComp, $SomeClassProtocolComp & SomeOtherClassProtocolComp
|
|
debug_value %2 : $SomeClassProtocolComp & SomeOtherClassProtocolComp, let, name "magic3"
|
|
%4 = function_ref @$s21existential_transform16wrap_foo_bar_cpc1as5Int32VAA21SomeClassProtocolComp_AA0h5OtherijK0p_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : SomeClassProtocolComp, τ_0_0 : SomeOtherClassProtocolComp> (@guaranteed τ_0_0) -> Int32
|
|
%5 = open_existential_ref %2 : $SomeClassProtocolComp & SomeOtherClassProtocolComp to $@opened("CC981D1A-AC7C-11E8-B742-D0817AD4059B", SomeClassProtocolComp & SomeOtherClassProtocolComp) Self
|
|
%6 = apply %4<@opened("CC981D1A-AC7C-11E8-B742-D0817AD4059B", SomeClassProtocolComp & SomeOtherClassProtocolComp) Self>(%5) : $@convention(thin) <τ_0_0 where τ_0_0 : SomeClassProtocolComp, τ_0_0 : SomeOtherClassProtocolComp> (@guaranteed τ_0_0) -> Int32
|
|
strong_release %0 : $SomeClassComp
|
|
%8 = tuple ()
|
|
return %8 : $()
|
|
} // end sil function '$s21existential_transform3cpcyyF'
|
|
|
|
sil hidden @$s21existential_transform15SomeNoClassCompC3foos5Int32VyF : $@convention(method) (@guaranteed SomeNoClassComp) -> Int32 {
|
|
bb0(%0 : $SomeNoClassComp):
|
|
%1 = integer_literal $Builtin.Int32, 10
|
|
%2 = struct $Int32 (%1 : $Builtin.Int32)
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform15SomeNoClassCompC3foos5Int32VyF'
|
|
|
|
sil hidden @$s21existential_transform15SomeNoClassCompC3bars5Int32VyF : $@convention(method) (@guaranteed SomeNoClassComp) -> Int32 {
|
|
bb0(%0 : $SomeNoClassComp):
|
|
%1 = integer_literal $Builtin.Int32, 20
|
|
%2 = struct $Int32 (%1 : $Builtin.Int32)
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform15SomeNoClassCompC3bars5Int32VyF'
|
|
|
|
sil private [transparent] [thunk] @$s21existential_transform15SomeNoClassCompCAA0cde8ProtocolF0A2aDP3foos5Int32VyFTW : $@convention(witness_method: SomeNoClassProtocolComp) (@in_guaranteed SomeNoClassComp) -> Int32 {
|
|
bb0(%0 : $*SomeNoClassComp):
|
|
%1 = load %0 : $*SomeNoClassComp
|
|
%2 = class_method %1 : $SomeNoClassComp, #SomeNoClassComp.foo : (SomeNoClassComp) -> () -> Int32, $@convention(method) (@guaranteed SomeNoClassComp) -> Int32
|
|
%3 = apply %2(%1) : $@convention(method) (@guaranteed SomeNoClassComp) -> Int32
|
|
return %3 : $Int32
|
|
} // end sil function '$s21existential_transform15SomeNoClassCompCAA0cde8ProtocolF0A2aDP3foos5Int32VyFTW'
|
|
|
|
sil private [transparent] [thunk] @$s21existential_transform15SomeNoClassCompCAA0c5Otherde8ProtocolF0A2aDP3bars5Int32VyFTW : $@convention(witness_method: SomeNoClassProtocolComp) (@in_guaranteed SomeNoClassComp) -> Int32 {
|
|
bb0(%0 : $*SomeNoClassComp):
|
|
%1 = load %0 : $*SomeNoClassComp
|
|
%2 = class_method %1 : $SomeNoClassComp, #SomeNoClassComp.bar : (SomeNoClassComp) -> () -> Int32, $@convention(method) (@guaranteed SomeNoClassComp) -> Int32
|
|
%3 = apply %2(%1) : $@convention(method) (@guaranteed SomeNoClassComp) -> Int32
|
|
return %3 : $Int32
|
|
} // end sil function '$s21existential_transform15SomeNoClassCompCAA0c5Otherde8ProtocolF0A2aDP3bars5Int32VyFTW'
|
|
|
|
sil hidden [signature_optimized_thunk] [heuristic_always_inline] @$s21existential_transform25wrap_no_foo_bar_comp_ncpc1as5Int32VAA23SomeNoClassProtocolComp_AA0j5OtherklmN0p_tF : $@convention(thin) (@in_guaranteed SomeNoClassProtocolComp & SomeOtherNoClassProtocolComp) -> Int32 {
|
|
bb0(%0 : $*SomeNoClassProtocolComp & SomeOtherNoClassProtocolComp):
|
|
%1 = function_ref @$s21existential_transform25wrap_no_foo_bar_comp_ncpc1as5Int32VAA23SomeNoClassProtocolComp_AA0j5OtherklmN0p_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : SomeNoClassProtocolComp, τ_0_0 : SomeOtherNoClassProtocolComp> (@in_guaranteed τ_0_0) -> Int32
|
|
%2 = open_existential_addr immutable_access %0 : $*SomeNoClassProtocolComp & SomeOtherNoClassProtocolComp to $*@opened("CC983642-AC7C-11E8-B742-D0817AD4059B", SomeNoClassProtocolComp & SomeOtherNoClassProtocolComp) Self
|
|
%3 = apply %1<@opened("CC983642-AC7C-11E8-B742-D0817AD4059B", SomeNoClassProtocolComp & SomeOtherNoClassProtocolComp) Self>(%2) : $@convention(thin) <τ_0_0 where τ_0_0 : SomeNoClassProtocolComp, τ_0_0 : SomeOtherNoClassProtocolComp> (@in_guaranteed τ_0_0) -> Int32
|
|
return %3 : $Int32
|
|
} // end sil function '$s21existential_transform25wrap_no_foo_bar_comp_ncpc1as5Int32VAA23SomeNoClassProtocolComp_AA0j5OtherklmN0p_tF'
|
|
|
|
// CHECK-LABEL: sil hidden [noinline] @$s21existential_transform4ncpcyyF : $@convention(thin) () -> () {
|
|
// CHECK: bb0:
|
|
// CHECK: %[[ALLOCREF:[0-9]+]] = alloc_ref $SomeNoClassComp
|
|
// CHECK: debug_value %[[ALLOCREF]] : $SomeNoClassComp, let, name "self", argno 1
|
|
// CHECK: %[[FUNC:[0-9]+]] = function_ref @$s21existential_transform25wrap_no_foo_bar_comp_ncpc1as5Int32VAA23SomeNoClassProtocolComp_AA0j5OtherklmN0p_tFTf4e_n4main0jklN0C_Tg5 : $@convention(thin) (@guaranteed SomeNoClassComp) -> Int32
|
|
// CHECK: %[[RES:[0-9]+]] = apply %[[FUNC]](%[[ALLOCREF]]) : $@convention(thin) (@guaranteed SomeNoClassComp) -> Int32
|
|
// CHECK: strong_release %[[ALLOCREF]] : $SomeNoClassComp
|
|
// CHECK: %[[RET:[0-9]+]] = tuple ()
|
|
// CHECK: return %[[RET]] : $()
|
|
// CHECK-LABEL: } // end sil function '$s21existential_transform4ncpcyyF'
|
|
sil hidden [noinline] @$s21existential_transform4ncpcyyF : $@convention(thin) () -> () {
|
|
bb0:
|
|
%0 = alloc_stack $SomeNoClassProtocolComp & SomeOtherNoClassProtocolComp, let, name "magic4"
|
|
%1 = alloc_ref $SomeNoClassComp
|
|
debug_value %1 : $SomeNoClassComp, let, name "self", argno 1
|
|
%3 = init_existential_addr %0 : $*SomeNoClassProtocolComp & SomeOtherNoClassProtocolComp, $SomeNoClassComp
|
|
store %1 to %3 : $*SomeNoClassComp
|
|
%5 = function_ref @$s21existential_transform25wrap_no_foo_bar_comp_ncpc1as5Int32VAA23SomeNoClassProtocolComp_AA0j5OtherklmN0p_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : SomeNoClassProtocolComp, τ_0_0 : SomeOtherNoClassProtocolComp> (@in_guaranteed τ_0_0) -> Int32
|
|
%6 = open_existential_addr mutable_access %0 : $*SomeNoClassProtocolComp & SomeOtherNoClassProtocolComp to $*@opened("CC983AFC-AC7C-11E8-B742-D0817AD4059B", SomeNoClassProtocolComp & SomeOtherNoClassProtocolComp) Self
|
|
%7 = apply %5<@opened("CC983AFC-AC7C-11E8-B742-D0817AD4059B", SomeNoClassProtocolComp & SomeOtherNoClassProtocolComp) Self>(%6) : $@convention(thin) <τ_0_0 where τ_0_0 : SomeNoClassProtocolComp, τ_0_0 : SomeOtherNoClassProtocolComp> (@in_guaranteed τ_0_0) -> Int32
|
|
destroy_addr %0 : $*SomeNoClassProtocolComp & SomeOtherNoClassProtocolComp
|
|
dealloc_stack %0 : $*SomeNoClassProtocolComp & SomeOtherNoClassProtocolComp
|
|
%10 = tuple ()
|
|
return %10 : $()
|
|
} // end sil function '$s21existential_transform4ncpcyyF'
|
|
|
|
sil hidden @$s21existential_transform1KC3foos5Int32VyF : $@convention(method) (@guaranteed K) -> Int32 {
|
|
bb0(%0 : $K):
|
|
%1 = integer_literal $Builtin.Int32, 10
|
|
%2 = struct $Int32 (%1 : $Builtin.Int32)
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform1KC3foos5Int32VyF'
|
|
|
|
sil private [transparent] [thunk] @$s21existential_transform1KCAA1PA2aDP3foos5Int32VyFTW : $@convention(witness_method: P) (@guaranteed K) -> Int32 {
|
|
bb0(%0 : $K):
|
|
%1 = class_method %0 : $K, #K.foo : (K) -> () -> Int32, $@convention(method) (@guaranteed K) -> Int32
|
|
%2 = apply %1(%0) : $@convention(method) (@guaranteed K) -> Int32
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform1KCAA1PA2aDP3foos5Int32VyFTW'
|
|
|
|
// CHECK-LABEL: sil hidden [noinline] @$s21existential_transform18do_not_optimize_cp1as5Int32VAA1P_p_tF : $@convention(thin) (@guaranteed any P) -> Int32 {
|
|
// CHECK: bb0(%0 : $any P):
|
|
// CHECK: debug_value %0 : $any P, let, name "a", argno 1
|
|
// CHECK: %2 = open_existential_ref %0 : $any P to $@opened("{{.*}}", any P) Self
|
|
// CHECK: %3 = witness_method $@opened("{{.*}}", any P) Self, #P.foo : <Self where Self : P> (Self) -> () -> Int32, %2 : $@opened("{{.*}}", any P) Self : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@guaranteed τ_0_0) -> Int32
|
|
// CHECK: %4 = apply %3<@opened("{{.*}}", any P) Self>(%2) : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@guaranteed τ_0_0) -> Int32
|
|
// CHECK: return %4 : $Int32
|
|
// CHECK-LABEL: } // end sil function '$s21existential_transform18do_not_optimize_cp1as5Int32VAA1P_p_tF'
|
|
sil hidden [noinline] @$s21existential_transform18do_not_optimize_cp1as5Int32VAA1P_p_tF : $@convention(thin) (@guaranteed P) -> Int32 {
|
|
bb0(%0 : $P):
|
|
debug_value %0 : $P, let, name "a", argno 1
|
|
%2 = open_existential_ref %0 : $P to $@opened("CC9697D8-AC7C-11E8-B742-D0817AD4059B", P) Self
|
|
%3 = witness_method $@opened("CC9697D8-AC7C-11E8-B742-D0817AD4059B", P) Self, #P.foo : <Self where Self : P> (Self) -> () -> Int32, %2 : $@opened("CC9697D8-AC7C-11E8-B742-D0817AD4059B", P) Self : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@guaranteed τ_0_0) -> Int32
|
|
%4 = apply %3<@opened("CC9697D8-AC7C-11E8-B742-D0817AD4059B", P) Self>(%2) : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@guaranteed τ_0_0) -> Int32
|
|
return %4 : $Int32
|
|
} // end sil function '$s21existential_transform18do_not_optimize_cp1as5Int32VAA1P_p_tF'
|
|
|
|
sil hidden @$s21existential_transform2KKC3foos5Int32VyF : $@convention(method) (@guaranteed KK) -> Int32 {
|
|
bb0(%0 : $KK):
|
|
%1 = integer_literal $Builtin.Int32, 10
|
|
%2 = struct $Int32 (%1 : $Builtin.Int32)
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform2KKC3foos5Int32VyF'
|
|
|
|
sil private [transparent] [thunk] @$s21existential_transform2KKCAA2PPA2aDP3foos5Int32VyFTW : $@convention(witness_method: PP) (@guaranteed KK) -> Int32 {
|
|
bb0(%0 : $KK):
|
|
%1 = class_method %0 : $KK, #KK.foo : (KK) -> () -> Int32, $@convention(method) (@guaranteed KK) -> Int32
|
|
%2 = apply %1(%0) : $@convention(method) (@guaranteed KK) -> Int32
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform2KKCAA2PPA2aDP3foos5Int32VyFTW'
|
|
|
|
|
|
sil hidden [noinline] @$s21existential_transform13wrap_inout_cp1as5Int32VAA2PP_pz_tF : $@convention(thin) (@inout PP) -> Int32 {
|
|
bb0(%0 : $*PP):
|
|
debug_value %0 : $*PP, var, name "a", argno 1, expr op_deref
|
|
%2 = load %0 : $*PP
|
|
%3 = open_existential_ref %2 : $PP to $@opened("CC969B02-AC7C-11E8-B742-D0817AD4059B", PP) Self
|
|
%4 = witness_method $@opened("CC969B02-AC7C-11E8-B742-D0817AD4059B", PP) Self, #PP.foo : <Self where Self : PP> (Self) -> () -> Int32, %3 : $@opened("CC969B02-AC7C-11E8-B742-D0817AD4059B", PP) Self : $@convention(witness_method: PP) <τ_0_0 where τ_0_0 : PP> (@guaranteed τ_0_0) -> Int32
|
|
strong_retain %2 : $PP
|
|
%6 = apply %4<@opened("CC969B02-AC7C-11E8-B742-D0817AD4059B", PP) Self>(%3) : $@convention(witness_method: PP) <τ_0_0 where τ_0_0 : PP> (@guaranteed τ_0_0) -> Int32
|
|
strong_release %2 : $PP
|
|
return %6 : $Int32
|
|
} // end sil function '$s21existential_transform13wrap_inout_cp1as5Int32VAA2PP_pz_tF'
|
|
|
|
// CHECK-LABEL: sil hidden [noinline] @$s21existential_transform24do_not_optimize_inout_cpyyF : $@convention(thin) () -> () {
|
|
// CHECK: bb0:
|
|
// CHECK: %0 = alloc_stack $any PP, var, name "magic5"
|
|
// CHECK: %1 = alloc_ref $KK
|
|
// CHECK: debug_value %1 : $KK, let, name "self", argno 1
|
|
// CHECK: %3 = init_existential_ref %1 : $KK : $KK, $any PP
|
|
// CHECK: store %3 to %0 : $*any PP
|
|
// CHECK: %5 = function_ref @$s21existential_transform13wrap_inout_cp1as5Int32VAA2PP_pz_tF : $@convention(thin) (@inout any PP) -> Int32
|
|
// CHECK: %6 = apply %5(%0) : $@convention(thin) (@inout any PP) -> Int32
|
|
// CHECK: %7 = load %0 : $*any PP
|
|
// CHECK: strong_release %7 : $any PP
|
|
// CHECK: dealloc_stack %0 : $*any PP
|
|
// CHECK: %10 = tuple ()
|
|
// CHECK: return %10 : $()
|
|
// CHECK: } // end sil function '$s21existential_transform24do_not_optimize_inout_cpyyF'
|
|
sil hidden [noinline] @$s21existential_transform24do_not_optimize_inout_cpyyF : $@convention(thin) () -> () {
|
|
bb0:
|
|
%0 = alloc_stack $PP, var, name "magic5"
|
|
%1 = alloc_ref $KK
|
|
debug_value %1 : $KK, let, name "self", argno 1
|
|
%3 = init_existential_ref %1 : $KK : $KK, $PP
|
|
store %3 to %0 : $*PP
|
|
%5 = function_ref @$s21existential_transform13wrap_inout_cp1as5Int32VAA2PP_pz_tF : $@convention(thin) (@inout PP) -> Int32
|
|
%6 = apply %5(%0) : $@convention(thin) (@inout PP) -> Int32
|
|
%7 = load %0 : $*PP
|
|
strong_release %7 : $PP
|
|
dealloc_stack %0 : $*PP
|
|
%10 = tuple ()
|
|
return %10 : $()
|
|
} // end sil function '$s21existential_transform24do_not_optimize_inout_cpyyF'
|
|
|
|
sil hidden @$s21existential_transform3KKKC3foos5Int32VyF : $@convention(method) (@guaranteed KKK) -> Int32 {
|
|
bb0(%0 : $KKK):
|
|
%1 = integer_literal $Builtin.Int32, 10
|
|
%2 = struct $Int32 (%1 : $Builtin.Int32)
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform3KKKC3foos5Int32VyF'
|
|
|
|
sil private [transparent] [thunk] @$s21existential_transform3KKKCAA3PPPA2aDP3foos5Int32VyFTW : $@convention(witness_method: PPP) (@in_guaranteed KKK) -> Int32 {
|
|
bb0(%0 : $*KKK):
|
|
%1 = load %0 : $*KKK
|
|
%2 = class_method %1 : $KKK, #KKK.foo : (KKK) -> () -> Int32, $@convention(method) (@guaranteed KKK) -> Int32
|
|
%3 = apply %2(%1) : $@convention(method) (@guaranteed KKK) -> Int32
|
|
return %3 : $Int32
|
|
} // end sil function '$s21existential_transform3KKKCAA3PPPA2aDP3foos5Int32VyFTW'
|
|
|
|
sil hidden [signature_optimized_thunk] [heuristic_always_inline] @$s21existential_transform14wrap_inout_ncp1as5Int32VAA3PPP_pz_tF : $@convention(thin) (@inout PPP) -> Int32 {
|
|
bb0(%0 : $*PPP):
|
|
%1 = function_ref @$s21existential_transform14wrap_inout_ncp1as5Int32VAA3PPP_pz_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : PPP> (@inout τ_0_0) -> Int32
|
|
%2 = open_existential_addr mutable_access %0 : $*PPP to $*@opened("CC986BDA-AC7C-11E8-B742-D0817AD4059B", PPP) Self
|
|
%3 = apply %1<@opened("CC986BDA-AC7C-11E8-B742-D0817AD4059B", PPP) Self>(%2) : $@convention(thin) <τ_0_0 where τ_0_0 : PPP> (@inout τ_0_0) -> Int32
|
|
return %3 : $Int32
|
|
} // end sil function '$s21existential_transform14wrap_inout_ncp1as5Int32VAA3PPP_pz_tF'
|
|
|
|
// Cannot substitute a concrete address for an @inout existential argument. The wrong value would be modified.
|
|
//
|
|
// CHECK-LABEL: sil hidden [noinline] @$s21existential_transform9inout_ncpyyF : $@convention(thin) () -> () {
|
|
// CHECK: bb0:
|
|
// CHECK: [[ALLOC:%.*]] = alloc_stack $any PPP, var, name "magic6"
|
|
// CHECK: alloc_ref $KKK
|
|
// CHECK: [[ADR:%.*]] = open_existential_addr mutable_access [[ALLOC]] : $*any PPP to $*@opened("{{.*}}", any PPP) Self
|
|
// CHECK: [[CAST:%.*]] = unchecked_addr_cast [[ADR]]
|
|
// CHECK: [[F:%.*]] = function_ref @$s21existential_transform14wrap_inout_ncp1as5Int32VAA3PPP_pz_tFTf4e_n4main3KKKC_Tg5 : $@convention(thin) (@inout KKK) -> Int32
|
|
// CHECK: apply [[F]]([[CAST]])
|
|
// CHECK: dealloc_stack %0 : $*any PPP
|
|
// CHECK-LABEL: } // end sil function '$s21existential_transform9inout_ncpyyF'
|
|
sil hidden [noinline] @$s21existential_transform9inout_ncpyyF : $@convention(thin) () -> () {
|
|
bb0:
|
|
%0 = alloc_stack $PPP, var, name "magic6"
|
|
%1 = alloc_ref $KKK
|
|
debug_value %1 : $KKK, let, name "self", argno 1
|
|
%3 = init_existential_addr %0 : $*PPP, $KKK
|
|
store %1 to %3 : $*KKK
|
|
%5 = function_ref @$s21existential_transform14wrap_inout_ncp1as5Int32VAA3PPP_pz_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : PPP> (@inout τ_0_0) -> Int32
|
|
%6 = open_existential_addr mutable_access %0 : $*PPP to $*@opened("CC986F86-AC7C-11E8-B742-D0817AD4059B", PPP) Self
|
|
%7 = apply %5<@opened("CC986F86-AC7C-11E8-B742-D0817AD4059B", PPP) Self>(%6) : $@convention(thin) <τ_0_0 where τ_0_0 : PPP> (@inout τ_0_0) -> Int32
|
|
destroy_addr %0 : $*PPP
|
|
dealloc_stack %0 : $*PPP
|
|
%10 = tuple ()
|
|
return %10 : $()
|
|
} // end sil function '$s21existential_transform9inout_ncpyyF'
|
|
|
|
sil hidden @$s21existential_transform4SSSSV3foos5Int32VyF : $@convention(method) (SSSS) -> Int32 {
|
|
bb0(%0 : $SSSS):
|
|
%1 = integer_literal $Builtin.Int32, 10
|
|
%2 = struct $Int32 (%1 : $Builtin.Int32)
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform4SSSSV3foos5Int32VyF'
|
|
|
|
sil private [transparent] [thunk] @$s21existential_transform4SSSSVAA4PPPPA2aDP3foos5Int32VyFTW : $@convention(witness_method: PPPP) (@in_guaranteed SSSS) -> Int32 {
|
|
bb0(%0 : $*SSSS):
|
|
%1 = integer_literal $Builtin.Int32, 10
|
|
%2 = struct $Int32 (%1 : $Builtin.Int32)
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform4SSSSVAA4PPPPA2aDP3foos5Int32VyFTW'
|
|
|
|
sil hidden [signature_optimized_thunk] [heuristic_always_inline] @$s21existential_transform21wrap_struct_inout_ncp1as5Int32VAA4PPPP_pz_tF : $@convention(thin) (@inout PPPP) -> Int32 {
|
|
bb0(%0 : $*PPPP):
|
|
%1 = function_ref @$s21existential_transform21wrap_struct_inout_ncp1as5Int32VAA4PPPP_pz_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : PPPP> (@inout τ_0_0) -> Int32
|
|
%2 = open_existential_addr mutable_access %0 : $*PPPP to $*@opened("CC98A1E0-AC7C-11E8-B742-D0817AD4059B", PPPP) Self
|
|
%3 = apply %1<@opened("CC98A1E0-AC7C-11E8-B742-D0817AD4059B", PPPP) Self>(%2) : $@convention(thin) <τ_0_0 where τ_0_0 : PPPP> (@inout τ_0_0) -> Int32
|
|
return %3 : $Int32
|
|
} // end sil function '$s21existential_transform21wrap_struct_inout_ncp1as5Int32VAA4PPPP_pz_tF'
|
|
|
|
// Cannot substitute a concrete value's address for an @inout existential argument. The wrong value would be modified.
|
|
//
|
|
// CHECK-LABEL: sil hidden [noinline] @$s21existential_transform16struct_inout_ncpyyF : $@convention(thin) () -> () {
|
|
// CHECK: bb0:
|
|
// CHECK: [[ALLOC:%.*]] = alloc_stack $any PPPP, var, name "magic7"
|
|
// CHECK: struct $SSSS ()
|
|
// CHECK: [[ADR:%.*]] = open_existential_addr mutable_access %0 : $*any PPPP to $*@opened("{{.*}}", any PPPP) Self
|
|
// CHECK: [[CAST:%.*]] = unchecked_addr_cast [[ADR]]
|
|
// CHECK: [[F:%.*]] = function_ref @$s21existential_transform21wrap_struct_inout_ncp1as5Int32VAA4PPPP_pz_tFTf4e_n4main4SSSSV_Tg5 : $@convention(thin) (@inout SSSS) -> Int32
|
|
// CHECK: apply [[F]]([[CAST]])
|
|
// CHECK: dealloc_stack [[ALLOC]] : $*any PPPP
|
|
// CHECK-LABEL: } // end sil function '$s21existential_transform16struct_inout_ncpyyF'
|
|
sil hidden [noinline] @$s21existential_transform16struct_inout_ncpyyF : $@convention(thin) () -> () {
|
|
bb0:
|
|
%0 = alloc_stack $PPPP, var, name "magic7"
|
|
%1 = struct $SSSS ()
|
|
%2 = init_existential_addr %0 : $*PPPP, $SSSS
|
|
store %1 to %2 : $*SSSS
|
|
%4 = function_ref @$s21existential_transform21wrap_struct_inout_ncp1as5Int32VAA4PPPP_pz_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : PPPP> (@inout τ_0_0) -> Int32
|
|
%5 = open_existential_addr mutable_access %0 : $*PPPP to $*@opened("CC98A5E6-AC7C-11E8-B742-D0817AD4059B", PPPP) Self
|
|
%6 = apply %4<@opened("CC98A5E6-AC7C-11E8-B742-D0817AD4059B", PPPP) Self>(%5) : $@convention(thin) <τ_0_0 where τ_0_0 : PPPP> (@inout τ_0_0) -> Int32
|
|
destroy_addr %0 : $*PPPP
|
|
dealloc_stack %0 : $*PPPP
|
|
%9 = tuple ()
|
|
return %9 : $()
|
|
} // end sil function '$s21existential_transform16struct_inout_ncpyyF'
|
|
|
|
|
|
// CHECK-LABEL: sil shared [noinline] @$s21existential_transform11wrap_foo_cp1as5Int32VAA12SomeProtocol_p_tFTf4e_n4main0G5ClassC_Tg5 : $@convention(thin) (@guaranteed SomeClass) -> Int32 {
|
|
// CHECK: bb0(%0 : $SomeClass):
|
|
// CHECK: %1 = integer_literal $Builtin.Int32, 10
|
|
// CHECK: %2 = struct $Int32 (%1 : $Builtin.Int32)
|
|
// CHECK: return %2 : $Int32
|
|
// CHECK-LABEL: } // end sil function '$s21existential_transform11wrap_foo_cp1as5Int32VAA12SomeProtocol_p_tFTf4e_n4main0G5ClassC_Tg5'
|
|
sil shared [noinline] @$s21existential_transform11wrap_foo_cp1as5Int32VAA12SomeProtocol_p_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : SomeProtocol> (@guaranteed τ_0_0) -> Int32 {
|
|
bb0(%0 : $τ_0_0):
|
|
%1 = witness_method $τ_0_0, #SomeProtocol.foo : <Self where Self : SomeProtocol> (Self) -> () -> Int32 : $@convention(witness_method: SomeProtocol) <τ_0_0 where τ_0_0 : SomeProtocol> (@guaranteed τ_0_0) -> Int32
|
|
%2 = apply %1<τ_0_0>(%0) : $@convention(witness_method: SomeProtocol) <τ_0_0 where τ_0_0 : SomeProtocol> (@guaranteed τ_0_0) -> Int32
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform11wrap_foo_cp1as5Int32VAA12SomeProtocol_p_tFTf4e_n'
|
|
|
|
|
|
// CHECK-LABEL: sil shared [noinline] @$s21existential_transform12wrap_foo_ncp1as5Int32VAA19SomeNoClassProtocol_p_tFTf4e_n4main0ghI0C_Tg5 : $@convention(thin) (@guaranteed SomeNoClass) -> Int32 {
|
|
// CHECK: bb0(%0 : $SomeNoClass):
|
|
// CHECK: %1 = integer_literal $Builtin.Int32, 10
|
|
// CHECK: %2 = struct $Int32 (%1 : $Builtin.Int32)
|
|
// CHECK: return %2 : $Int32
|
|
// CHECK-LABEL: } // end sil function '$s21existential_transform12wrap_foo_ncp1as5Int32VAA19SomeNoClassProtocol_p_tFTf4e_n4main0ghI0C_Tg5'
|
|
sil shared [noinline] @$s21existential_transform12wrap_foo_ncp1as5Int32VAA19SomeNoClassProtocol_p_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : SomeNoClassProtocol> (@in_guaranteed τ_0_0) -> Int32 {
|
|
bb0(%0 : $*τ_0_0):
|
|
%1 = witness_method $τ_0_0, #SomeNoClassProtocol.foo : <Self where Self : SomeNoClassProtocol> (Self) -> () -> Int32 : $@convention(witness_method: SomeNoClassProtocol) <τ_0_0 where τ_0_0 : SomeNoClassProtocol> (@in_guaranteed τ_0_0) -> Int32
|
|
%2 = apply %1<τ_0_0>(%0) : $@convention(witness_method: SomeNoClassProtocol) <τ_0_0 where τ_0_0 : SomeNoClassProtocol> (@in_guaranteed τ_0_0) -> Int32
|
|
return %2 : $Int32
|
|
} // end sil function '$s21existential_transform12wrap_foo_ncp1as5Int32VAA19SomeNoClassProtocol_p_tFTf4e_n'
|
|
|
|
// CHECK-LABEL: sil shared [noinline] @$s21existential_transform16wrap_foo_bar_cpc1as5Int32VAA21SomeClassProtocolComp_AA0h5OtherijK0p_tFTf4e_n4main0hiK0C_Tg5 : $@convention(thin) (@guaranteed SomeClassComp) -> Int32 {
|
|
// CHECK: bb0(%0 : $SomeClassComp):
|
|
// CHECK: %1 = integer_literal $Builtin.Int32, 30
|
|
// CHECK: %2 = struct $Int32 (%1 : $Builtin.Int32)
|
|
// CHECK: return %2 : $Int32
|
|
// CHECK: } // end sil function '$s21existential_transform16wrap_foo_bar_cpc1as5Int32VAA21SomeClassProtocolComp_AA0h5OtherijK0p_tFTf4e_n4main0hiK0C_Tg5'
|
|
sil shared [noinline] @$s21existential_transform16wrap_foo_bar_cpc1as5Int32VAA21SomeClassProtocolComp_AA0h5OtherijK0p_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : SomeClassProtocolComp, τ_0_0 : SomeOtherClassProtocolComp> (@guaranteed τ_0_0) -> Int32 {
|
|
bb0(%0 : $τ_0_0):
|
|
%1 = witness_method $τ_0_0, #SomeClassProtocolComp.foo : <Self where Self : SomeClassProtocolComp> (Self) -> () -> Int32 : $@convention(witness_method: SomeClassProtocolComp) <τ_0_0 where τ_0_0 : SomeClassProtocolComp> (@guaranteed τ_0_0) -> Int32
|
|
%2 = apply %1<τ_0_0>(%0) : $@convention(witness_method: SomeClassProtocolComp) <τ_0_0 where τ_0_0 : SomeClassProtocolComp> (@guaranteed τ_0_0) -> Int32
|
|
%3 = witness_method $τ_0_0, #SomeOtherClassProtocolComp.bar : <Self where Self : SomeOtherClassProtocolComp> (Self) -> () -> Int32 : $@convention(witness_method: SomeOtherClassProtocolComp) <τ_0_0 where τ_0_0 : SomeOtherClassProtocolComp> (@guaranteed τ_0_0) -> Int32
|
|
%4 = apply %3<τ_0_0>(%0) : $@convention(witness_method: SomeOtherClassProtocolComp) <τ_0_0 where τ_0_0 : SomeOtherClassProtocolComp> (@guaranteed τ_0_0) -> Int32
|
|
%5 = struct_extract %2 : $Int32, #Int32._value
|
|
%6 = struct_extract %4 : $Int32, #Int32._value
|
|
%7 = integer_literal $Builtin.Int1, -1
|
|
%8 = builtin "sadd_with_overflow_Int32"(%5 : $Builtin.Int32, %6 : $Builtin.Int32, %7 : $Builtin.Int1) : $(Builtin.Int32, Builtin.Int1)
|
|
%9 = tuple_extract %8 : $(Builtin.Int32, Builtin.Int1), 0
|
|
%10 = tuple_extract %8 : $(Builtin.Int32, Builtin.Int1), 1
|
|
cond_fail %10 : $Builtin.Int1
|
|
%12 = struct $Int32 (%9 : $Builtin.Int32)
|
|
return %12 : $Int32
|
|
} // end sil function '$s21existential_transform16wrap_foo_bar_cpc1as5Int32VAA21SomeClassProtocolComp_AA0h5OtherijK0p_tFTf4e_n'
|
|
|
|
// CHECK-LABEL: sil shared [noinline] @$s21existential_transform25wrap_no_foo_bar_comp_ncpc1as5Int32VAA23SomeNoClassProtocolComp_AA0j5OtherklmN0p_tFTf4e_n4main0jklN0C_Tg5 : $@convention(thin) (@guaranteed SomeNoClassComp) -> Int32 {
|
|
// CHECK: bb0(%0 : $SomeNoClassComp):
|
|
// CHECK: %1 = integer_literal $Builtin.Int32, 30
|
|
// CHECK: %2 = struct $Int32 (%1 : $Builtin.Int32)
|
|
// CHECK: return %2 : $Int32
|
|
// CHECK-LABEL: } // end sil function '$s21existential_transform25wrap_no_foo_bar_comp_ncpc1as5Int32VAA23SomeNoClassProtocolComp_AA0j5OtherklmN0p_tFTf4e_n4main0jklN0C_Tg5'
|
|
sil shared [noinline] @$s21existential_transform25wrap_no_foo_bar_comp_ncpc1as5Int32VAA23SomeNoClassProtocolComp_AA0j5OtherklmN0p_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : SomeNoClassProtocolComp, τ_0_0 : SomeOtherNoClassProtocolComp> (@in_guaranteed τ_0_0) -> Int32 {
|
|
bb0(%0 : $*τ_0_0):
|
|
%1 = witness_method $τ_0_0, #SomeNoClassProtocolComp.foo : <Self where Self : SomeNoClassProtocolComp> (Self) -> () -> Int32 : $@convention(witness_method: SomeNoClassProtocolComp) <τ_0_0 where τ_0_0 : SomeNoClassProtocolComp> (@in_guaranteed τ_0_0) -> Int32
|
|
%2 = apply %1<τ_0_0>(%0) : $@convention(witness_method: SomeNoClassProtocolComp) <τ_0_0 where τ_0_0 : SomeNoClassProtocolComp> (@in_guaranteed τ_0_0) -> Int32
|
|
%3 = witness_method $τ_0_0, #SomeOtherNoClassProtocolComp.bar : <Self where Self : SomeOtherNoClassProtocolComp> (Self) -> () -> Int32 : $@convention(witness_method: SomeOtherNoClassProtocolComp) <τ_0_0 where τ_0_0 : SomeOtherNoClassProtocolComp> (@in_guaranteed τ_0_0) -> Int32
|
|
%4 = apply %3<τ_0_0>(%0) : $@convention(witness_method: SomeOtherNoClassProtocolComp) <τ_0_0 where τ_0_0 : SomeOtherNoClassProtocolComp> (@in_guaranteed τ_0_0) -> Int32
|
|
%5 = struct_extract %2 : $Int32, #Int32._value
|
|
%6 = struct_extract %4 : $Int32, #Int32._value
|
|
%7 = integer_literal $Builtin.Int1, -1
|
|
%8 = builtin "sadd_with_overflow_Int32"(%5 : $Builtin.Int32, %6 : $Builtin.Int32, %7 : $Builtin.Int1) : $(Builtin.Int32, Builtin.Int1)
|
|
%9 = tuple_extract %8 : $(Builtin.Int32, Builtin.Int1), 0
|
|
%10 = tuple_extract %8 : $(Builtin.Int32, Builtin.Int1), 1
|
|
cond_fail %10 : $Builtin.Int1
|
|
%12 = struct $Int32 (%9 : $Builtin.Int32)
|
|
return %12 : $Int32
|
|
} // end sil function '$s21existential_transform25wrap_no_foo_bar_comp_ncpc1as5Int32VAA23SomeNoClassProtocolComp_AA0j5OtherklmN0p_tFTf4e_n'
|
|
|
|
// Cannot substitute a concrete value for a mutable existential, so specialization will be blocked.
|
|
//
|
|
// CHECK-LABEL: sil shared [noinline] @$s21existential_transform14wrap_inout_ncp1as5Int32VAA3PPP_pz_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : PPP> (@inout τ_0_0) -> Int32 {
|
|
// CHECK-LABEL: } // end sil function '$s21existential_transform14wrap_inout_ncp1as5Int32VAA3PPP_pz_tFTf4e_n'
|
|
sil shared [noinline] @$s21existential_transform14wrap_inout_ncp1as5Int32VAA3PPP_pz_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : PPP> (@inout τ_0_0) -> Int32 {
|
|
bb0(%0 : $*τ_0_0):
|
|
%1 = alloc_stack $τ_0_0
|
|
copy_addr [take] %0 to [init] %1 : $*τ_0_0
|
|
%3 = witness_method $τ_0_0, #PPP.foo : <Self where Self : PPP> (Self) -> () -> Int32 : $@convention(witness_method: PPP) <τ_0_0 where τ_0_0 : PPP> (@in_guaranteed τ_0_0) -> Int32
|
|
%4 = apply %3<τ_0_0>(%1) : $@convention(witness_method: PPP) <τ_0_0 where τ_0_0 : PPP> (@in_guaranteed τ_0_0) -> Int32
|
|
dealloc_stack %1 : $*τ_0_0
|
|
return %4 : $Int32
|
|
} // end sil function '$s21existential_transform14wrap_inout_ncp1as5Int32VAA3PPP_pz_tFTf4e_n'
|
|
|
|
// Cannot substitute a concrete value for a mutable existential, so specialization will be blocked.
|
|
//
|
|
// CHECK-LABEL: sil shared [noinline] @$s21existential_transform21wrap_struct_inout_ncp1as5Int32VAA4PPPP_pz_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : PPPP> (@inout τ_0_0) -> Int32 {
|
|
// CHECK-LABEL: } // end sil function '$s21existential_transform21wrap_struct_inout_ncp1as5Int32VAA4PPPP_pz_tFTf4e_n'
|
|
sil shared [noinline] @$s21existential_transform21wrap_struct_inout_ncp1as5Int32VAA4PPPP_pz_tFTf4e_n : $@convention(thin) <τ_0_0 where τ_0_0 : PPPP> (@inout τ_0_0) -> Int32 {
|
|
bb0(%0 : $*τ_0_0):
|
|
%1 = alloc_stack $τ_0_0
|
|
copy_addr [take] %0 to [init] %1 : $*τ_0_0
|
|
%3 = witness_method $τ_0_0, #PPPP.foo : <Self where Self : PPPP> (Self) -> () -> Int32 : $@convention(witness_method: PPPP) <τ_0_0 where τ_0_0 : PPPP> (@in_guaranteed τ_0_0) -> Int32
|
|
%4 = apply %3<τ_0_0>(%1) : $@convention(witness_method: PPPP) <τ_0_0 where τ_0_0 : PPPP> (@in_guaranteed τ_0_0) -> Int32
|
|
dealloc_stack %1 : $*τ_0_0
|
|
return %4 : $Int32
|
|
} // end sil function '$s21existential_transform21wrap_struct_inout_ncp1as5Int32VAA4PPPP_pz_tFTf4e_n'
|
|
|
|
sil_vtable SomeClass {
|
|
#SomeClass.foo: (SomeClass) -> () -> Int32 : @$s21existential_transform9SomeClassC3foos5Int32VyF // SomeClass.foo()
|
|
}
|
|
|
|
sil_vtable SomeNoClass {
|
|
#SomeNoClass.foo: (SomeNoClass) -> () -> Int32 : @$s21existential_transform11SomeNoClassC3foos5Int32VyF // SomeNoClass.foo()
|
|
}
|
|
|
|
sil_vtable SomeClassComp {
|
|
#SomeClassComp.foo: (SomeClassComp) -> () -> Int32 : @$s21existential_transform13SomeClassCompC3foos5Int32VyF // SomeClassComp.foo()
|
|
#SomeClassComp.bar: (SomeClassComp) -> () -> Int32 : @$s21existential_transform13SomeClassCompC3bars5Int32VyF // SomeClassComp.bar()
|
|
}
|
|
|
|
sil_vtable SomeNoClassComp {
|
|
#SomeNoClassComp.foo: (SomeNoClassComp) -> () -> Int32 : @$s21existential_transform15SomeNoClassCompC3foos5Int32VyF // SomeNoClassComp.foo()
|
|
#SomeNoClassComp.bar: (SomeNoClassComp) -> () -> Int32 : @$s21existential_transform15SomeNoClassCompC3bars5Int32VyF // SomeNoClassComp.bar()
|
|
}
|
|
|
|
sil_vtable K {
|
|
#K.foo: (K) -> () -> Int32 : @$s21existential_transform1KC3foos5Int32VyF // K.foo()
|
|
}
|
|
|
|
sil_vtable KK {
|
|
#KK.foo: (KK) -> () -> Int32 : @$s21existential_transform2KKC3foos5Int32VyF // KK.foo()
|
|
}
|
|
|
|
sil_vtable KKK {
|
|
#KKK.foo: (KKK) -> () -> Int32 : @$s21existential_transform3KKKC3foos5Int32VyF // KKK.foo()
|
|
}
|
|
|
|
sil_witness_table hidden SomeClass: SomeProtocol module existential_transform {
|
|
method #SomeProtocol.foo: <Self where Self : SomeProtocol> (Self) -> () -> Int32 : @$s21existential_transform9SomeClassCAA0C8ProtocolA2aDP3foos5Int32VyFTW // protocol witness for SomeProtocol.foo() in conformance SomeClass
|
|
}
|
|
|
|
sil_witness_table hidden SomeNoClass: SomeNoClassProtocol module existential_transform {
|
|
method #SomeNoClassProtocol.foo: <Self where Self : SomeNoClassProtocol> (Self) -> () -> Int32 : @$s21existential_transform11SomeNoClassCAA0cdE8ProtocolA2aDP3foos5Int32VyFTW // protocol witness for SomeNoClassProtocol.foo() in conformance SomeNoClass
|
|
}
|
|
|
|
sil_witness_table hidden SomeClassComp: SomeClassProtocolComp module existential_transform {
|
|
method #SomeClassProtocolComp.foo: <Self where Self : SomeClassProtocolComp> (Self) -> () -> Int32 : @$s21existential_transform13SomeClassCompCAA0cd8ProtocolE0A2aDP3foos5Int32VyFTW // protocol witness for SomeClassProtocolComp.foo() in conformance SomeClassComp
|
|
}
|
|
|
|
sil_witness_table hidden SomeClassComp: SomeOtherClassProtocolComp module existential_transform {
|
|
method #SomeOtherClassProtocolComp.bar: <Self where Self : SomeOtherClassProtocolComp> (Self) -> () -> Int32 : @$s21existential_transform13SomeClassCompCAA0c5Otherd8ProtocolE0A2aDP3bars5Int32VyFTW // protocol witness for SomeOtherClassProtocolComp.bar() in conformance SomeClassComp
|
|
}
|
|
|
|
sil_witness_table hidden SomeNoClassComp: SomeNoClassProtocolComp module existential_transform {
|
|
method #SomeNoClassProtocolComp.foo: <Self where Self : SomeNoClassProtocolComp> (Self) -> () -> Int32 : @$s21existential_transform15SomeNoClassCompCAA0cde8ProtocolF0A2aDP3foos5Int32VyFTW // protocol witness for SomeNoClassProtocolComp.foo() in conformance SomeNoClassComp
|
|
}
|
|
|
|
sil_witness_table hidden SomeNoClassComp: SomeOtherNoClassProtocolComp module existential_transform {
|
|
method #SomeOtherNoClassProtocolComp.bar: <Self where Self : SomeOtherNoClassProtocolComp> (Self) -> () -> Int32 : @$s21existential_transform15SomeNoClassCompCAA0c5Otherde8ProtocolF0A2aDP3bars5Int32VyFTW // protocol witness for SomeOtherNoClassProtocolComp.bar() in conformance SomeNoClassComp
|
|
}
|
|
|
|
sil_witness_table hidden K: P module existential_transform {
|
|
method #P.foo: <Self where Self : P> (Self) -> () -> Int32 : @$s21existential_transform1KCAA1PA2aDP3foos5Int32VyFTW // protocol witness for P.foo() in conformance K
|
|
}
|
|
|
|
sil_witness_table hidden KK: PP module existential_transform {
|
|
method #PP.foo: <Self where Self : PP> (Self) -> () -> Int32 : @$s21existential_transform2KKCAA2PPA2aDP3foos5Int32VyFTW // protocol witness for PP.foo() in conformance KK
|
|
}
|
|
|
|
sil_witness_table hidden KKK: PPP module existential_transform {
|
|
method #PPP.foo: <Self where Self : PPP> (Self) -> () -> Int32 : @$s21existential_transform3KKKCAA3PPPA2aDP3foos5Int32VyFTW // protocol witness for PPP.foo() in conformance KKK
|
|
}
|
|
|
|
sil_witness_table hidden SSSS: PPPP module existential_transform {
|
|
method #PPPP.foo: <Self where Self : PPPP> (Self) -> () -> Int32 : @$s21existential_transform4SSSSVAA4PPPPA2aDP3foos5Int32VyFTW // protocol witness for PPPP.foo() in conformance SSSS
|
|
}
|