Skip to content

Commit b85e79e

Browse files
committed
Only perform parallel ir generation if -num-threads > 1
Previously if `-num-threads` was passed as 1, this would still use the parallel codepath, but with only a single thread.
1 parent b5d6652 commit b85e79e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

include/swift/AST/SILOptions.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,7 @@ class SILOptions {
188188
return OptMode > OptimizationMode::NoOptimization;
189189
}
190190

191-
bool hasMultipleIRGenThreads() const { return NumThreads > 1; }
192-
bool shouldPerformIRGenerationInParallel() const { return NumThreads != 0; }
193-
bool hasMultipleIGMs() const { return hasMultipleIRGenThreads(); }
191+
bool shouldPerformIRGenerationInParallel() const { return NumThreads > 1; }
194192
};
195193

196194
} // end namespace swift

lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ static bool ParseTBDGenArgs(TBDGenOptions &Opts, ArgList &Args,
12041204
CompilerInvocation &Invocation) {
12051205
using namespace options;
12061206

1207-
Opts.HasMultipleIGMs = Invocation.getSILOptions().hasMultipleIGMs();
1207+
Opts.HasMultipleIGMs = Invocation.getSILOptions().shouldPerformIRGenerationInParallel();
12081208

12091209
if (const Arg *A = Args.getLastArg(OPT_module_link_name)) {
12101210
Opts.ModuleLinkName = A->getValue();

0 commit comments

Comments
 (0)