[all-commits] [llvm/llvm-project] 76e43e: [BOLT] Create and release .dwo DWARF contexts incr...

Rafael Auler via All-commits all-commits at lists.llvm.org
Fri Aug 7 17:46:25 PDT 2026


  Branch: refs/heads/users/rafaelauler/incremental_context
  Home:   https://github.com/llvm/llvm-project
  Commit: 76e43e06c6136d968fa28075834ade01b1f389e8
      https://github.com/llvm/llvm-project/commit/76e43e06c6136d968fa28075834ade01b1f389e8
  Author: Rafael Auler <rafaelauler at fb.com>
  Date:   2026-08-07 (Fri, 07 Aug 2026)

  Changed paths:
    M bolt/include/bolt/Core/BinaryContext.h
    M bolt/lib/Core/BinaryContext.cpp
    M bolt/lib/Rewrite/DWARFRewriter.cpp
    M bolt/lib/Rewrite/RewriteInstance.cpp

  Log Message:
  -----------
  [BOLT] Create and release .dwo DWARF contexts incrementally

BOLT opened a DWARFContext for every .dwo during
readDebugInfo and kept them all alive until teardown. On large
split-DWARF targets that is tens of GiB held resident through
emission, the point of peak RSS.

Make the DWOCUs map a lazily-populated cache instead:

 * Use the newly added DWARFUnit::clearDWO()/hasDWO() to directly
   manage DWARFUnit's DIE caching mechanism.
 * BinaryContext::getDWOCU() opens a context on demand (keyed off a
   stable DWOId -> skeleton CU map).
 * Release contexts as soon as they are done with: all of them at the
   end of readDebugInfo, and per-bucket at the DWARF rewrite merge
   point.
 * Remove DWOCUs map, which became redundant and whose purpose can
   now be served by the new id-to-skeleton map, and then fetching
   the split CU from the skeleton via getNonSkeletonUnitDIE().

Also drop DWARFRewriter::writeDWOFiles()'s use of getDWOContext(),
which dereferenced an arbitrary DWOCUs entry -- with contexts now
being freed concurrently that would be a use-after-free. The CU's own
context answers the .dwp question identically.



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