[all-commits] [llvm/llvm-project] ad4cea: [BOLT][DWARF][NFC] Initialize CloneUnitCtxMap with...

Alexander Yermolovich via All-commits all-commits at lists.llvm.org
Wed Dec 20 16:13:06 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ad4cead67cff7cedacd32249799d43f1a59db706
      https://github.com/llvm/llvm-project/commit/ad4cead67cff7cedacd32249799d43f1a59db706
  Author: Alexander Yermolovich <43973793+ayermolo at users.noreply.github.com>
  Date:   2023-12-20 (Wed, 20 Dec 2023)

  Changed paths:
    M bolt/lib/Core/DIEBuilder.cpp

  Log Message:
  -----------
  [BOLT][DWARF][NFC] Initialize CloneUnitCtxMap with current partition size (#75876)

We would always allocate maximum amount for vector containing
DWARFUnitInfo. In real usecases what ends up hapenning is we allocate a
giant vector when processing one CU, or for thin-lto case multiple CUs.
This lead to a lot of memory overhead, and 2x BOLT processing slowdown
for at least one service built with monolithic DWARF.

For binaries built with LTO with clang all of CUs that have cross
references will share an abbrev table and will be processed in one
batch. Rest of CUs are processesd in --cu-processing-batch-size size.
Which defaults to 1.

For theoretical cases where cross-cu references are present, but they do
not share abbrev will increase the size of CloneUnitCtxMap as each CU is
being processsed.




More information about the All-commits mailing list