[PATCH] D156374: [BOLT][DWARF] Don't convert low_pc/high_pc to ranges for size 1, and fix handling of sub-program with ranges

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 14:50:19 PDT 2023


ayermolo created this revision.
Herald added subscribers: treapster, hoy, modimo, wenlei, arphaman.
Herald added a reviewer: rafauler.
Herald added a reviewer: Amir.
Herald added a reviewer: maksfb.
Herald added a project: All.
ayermolo requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: llvm-commits, wangpc, jplehr, yota9, sstefan1.
Herald added a project: LLVM.

When output range is only one entry, and input is low_pc/high_pc do not convert
to ranges. This helps with size of .debug_ranges/.debug_rnglists. It also helps
when either low_pc/high_pc is 0. We not generating potentially invalid ranges
that result in LLDB error.

Also fixed handling of DW_AT_subprogram with ranges. This can be created with
-fbasic-block-sections=all.

New tests added
dwarf4-df-do-no-convert-low-pc-high-pc-to-ranges.test
dwarf4-do-no-convert-low-pc-high-pc-to-ranges.test
dwarf5-do-no-convert-low-pc-high-pc-to-ranges.test
dwarf4-subprogram-multiple-ranges.test
dwarf4-subprogram-single-ranges.test
dwarf4-subprogram-single-gc-ranges.test
dwarf5-subprogram-multiple-ranges.test
dwarf5-subprogram-single-ranges.test
dwarf5-subprogram-single-gc-ranges.test


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156374

Files:
  bolt/include/bolt/Core/DIEBuilder.h
  bolt/include/bolt/Rewrite/DWARFRewriter.h
  bolt/lib/Rewrite/DWARFRewriter.cpp
  bolt/test/AArch64/go_dwarf.test
  bolt/test/X86/Inputs/debug-fission-simple-convert.s
  bolt/test/X86/Inputs/dwarf4-df-do-no-convert-low-pc-high-pc-to-ranges.s
  bolt/test/X86/Inputs/dwarf4-do-no-convert-low-pc-high-pc-to-ranges.s
  bolt/test/X86/Inputs/dwarf4-subprogram-multiple-ranges-main.s
  bolt/test/X86/Inputs/dwarf4-subprogram-single-gc-ranges-main.s
  bolt/test/X86/Inputs/dwarf4-subprogram-single-ranges-main.s
  bolt/test/X86/Inputs/dwarf5-do-no-convert-low-pc-high-pc-to-ranges.s
  bolt/test/X86/Inputs/dwarf5-subprogram-multiple-ranges-main.s
  bolt/test/X86/Inputs/dwarf5-subprogram-single-gc-ranges-main.s
  bolt/test/X86/Inputs/dwarf5-subprogram-single-ranges-main.s
  bolt/test/X86/debug-fission-single-convert.s
  bolt/test/X86/debug-fission-single.s
  bolt/test/X86/dwarf4-df-do-no-convert-low-pc-high-pc-to-ranges.test
  bolt/test/X86/dwarf4-df-dualcu-loclist.test
  bolt/test/X86/dwarf4-df-dualcu.test
  bolt/test/X86/dwarf4-do-no-convert-low-pc-high-pc-to-ranges.test
  bolt/test/X86/dwarf4-size-0-inlined_subroutine.s
  bolt/test/X86/dwarf4-subprogram-multiple-ranges.test
  bolt/test/X86/dwarf4-subprogram-single-gc-ranges.test
  bolt/test/X86/dwarf4-subprogram-single-ranges.test
  bolt/test/X86/dwarf4-types-dwarf5-types.test
  bolt/test/X86/dwarf4-types-dwarf5.test
  bolt/test/X86/dwarf5-df-dualcu-loclist.test
  bolt/test/X86/dwarf5-df-dualcu.test
  bolt/test/X86/dwarf5-df-mono-dualcu.test
  bolt/test/X86/dwarf5-do-no-convert-low-pc-high-pc-to-ranges.test
  bolt/test/X86/dwarf5-dwarf4-gdb-index-types-gdb-generated-gdb11.test
  bolt/test/X86/dwarf5-dwarf4-gdb-index-types-gdb-generated-gdb9.test
  bolt/test/X86/dwarf5-dwarf4-gdb-index-types-lld-generated.test
  bolt/test/X86/dwarf5-dwarf4-monolithic.test
  bolt/test/X86/dwarf5-dwarf4-types-backward-forward-cross-reference.test
  bolt/test/X86/dwarf5-ftypes-dwo-mono-input-dwp-output.test
  bolt/test/X86/dwarf5-gdb-index-types-gdb-generated-gdb11.test
  bolt/test/X86/dwarf5-gdb-index-types-gdb-generated-gdb9.test
  bolt/test/X86/dwarf5-gdb-index-types-lld-generated.test
  bolt/test/X86/dwarf5-locaddrx.test
  bolt/test/X86/dwarf5-locexpr-referrence.test
  bolt/test/X86/dwarf5-lowpc-highpc-convert.s
  bolt/test/X86/dwarf5-one-loclists-two-bases.test
  bolt/test/X86/dwarf5-rangeoffset-to-rangeindex.s
  bolt/test/X86/dwarf5-split-dwarf4-monolithic.test
  bolt/test/X86/dwarf5-subprogram-multiple-ranges.test
  bolt/test/X86/dwarf5-subprogram-single-gc-ranges.test
  bolt/test/X86/dwarf5-subprogram-single-ranges.test
  bolt/test/X86/dwarf5-two-loclists.test
  bolt/test/X86/dwarf5-two-rnglists.test
  bolt/test/X86/dwarf5-types-backward-cross-reference.s
  bolt/test/X86/dwarf5-types-forward-cross-reference.s
  bolt/test/X86/gdbindex.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156374.544526.patch
Type: text/x-patch
Size: 228731 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230726/a8463b13/attachment-0001.bin>


More information about the llvm-commits mailing list