[all-commits] [llvm/llvm-project] 64498c: [LTO][ELF][lld] Use unique string saver in ELF bit...

Mingming Liu via All-commits all-commits at lists.llvm.org
Thu Sep 5 14:49:25 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 64498c54831bed9cf069e0923b9b73678c6451d8
      https://github.com/llvm/llvm-project/commit/64498c54831bed9cf069e0923b9b73678c6451d8
  Author: Mingming Liu <mingmingl at google.com>
  Date:   2024-09-05 (Thu, 05 Sep 2024)

  Changed paths:
    M lld/ELF/InputFiles.cpp
    M lld/include/lld/Common/CommonLinkerContext.h

  Log Message:
  -----------
  [LTO][ELF][lld] Use unique string saver in ELF bitcode symbol parsing (#106670)

lld ELF
[BitcodeFile](https://github.com/llvm/llvm-project/blob/a527248a3c2d638b0c92a06992f3f1c1f80842ad/lld/ELF/InputFiles.h#L328)
uses [string
saver](https://github.com/llvm/llvm-project/blob/a527248a3c2d638b0c92a06992f3f1c1f80842ad/lld/include/lld/Common/CommonLinkerContext.h#L57)
to keep copies of bitcode symbols. Symbol duplication is very common
when compiling application binaries.

This change proposes to introduce a UniqueStringSaver in lld context and
use it for bitcode symbol parsing. The implementation covers ELF only.
Similar opportunities should exist on other (COFF, MachO, wasm) formats.

For an internal production binary where lto indexing takes ~10GiB
originally, this changes optimizes away ~800MiB (~7.8%), measured by
https://github.com/google/pprof. Flame graph breaks down memory by usage
call stacks and agrees with this measurement.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list