[BOLT][DWARF] Change rangelists to use DW_RLE_offset_pair
authorAlexander Yermolovich <ayermolo@fb.com>
Fri, 6 Jan 2023 21:45:43 +0000 (13:45 -0800)
committerAlexander Yermolovich <ayermolo@fb.com>
Fri, 6 Jan 2023 21:45:43 +0000 (13:45 -0800)
commite22ff52c10d1fdaedc3e24a7884ec215e78eeec4
tree6e584dc15be3052277ccd44953564fe49a690fe6
parent42b1d08b955d6cfa0b78ceca62605bddc905461a
[BOLT][DWARF] Change rangelists to use DW_RLE_offset_pair

Before we always used DW_RLE_startx_length. This is not very efficient and leads
to bigger .debug_addr section. Changed it to use
DW_RLE_base_addressx/DW_RLE_offset_pair.

clang-16 build in debug mode
llvm-bolt ran on it with --update-debug-sections
| section | before | after | diff | % decrease |
| .debug_rnglists | 32732292 | 31986051 | -746241 | 2.3% |
| .debug_addr | 14415808 | 14184128 |  -231680 | 1.6% |

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D140439
12 files changed:
bolt/include/bolt/Core/DebugData.h
bolt/lib/Core/DebugData.cpp
bolt/test/X86/dwarf5-debug-loclists.s
bolt/test/X86/dwarf5-df-dualcu.test
bolt/test/X86/dwarf5-df-mono-dualcu.test
bolt/test/X86/dwarf5-dwarf4-monolithic.test
bolt/test/X86/dwarf5-locexpr-addrx.s
bolt/test/X86/dwarf5-loclist-offset-form.test
bolt/test/X86/dwarf5-multiple-dw-op-addrx-locexpr.s
bolt/test/X86/dwarf5-split-dwarf4-monolithic.test
bolt/test/X86/dwarf5-two-loclists.test
bolt/test/X86/dwarf5-two-rnglists.test