[lld][COFF][ELF][WebAssembly] Replace --[no-]threads /threads[:no] with --threads...
authorFangrui Song <maskray@google.com>
Tue, 17 Mar 2020 19:40:19 +0000 (12:40 -0700)
committerFangrui Song <maskray@google.com>
Tue, 31 Mar 2020 15:46:12 +0000 (08:46 -0700)
commiteb4663d8c6add351d758748383f1a9fc231e5e64
tree2287d04d40ec50579d5e9936169e35e2f8b4fe84
parentf3a7d790df3357d52c10ec5ef48606944bcf5c6c
[lld][COFF][ELF][WebAssembly] Replace --[no-]threads /threads[:no] with --threads={1,2,...} /threads:{1,2,...}

--no-threads is a name copied from gold.
gold has --no-thread, --thread-count and several other --thread-count-*.

There are needs to customize the number of threads (running several lld
processes concurrently or customizing the number of LTO threads).
Having a single --threads=N is a straightforward replacement of gold's
--no-threads + --thread-count.

--no-threads is used rarely. So just delete --no-threads instead of
keeping it for compatibility for a while.

If --threads= is specified (ELF,wasm; COFF /threads: is similar),
--thinlto-jobs= defaults to --threads=,
otherwise all available hardware threads are used.

There is currently no way to override a --threads={1,2,...}. It is still
a debate whether we should use --threads=all.

Reviewed By: rnk, aganea

Differential Revision: https://reviews.llvm.org/D76885
22 files changed:
lld/COFF/Driver.cpp
lld/COFF/Options.td
lld/Common/CMakeLists.txt
lld/Common/Filesystem.cpp
lld/Common/Threads.cpp [deleted file]
lld/ELF/Driver.cpp
lld/ELF/ICF.cpp
lld/ELF/Options.td
lld/ELF/SyntheticSections.cpp
lld/docs/ld.lld.1
lld/include/lld/Common/Threads.h
lld/test/COFF/pdb-globals.test
lld/test/ELF/build-id.s
lld/test/ELF/lto/thinlto.ll
lld/test/ELF/threads.s [new file with mode: 0644]
lld/test/wasm/lto/thinlto.ll
lld/test/wasm/threads.s [new file with mode: 0644]
lld/wasm/Driver.cpp
lld/wasm/Options.td
llvm/include/llvm/Support/Parallel.h
llvm/lib/Support/Parallel.cpp
llvm/utils/gn/secondary/lld/Common/BUILD.gn