Skip to content

Commit 1290903

Browse files
committed
Merge remote-tracking branch 'origin/main' into rebranch
2 parents b0230b5 + c5e7a36 commit 1290903

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/SILOptimizer/Differentiation/JVPCloner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1702,7 +1702,7 @@ void JVPCloner::Implementation::prepareForDifferentialGeneration() {
17021702
original->getASTContext());
17031703

17041704
SILOptFunctionBuilder fb(context.getTransform());
1705-
auto linkage = jvp->isSerialized() ? SILLinkage::Public : SILLinkage::Hidden;
1705+
auto linkage = jvp->isSerialized() ? SILLinkage::Public : SILLinkage::Private;
17061706
auto *differential = fb.createFunction(
17071707
linkage, context.getASTContext().getIdentifier(diffName).str(), diffType,
17081708
diffGenericEnv, original->getLocation(), original->isBare(),

test/AutoDiff/SILOptimizer/derivative_sil.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func foo(_ x: Float) -> Float {
4242
// CHECK-SIL: return [[VJP_RESULT]] : $(Float, @callee_guaranteed (Float) -> Float)
4343
// CHECK-SIL: }
4444

45-
// CHECK-SIL-LABEL: sil hidden [ossa] @fooTJdSpSr : $@convention(thin) (Float, @owned _AD__foo_bb0__DF__src_0_wrt_0) -> Float {
45+
// CHECK-SIL-LABEL: sil private [ossa] @fooTJdSpSr : $@convention(thin) (Float, @owned _AD__foo_bb0__DF__src_0_wrt_0) -> Float {
4646
// CHECK-SIL: bb0([[DX:%.*]] : $Float, [[DF_STRUCT:%.*]] : @owned $_AD__foo_bb0__DF__src_0_wrt_0):
4747
// CHECK-SIL: [[ADD_DF:%.*]] = destructure_struct [[DF_STRUCT]] : $_AD__foo_bb0__DF__src_0_wrt_0
4848
// CHECK-SIL: [[DY:%.*]] = apply [[ADD_DF]]([[DX]], [[DX]]) : $@callee_guaranteed (Float, Float) -> Float
@@ -99,7 +99,7 @@ struct ExampleStruct {
9999

100100
// CHECK-SIL-LABEL: sil hidden [ossa] @fooMethodTJfSUpSr : $@convention(method) (Float, ExampleStruct) -> (Float, @owned @callee_guaranteed (Float) -> Float) {
101101

102-
// CHECK-SIL-LABEL: sil hidden [ossa] @fooMethodTJdSUpSr : $@convention(thin) (Float, @owned _AD__fooMethod_bb0__DF__src_0_wrt_0) -> Float {
102+
// CHECK-SIL-LABEL: sil private [ossa] @fooMethodTJdSUpSr : $@convention(thin) (Float, @owned _AD__fooMethod_bb0__DF__src_0_wrt_0) -> Float {
103103

104104
// CHECK-SIL-LABEL: sil hidden [ossa] @fooMethodTJrSUpSr : $@convention(method) (Float, ExampleStruct) -> (Float, @owned @callee_guaranteed (Float) -> Float) {
105105

0 commit comments

Comments
 (0)