@@ -35,12 +35,32 @@ struct Struct: Protocol {
35
35
}
36
36
37
37
// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @AD__${{.*}}method{{.*}}_jvp_SUU : $@convention(witness_method: Protocol) (Float, Double, @in_guaranteed Struct) -> (Float, @owned @callee_guaranteed (Float) -> Float) {
38
+ // CHECK: [[ORIG_FN:%.*]] = function_ref {{.*}}method{{.*}} : $@convention(method) (Float, Double, Struct) -> Float
39
+ // CHECK: [[DIFF_FN:%.*]] = differentiable_function [parameters 0] [[ORIG_FN]]
40
+ // CHECK: [[JVP_FN:%.*]] = differentiable_function_extract [jvp] [[DIFF_FN]]
41
+ // CHECK: apply [[JVP_FN]]
42
+ // CHECK: }
38
43
39
44
// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @AD__${{.*}}method{{.*}}_vjp_SUU : $@convention(witness_method: Protocol) (Float, Double, @in_guaranteed Struct) -> (Float, @owned @callee_guaranteed (Float) -> Float) {
45
+ // CHECK: [[ORIG_FN:%.*]] = function_ref {{.*}}method{{.*}} : $@convention(method) (Float, Double, Struct) -> Float
46
+ // CHECK: [[DIFF_FN:%.*]] = differentiable_function [parameters 0] [[ORIG_FN]]
47
+ // CHECK: [[VJP_FN:%.*]] = differentiable_function_extract [vjp] [[DIFF_FN]]
48
+ // CHECK: apply [[VJP_FN]]
49
+ // CHECK: }
40
50
41
51
// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @AD__${{.*}}method{{.*}}_jvp_SSS : $@convention(witness_method: Protocol) (Float, Double, @in_guaranteed Struct) -> (Float, @owned @callee_guaranteed @substituted <τ_0_0> (Float, Double, @in_guaranteed τ_0_0) -> Float for <DummyTangentVector>) {
52
+ // CHECK: [[ORIG_FN:%.*]] = function_ref {{.*}}method{{.*}} : $@convention(method) (Float, Double, Struct) -> Float
53
+ // CHECK: [[DIFF_FN:%.*]] = differentiable_function [parameters 0 1 2] [[ORIG_FN]]
54
+ // CHECK: [[JVP_FN:%.*]] = differentiable_function_extract [jvp] [[DIFF_FN]]
55
+ // CHECK: apply [[JVP_FN]]
56
+ // CHECK: }
42
57
43
58
// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @AD__${{.*}}method{{.*}}_vjp_SSS : $@convention(witness_method: Protocol) (Float, Double, @in_guaranteed Struct) -> (Float, @owned @callee_guaranteed @substituted <τ_0_0> (Float) -> (Float, Double, @out τ_0_0) for <DummyTangentVector>) {
59
+ // CHECK: [[ORIG_FN:%.*]] = function_ref {{.*}}method{{.*}} : $@convention(method) (Float, Double, Struct) -> Float
60
+ // CHECK: [[DIFF_FN:%.*]] = differentiable_function [parameters 0 1 2] [[ORIG_FN]]
61
+ // CHECK: [[VJP_FN:%.*]] = differentiable_function_extract [vjp] [[DIFF_FN]]
62
+ // CHECK: apply [[VJP_FN]]
63
+ // CHECK: }
44
64
45
65
@differentiable
46
66
var property : Float {
@@ -49,9 +69,18 @@ struct Struct: Protocol {
49
69
}
50
70
51
71
// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @AD__${{.*}}property{{.*}}_jvp_S : $@convention(witness_method: Protocol) (@in_guaranteed Struct) -> (Float, @owned @callee_guaranteed @substituted <τ_0_0> (@in_guaranteed τ_0_0) -> Float for <DummyTangentVector>) {
72
+ // CHECK: [[ORIG_FN:%.*]] = function_ref {{.*}}property{{.*}} : $@convention(method) (Struct) -> Float
73
+ // CHECK: [[DIFF_FN:%.*]] = differentiable_function [parameters 0] [[ORIG_FN]]
74
+ // CHECK: [[JVP_FN:%.*]] = differentiable_function_extract [jvp] [[DIFF_FN]]
75
+ // CHECK: apply [[JVP_FN]]
76
+ // CHECK: }
52
77
53
78
// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @AD__${{.*}}property{{.*}}_vjp_S : $@convention(witness_method: Protocol) (@in_guaranteed Struct) -> (Float, @owned @callee_guaranteed @substituted <τ_0_0> (Float) -> @out τ_0_0 for <DummyTangentVector>) {
54
-
79
+ // CHECK: [[ORIG_FN:%.*]] = function_ref {{.*}}property{{.*}} : $@convention(method) (Struct) -> Float
80
+ // CHECK: [[DIFF_FN:%.*]] = differentiable_function [parameters 0] [[ORIG_FN]]
81
+ // CHECK: [[VJP_FN:%.*]] = differentiable_function_extract [vjp] [[DIFF_FN]]
82
+ // CHECK: apply [[VJP_FN]]
83
+ // CHECK: }
55
84
56
85
@differentiable ( wrt: x)
57
86
subscript( _ x: Float , _ y: Float ) -> Float {
@@ -60,8 +89,18 @@ struct Struct: Protocol {
60
89
}
61
90
62
91
// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @AD__$s13witness_table6StructVAA8ProtocolA2aDPyS2f_SftcigTW_jvp_SUU : $@convention(witness_method: Protocol) (Float, Float, @in_guaranteed Struct) -> (Float, @owned @callee_guaranteed (Float) -> Float) {
92
+ // CHECK: [[ORIG_FN:%.*]] = function_ref @$s13witness_table6StructVyS2f_Sftcig : $@convention(method) (Float, Float, Struct) -> Float
93
+ // CHECK: [[DIFF_FN:%.*]] = differentiable_function [parameters 0] [[ORIG_FN]]
94
+ // CHECK: [[JVP_FN:%.*]] = differentiable_function_extract [jvp] [[DIFF_FN]]
95
+ // CHECK: apply [[JVP_FN]]
96
+ // CHECK: }
63
97
64
98
// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @AD__$s13witness_table6StructVAA8ProtocolA2aDPyS2f_SftcigTW_vjp_SUU : $@convention(witness_method: Protocol) (Float, Float, @in_guaranteed Struct) -> (Float, @owned @callee_guaranteed (Float) -> Float) {
99
+ // CHECK: [[ORIG_FN:%.*]] = function_ref @$s13witness_table6StructVyS2f_Sftcig : $@convention(method) (Float, Float, Struct) -> Float
100
+ // CHECK: [[DIFF_FN:%.*]] = differentiable_function [parameters 0] [[ORIG_FN]]
101
+ // CHECK: [[VJP_FN:%.*]] = differentiable_function_extract [vjp] [[DIFF_FN]]
102
+ // CHECK: apply [[VJP_FN]]
103
+ // CHECK: }
65
104
}
66
105
67
106
// CHECK-LABEL: sil_witness_table hidden Struct: Protocol module witness_table {
0 commit comments