[BOLT]DWARF] Eagerly write out loclists
authorAlexander Yermolovich <ayermolo@fb.com>
Wed, 8 Jun 2022 23:52:23 +0000 (16:52 -0700)
committerAlexander Yermolovich <ayermolo@fb.com>
Wed, 8 Jun 2022 23:52:59 +0000 (16:52 -0700)
commit1c6dc43de979abc58bb822cd308b1d53eb7f855c
treeb5ea4c3c3248ff17281aa6d81e7d0519f8af4a31
parentf4da30ba68614593ef107ae046586dd0d78d8074
[BOLT]DWARF] Eagerly write out loclists

Taking advantage of us being able to re-write .debug_info to reduce memory
footprint loclists. Writing out loc-list as they are added, similar to how
we handle ranges.

Collected on clang-14
trunk
4:41.20 real,   389.50 user,    59.50 sys,      0 amem, 38412532 mmem
4:30.08 real,   376.10 user,    63.75 sys,      0 amem, 38477844 mmem
4:25.58 real,   373.76 user,    54.71 sys,      0 amem, 38439660 mmem
diff
4:34.66 real,   392.83 user,    57.73 sys,      0 amem, 38382560 mmem
4:35.96 real,   377.70 user,    58.62 sys,      0 amem, 38255840 mmem
4:27.61 real,    390.18 user,    57.02 sys,      0 amem, 38223224 mmem

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D126999
bolt/include/bolt/Core/DebugData.h
bolt/include/bolt/Rewrite/DWARFRewriter.h
bolt/lib/Core/DebugData.cpp
bolt/lib/Rewrite/DWARFRewriter.cpp
bolt/test/Inputs/dwarf5-loclist-offset-form-helper.s [new file with mode: 0644]
bolt/test/Inputs/dwarf5-loclist-offset-form-main.s [new file with mode: 0644]
bolt/test/X86/dwarf4-df-dualcu-loclist.test
bolt/test/dwarf5-loclist-offset-form.test [new file with mode: 0644]