This is an archive of the discontinued LLVM Phabricator instance.

[DWARFLinker] Rewrite CU DW_AT_low_pc/high_pc pairs into DW_AT_ranges
AbandonedPublic

Authored by JDevlieghere on Jan 6 2023, 10:45 AM.

Details

Summary

For small gapless programs, clang emits single-value DW_AT_low_pc/high_pc in the compile unit. For the debugger, parsing DW_AT_ranges is much faster than having to decode all the compile units. This patch makes the DWARF linker (dsymutil) rewrite DW_AT_low_pc/high_pc pairs into DW_AT_ranges for accelerated access.

rdar://56096523

Diff Detail

Unit TestsFailed

Event Timeline

JDevlieghere created this revision.Jan 6 2023, 10:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2023, 10:45 AM
JDevlieghere requested review of this revision.Jan 6 2023, 10:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2023, 10:45 AM
aprantl accepted this revision.Jan 6 2023, 10:47 AM

Nice. Should we do this in LLVM itsel, too when tuning for LLDB?

llvm/lib/DWARFLinker/DWARFLinker.cpp
1430

I think LLVM_FALLTHROUGH is more compatible.

This revision is now accepted and ready to land.Jan 6 2023, 10:47 AM
JDevlieghere marked an inline comment as done.
  • Use LLVM_FALLTHROUGH
  • Document UINT64_MAX

Should we do this in LLVM itsel, too when tuning for LLDB?

I think that would make sense. If we go that route, do we still want to perform the optimization in dsymutil or should we avoid the added complexity?

avl added inline comments.Jan 9 2023, 6:18 AM
llvm/lib/DWARFLinker/DWARFLinker.cpp
1428

probably it is better to do as general option?

i.e. so that it could be set/unset for the DWARFLinker?

JDevlieghere abandoned this revision.Jan 9 2023, 2:35 PM

After D68655 this doesn't provide an advantage anymore.