Skip to content

Commit 662ba14

Browse files
committed
Revert "Restrict COFF to a single thread when symbol count is high (#50874)"
This reverts commit eb4416b. As of LLVM 16, we automatically emit: .drectve `-exclude-symbols:"<symbol>"` which mitigates this issue where it is supported by the linker (which is the case for at least GCC 11+ and LLD 14+). PackageCompiler on Windows now ships GCC 14 (JuliaLang/PackageCompiler.jl#1012), so we should no longer need this workaround that can make a 15-minute sysimage compilation take an hour+
1 parent 498d982 commit 662ba14

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/aotcompile.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,6 @@ static FunctionInfo getFunctionWeight(const Function &F)
11961196
}
11971197

11981198
struct ModuleInfo {
1199-
Triple triple;
12001199
size_t globals;
12011200
size_t funcs;
12021201
size_t bbs;
@@ -1207,7 +1206,6 @@ struct ModuleInfo {
12071206

12081207
ModuleInfo compute_module_info(Module &M) {
12091208
ModuleInfo info;
1210-
info.triple = Triple(M.getTargetTriple());
12111209
info.globals = 0;
12121210
info.funcs = 0;
12131211
info.bbs = 0;
@@ -2005,12 +2003,6 @@ static unsigned compute_image_thread_count(const ModuleInfo &info) {
20052003
#endif
20062004
if (jl_is_timing_passes) // LLVM isn't thread safe when timing the passes https://github.com/llvm/llvm-project/issues/44417
20072005
return 1;
2008-
// COFF has limits on external symbols (even hidden) up to 65536. We reserve the last few
2009-
// for any of our other symbols that we insert during compilation.
2010-
if (info.triple.isOSBinFormatCOFF() && info.globals > 64000) {
2011-
LLVM_DEBUG(dbgs() << "COFF is restricted to a single thread for large images\n");
2012-
return 1;
2013-
}
20142006
// This is not overridable because empty modules do occasionally appear, but they'll be very small and thus exit early to
20152007
// known easy behavior. Plus they really don't warrant multiple threads
20162008
if (info.weight < 1000) {

0 commit comments

Comments
 (0)