Skip to content

Commit 5e67f75

Browse files
committed
Remove the -sil-serialize-all option
1 parent c272d41 commit 5e67f75

File tree

13 files changed

+9
-26
lines changed

13 files changed

+9
-26
lines changed

docs/Lexicon.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,6 @@ source code, tests, and commit messages. See also the `LLVM lexicon`_.
344344
"Swift Intermediate Language". A high-level IR used by the Swift compiler
345345
for flow-sensitive diagnostics, optimization, and LLVM IR generation.
346346

347-
-sil-serialize-all
348-
A mode where all functions in a library are made available for inlining by
349-
any client, regardless of access control. Also called "magic performance
350-
mode" as a reminder of how this drastically changes compilation. Not
351-
guaranteed to work on arbitrary code.
352-
353347
SR
354348
An issue reported on `bugs.swift.org <https://bugs.swift.org>`_. A
355349
backronym for "Swift Report"; really the name is derived from LLVM's

include/swift/AST/SILOptions.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,6 @@ class SILOptions {
150150
/// \brief Enable large loadable types IRGen pass.
151151
bool EnableLargeLoadableTypes = true;
152152

153-
/// Enables the "fully fragile" resilience strategy.
154-
///
155-
/// \see ResilienceStrategy::Fragile
156-
bool SILSerializeAll = false;
157-
158153
/// If set, SIL witness tables will be serialized.
159154
///
160155
/// It is supposed to be used only for compiling overlays.

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,6 @@ def sil_merge_partial_modules : Flag<["-"], "sil-merge-partial-modules">,
372372
def sil_link_all : Flag<["-"], "sil-link-all">,
373373
HelpText<"Link all SIL functions">;
374374

375-
def sil_serialize_all : Flag<["-"], "sil-serialize-all">,
376-
HelpText<"Serialize all generated SIL">;
377-
378375
def sil_serialize_witness_tables : Flag<["-"], "sil-serialize-witness-tables">,
379376
HelpText<"Serialize eligible SIL witness tables">;
380377

include/swift/SIL/SILModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ class SILModule {
323323
}
324324

325325
/// Returns true if everything in this SILModule is being serialized.
326-
bool isWholeModuleSerialized() const { return Options.SILSerializeAll; }
326+
bool isWholeModuleSerialized() const { return false; }
327327

328328
/// Returns true if it is the OnoneSupport module.
329329
bool isOnoneSupportModule() const;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
13731373
if (Args.hasArg(OPT_sil_merge_partial_modules))
13741374
Opts.MergePartialModules = true;
13751375

1376-
Opts.SILSerializeAll |= Args.hasArg(OPT_sil_serialize_all);
13771376
Opts.SILSerializeWitnessTables |=
13781377
Args.hasArg(OPT_sil_serialize_witness_tables);
13791378
Opts.SILSerializeVTables |=

lib/Frontend/Frontend.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,6 @@ ModuleDecl *CompilerInstance::getMainModule() {
258258

259259
if (Invocation.getFrontendOptions().EnableResilience)
260260
MainModule->setResilienceStrategy(ResilienceStrategy::Resilient);
261-
else if (Invocation.getSILOptions().SILSerializeAll)
262-
MainModule->setResilienceStrategy(ResilienceStrategy::Fragile);
263261
}
264262
return MainModule;
265263
}

lib/FrontendTool/FrontendTool.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,6 @@ static bool performCompile(CompilerInstance &Instance,
925925
serializationOpts.OutputPath = opts.ModuleOutputPath.c_str();
926926
serializationOpts.DocOutputPath = opts.ModuleDocOutputPath.c_str();
927927
serializationOpts.GroupInfoPath = opts.GroupInfoPath.c_str();
928-
serializationOpts.SerializeAllSIL =
929-
Invocation.getSILOptions().SILSerializeAll;
930928
if (opts.SerializeBridgingHeader)
931929
serializationOpts.ImportedHeader = opts.ImplicitObjCHeaderPath;
932930
serializationOpts.ModuleLinkName = opts.ModuleLinkName;

lib/SILGen/SILGen.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class LLVM_LIBRARY_VISIBILITY SILGenModule : public ASTVisitor<SILGenModule> {
126126

127127
/// If true, all functions and globals are made fragile. Currently only used
128128
/// for compiling the stdlib.
129-
bool isMakeModuleFragile() const { return M.getOptions().SILSerializeAll; }
129+
bool isMakeModuleFragile() const { return false; }
130130

131131
Optional<SILDeclRef> StringToNSStringFn;
132132
Optional<SILDeclRef> NSStringToStringFn;

lib/SILGen/SILGenType.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ class SILGenConformance : public SILGenWitnessTable<SILGenConformance> {
376376

377377
// Serialize the witness table if we're serializing everything with
378378
// -sil-serialize-all....
379-
if (SGM.isMakeModuleFragile())
379+
if (SGM.isMakeModuleFragile() ||
380+
SGM.M.getOptions().SILSerializeWitnessTables)
380381
Serialized = IsSerialized;
381382

382383
// ... or if the conformance itself thinks it should be.

lib/Serialization/SerializeSIL.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2283,7 +2283,8 @@ void SILSerializer::writeSILBlock(const SILModule *SILMod) {
22832283

22842284
// Write out fragile WitnessTables.
22852285
for (const SILWitnessTable &wt : SILMod->getWitnessTables()) {
2286-
if ((ShouldSerializeAll || wt.isSerialized()) &&
2286+
if ((ShouldSerializeAll || SILMod->getOptions().SILSerializeWitnessTables ||
2287+
wt.isSerialized()) &&
22872288
wt.getConformance()->getDeclContext()->isChildContextOf(assocDC))
22882289
writeSILWitnessTable(wt);
22892290
}

stdlib/private/StdlibCollectionUnittest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(swift_stdlib_unittest_compile_flags)
22
if(SWIFT_SERIALIZE_STDLIB_UNITTEST)
3-
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-all")
3+
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-witness-tables" "-Xfrontend" "-sil-serialize-vtables")
44
endif()
55

66
# TODO: support this on non-POSIX platforms. It cannot be currently as it

stdlib/private/StdlibUnicodeUnittest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(swift_stdlib_unittest_compile_flags)
22
if(SWIFT_SERIALIZE_STDLIB_UNITTEST)
3-
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-all")
3+
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-witness-tables" "-Xfrontend" "-sil-serialize-vtables")
44
endif()
55

66
# TODO: support this on non-POSIX platforms. It cannot be currently as it

stdlib/private/StdlibUnittest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if (SWIFT_RUNTIME_ENABLE_LEAK_CHECKER)
55
list(APPEND swift_stdlib_unittest_compile_flags "-DSWIFT_RUNTIME_ENABLE_LEAK_CHECKER")
66
endif()
77
if(SWIFT_SERIALIZE_STDLIB_UNITTEST)
8-
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-all")
8+
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-witness-tables" "-Xfrontend" "-sil-serialize-vtables")
99
endif()
1010

1111
is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" IS_BUILD_TYPE_OPTIMIZED)

0 commit comments

Comments
 (0)