Skip to content

Commit b3dcef9

Browse files
committed
Avoid unnecessary linking in SIL tools
Previously we were linking in all SIL entities if the input was a serialized non-SIB AST, and `-disable-sil-linking` wasn't specified. However none of the tests appear to want this behaviour. Stop calling `SerializedSILLoader::getAll`, and remove the `-disable-sil-linking` option, as this is now the default behaviour.
1 parent 5792a72 commit b3dcef9

File tree

20 files changed

+17
-64
lines changed

20 files changed

+17
-64
lines changed

include/swift/Serialization/SerializedSILLoader.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ class SerializedSILLoader {
7474

7575
bool invalidateFunction(SILFunction *F);
7676

77-
/// Deserialize all SILFunctions, VTables, and WitnessTables in all
78-
/// SILModules.
79-
void getAll();
80-
8177
/// Deserialize all SILFunctions, VTables, and WitnessTables for
8278
/// a given Module.
8379
///

lib/Serialization/SerializedSILLoader.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,6 @@ bool SerializedSILLoader::invalidateFunction(SILFunction *F) {
156156
return false;
157157
}
158158

159-
void SerializedSILLoader::getAll() {
160-
for (auto &Des : LoadedSILSections)
161-
Des->getAll();
162-
}
163-
164159
// FIXME: Not the best interface. We know exactly which FileUnits may have SIL
165160
// those in the main module.
166161
void SerializedSILLoader::getAllForModule(Identifier Mod,

test/AutoDiff/Serialization/derivative_attr.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend %s -emit-module -parse-as-library -o %t
33
// RUN: llvm-bcanalyzer %t/derivative_attr.swiftmodule | %FileCheck %s -check-prefix=BCANALYZER
4-
// RUN: %target-sil-opt -disable-sil-linking -enable-sil-verify-all %t/derivative_attr.swiftmodule -o - | %FileCheck %s
4+
// RUN: %target-sil-opt -enable-sil-verify-all %t/derivative_attr.swiftmodule -o - | %FileCheck %s
55

66
// BCANALYZER-NOT: UnknownCode
77

test/AutoDiff/Serialization/differentiable_attr.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend %s -emit-module -parse-as-library -o %t
33
// RUN: llvm-bcanalyzer %t/differentiable_attr.swiftmodule | %FileCheck %s -check-prefix=BCANALYZER
4-
// RUN: %target-sil-opt -disable-sil-linking -enable-sil-verify-all %t/differentiable_attr.swiftmodule -o - | %FileCheck %s
4+
// RUN: %target-sil-opt -enable-sil-verify-all %t/differentiable_attr.swiftmodule -o - | %FileCheck %s
55

66
// BCANALYZER-NOT: UnknownCode
77

test/AutoDiff/Serialization/differentiable_function.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend %s -emit-module -parse-as-library -o %t
33
// RUN: llvm-bcanalyzer %t/differentiable_function.swiftmodule | %FileCheck %s -check-prefix=BCANALYZER
4-
// RUN: %target-sil-opt -disable-sil-linking -enable-sil-verify-all %t/differentiable_function.swiftmodule -o - | %FileCheck %s
4+
// RUN: %target-sil-opt -enable-sil-verify-all %t/differentiable_function.swiftmodule -o - | %FileCheck %s
55

66
// BCANALYZER-NOT: UnknownCode
77

test/AutoDiff/Serialization/transpose_attr.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend %s -emit-module -parse-as-library -o %t
33
// RUN: llvm-bcanalyzer %t/transpose_attr.swiftmodule | %FileCheck %s -check-prefix=BCANALYZER
4-
// RUN: %target-sil-opt -disable-sil-linking -enable-sil-verify-all %t/transpose_attr.swiftmodule -o - | %FileCheck %s
4+
// RUN: %target-sil-opt -enable-sil-verify-all %t/transpose_attr.swiftmodule -o - | %FileCheck %s
55

66
// BCANALYZER-NOT: UnknownCode
77

test/Frontend/sil-merge-partial-modules.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// RUN: %target-swift-frontend -emit-module %t/partial.a.swiftmodule %t/partial.b.swiftmodule -module-name test -enable-library-evolution -sil-merge-partial-modules -disable-diagnostic-passes -disable-sil-perf-optzns -o %t/test.swiftmodule
77

8-
// RUN: %target-sil-opt %t/test.swiftmodule -disable-sil-linking -emit-sorted-sil > %t/dump.sil
8+
// RUN: %target-sil-opt %t/test.swiftmodule -emit-sorted-sil > %t/dump.sil
99
// RUN: %FileCheck %s < %t/dump.sil
1010
// RUN: %FileCheck %s --check-prefix=NEGATIVE < %t/dump.sil
1111

test/ModuleInterface/ModuleCache/SerializedSIL.swiftinterface

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// RUN: %empty-directory(%t)
55
// RUN: echo 'import SerializedSIL' | %target-swift-frontend -typecheck -module-cache-path %t -I %S -
6-
// RUN: %target-sil-opt -disable-sil-linking %t/SerializedSIL-*.swiftmodule -module-name SerializedSIL > %t/SerializedSIL.sil
6+
// RUN: %target-sil-opt %t/SerializedSIL-*.swiftmodule -module-name SerializedSIL > %t/SerializedSIL.sil
77
// RUN: %FileCheck %s < %t/SerializedSIL.sil
88
// RUN: %FileCheck -check-prefix NEGATIVE %s < %t/SerializedSIL.sil
99

test/SIL/Parser/stage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend -emit-module %s -O -parse-stdlib -parse-as-library -emit-module -o %t/stage.swiftmodule
3-
// RUN: %target-sil-opt %t/stage.swiftmodule -disable-sil-linking -sil-disable-ast-dump -o %t/stage.sil
3+
// RUN: %target-sil-opt %t/stage.swiftmodule -sil-disable-ast-dump -o %t/stage.sil
44
// RUN: %target-sil-opt %t/stage.sil -o - | %FileCheck %s
55

66
// FIXME: We create all SIL modules in the 'raw' stage regardless of the input

test/SIL/Serialization/dynamically_replaceable.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend %s -emit-module -o %t/tmp.swiftmodule
3-
// RUN: %target-sil-opt %t/tmp.swiftmodule -disable-sil-linking -emit-sorted-sil | %FileCheck %s
3+
// RUN: %target-sil-opt %t/tmp.swiftmodule -emit-sorted-sil | %FileCheck %s
44

55

66
// CHECK-DAG-LABEL: sil [serialized] [dynamically_replacable] [canonical] @test_dynamically_replaceable

0 commit comments

Comments
 (0)