[lld] [llvm] Re-apply "[NFCI][LTO][lld] Optimize away symbol copies within LTO global resolution in ELF" (PR #107792)
Jan Voung via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 9 07:38:28 PDT 2024
================
@@ -1797,18 +1799,18 @@ void BitcodeFile::parse() {
void BitcodeFile::parseLazy() {
numSymbols = obj->symbols().size();
symbols = std::make_unique<Symbol *[]>(numSymbols);
- for (auto [i, irSym] : llvm::enumerate(obj->symbols()))
+ for (auto [i, irSym] : llvm::enumerate(obj->symbols())) {
+ // Keep copies of per-module undefined symbols for LTO::GlobalResolutions
+ // usage.
+ irSym.Name = unique_saver().save(irSym.getName());
if (!irSym.isUndefined()) {
// Symbols can be duplicated in bitcode files because of '#include' and
// linkonce_odr. Use unique_saver to save symbol names for de-duplication.
----------------
jvoung wrote:
The unique_saver is now moved out, so should this comment be moved up too and merged with the "Keep copies of per-module undefined symbols" in some way?
https://github.com/llvm/llvm-project/pull/107792
More information about the llvm-commits
mailing list