Skip to content

Commit 9a692b1

Browse files
topolarityKristofferC
authored andcommitted
Revert "Restrict COFF to a single thread when symbol count is high (#50874)" (#59736)
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 (GCC 11+ and LLD 14+ are tested working) 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+ (cherry picked from commit 1cba9c2)
1 parent 36800cc commit 9a692b1

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
@@ -1083,7 +1083,6 @@ static FunctionInfo getFunctionWeight(const Function &F)
10831083
}
10841084

10851085
struct ModuleInfo {
1086-
Triple triple;
10871086
size_t globals;
10881087
size_t funcs;
10891088
size_t bbs;
@@ -1094,7 +1093,6 @@ struct ModuleInfo {
10941093

10951094
ModuleInfo compute_module_info(Module &M) {
10961095
ModuleInfo info;
1097-
info.triple = Triple(M.getTargetTriple());
10981096
info.globals = 0;
10991097
info.funcs = 0;
11001098
info.bbs = 0;
@@ -1895,12 +1893,6 @@ static unsigned compute_image_thread_count(const ModuleInfo &info) {
18951893
#endif
18961894
if (jl_is_timing_passes) // LLVM isn't thread safe when timing the passes https://github.com/llvm/llvm-project/issues/44417
18971895
return 1;
1898-
// COFF has limits on external symbols (even hidden) up to 65536. We reserve the last few
1899-
// for any of our other symbols that we insert during compilation.
1900-
if (info.triple.isOSBinFormatCOFF() && info.globals > 64000) {
1901-
LLVM_DEBUG(dbgs() << "COFF is restricted to a single thread for large images\n");
1902-
return 1;
1903-
}
19041896
// This is not overridable because empty modules do occasionally appear, but they'll be very small and thus exit early to
19051897
// known easy behavior. Plus they really don't warrant multiple threads
19061898
if (info.weight < 1000) {

0 commit comments

Comments
 (0)