[lld] 33319dd - [ELF] LTO: skip expensive usedStartStop initialization if bitcodeFiles.empty()
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 23 01:53:04 PST 2021
Author: Fangrui Song
Date: 2021-12-23T01:52:54-08:00
New Revision: 33319dde2a4f594ba763f82e89b7cf4024416ff8
URL: https://github.com/llvm/llvm-project/commit/33319dde2a4f594ba763f82e89b7cf4024416ff8
DIFF: https://github.com/llvm/llvm-project/commit/33319dde2a4f594ba763f82e89b7cf4024416ff8.diff
LOG: [ELF] LTO: skip expensive usedStartStop initialization if bitcodeFiles.empty()
This may cost 1.3+% of total link time.
Added:
Modified:
lld/ELF/LTO.cpp
Removed:
################################################################################
diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp
index b1632b8bae8a..65b943c4a54c 100644
--- a/lld/ELF/LTO.cpp
+++ b/lld/ELF/LTO.cpp
@@ -204,6 +204,8 @@ BitcodeCompiler::BitcodeCompiler() {
config->ltoPartitions);
// Initialize usedStartStop.
+ if (bitcodeFiles.empty())
+ return;
for (Symbol *sym : symtab->symbols()) {
StringRef s = sym->getName();
for (StringRef prefix : {"__start_", "__stop_"})
More information about the llvm-commits
mailing list