Revision tags: llvmorg-18.1.8, llvmorg-18.1.7 |
|
#
bd5c6367 |
| 22-May-2024 |
David Blaikie <dblaikie@gmail.com> |
DWARF: debug_names: Don't emit entries for skeleton type units
When a type unit is emitted, the CU referencing the type unit ends up with a little DW_TAG_*_type with the DW_AT_signature and DW_AT_de
DWARF: debug_names: Don't emit entries for skeleton type units
When a type unit is emitted, the CU referencing the type unit ends up with a little DW_TAG_*_type with the DW_AT_signature and DW_AT_declaration sometimes referred to (by me? maybe other people?) as a skeleton type.
We shouldn't produce .debug_names reference to these - only to the actual type definition in the type unit. So this patch does that.
But, inversely, the .debug_gnu_pubtypes /does/ need to reference the skeleton type (& gcc does this too, when it produces a skeleton type (gcc doesn't always produce these - if the type is only referenced once via DW_AT_type, gcc uses a direct DW_FORM_ref_sig8 on the DW_AT_type without the intermediate skeleton type)) - so there's a little special case added in to preserve that behavior which is covered by existing tests.
show more ...
|
Revision tags: llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3 |
|
#
a78d13d0 |
| 14-Feb-2024 |
Alexander Yermolovich <43973793+ayermolo@users.noreply.github.com> |
[LLVM][DWARF] Change .debug_names abbrev to be an index (#81200)
Based on the discussion in
https://github.com/llvm/llvm-project/pull/80229
changed implementation to align with how .debug_abbrev i
[LLVM][DWARF] Change .debug_names abbrev to be an index (#81200)
Based on the discussion in
https://github.com/llvm/llvm-project/pull/80229
changed implementation to align with how .debug_abbrev is handled. So
that
.debug_names abbrev tag is a monotonically increasing index. This allows
for
tools like LLDB to access it in constant time using array like data
structure.
clang-19 debug build
before change
[41] .debug_names PROGBITS 0000000000000000 8f9e0350 137fdbe0 00 0 0 4
after change
[41] .debug_names PROGBITS 0000000000000000 8f9e0350 125bfdec 00 0 0 4
Reduction ~19.1MB
show more ...
|
Revision tags: llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1 |
|
#
380ac53d |
| 24-Jan-2024 |
Felipe de Azevedo Piovezan <fpiovezan@apple.com> |
[DebugNames] Implement Entry::GetParentEntry query (#78760)
This commit introduces a helper function to DWARFAcceleratorTable::Entry
which follows DW_IDX_Parent attributes to returns the correspond
[DebugNames] Implement Entry::GetParentEntry query (#78760)
This commit introduces a helper function to DWARFAcceleratorTable::Entry
which follows DW_IDX_Parent attributes to returns the corresponding
parent Entry in the table.
It is tested by enhancing dwarfdump so that it now prints:
1. When data is corrupt.
2. When parent information is present, but the parent is not indexed.
3. The parent entry offset, when the parent is present and indexed. This
is printed in terms a real entry offset (the same that gets printed at
the start of each entry: "Entry @ 0x..."), instead of the encoded number
in the table (which is an offset from the start off the Entry list).
This makes it easy to visually inspect the dwarfdump and check what the
parent is.
show more ...
|
Revision tags: llvmorg-19-init |
|
#
b6677835 |
| 19-Jan-2024 |
Felipe de Azevedo Piovezan <fpiovezan@apple.com> |
[AsmPrinter][DebugNames] Implement DW_IDX_parent entries (#77457)
This implements the ideas discussed in [1].
To summarize, this commit changes AsmPrinter so that it outputs
DW_IDX_parent inform
[AsmPrinter][DebugNames] Implement DW_IDX_parent entries (#77457)
This implements the ideas discussed in [1].
To summarize, this commit changes AsmPrinter so that it outputs
DW_IDX_parent information for debug_name entries. It will enable
debuggers to speed up queries for fully qualified types (based on a
DWARFDeclContext) significantly, as debuggers will no longer need to
parse the entire CU in order to inspect the parent chain of a DIE.
Instead, a debugger can simply take the parent DIE offset from the
accelerator table and peek at its name in the debug_info/debug_str
sections.
The implementation uses two types of DW_FORM for the DW_IDX_parent
attribute:
1. DW_FORM_ref4, which points to the accelerator table entry for the
parent.
2. DW_FORM_flag_present, when the entry has a parent that is not in the
table (that is, the parent doesn't have a name, or isn't allowed to be
in the table as per the DWARF spec). This is space-efficient, since it
takes 0 bytes.
The implementation works by:
1. Changing how abbreviations are encoded (so that they encode which
form, if
any, was used to encode IDX_Parent)
2. Creating an MCLabel per accelerator table entry, so that they may be
referred by IDX_parent references.
When all patches related to this are merged, we are able to show that
evaluating an expression such as:
```
lldb --batch -o 'b CodeGenFunction::GenerateCode' -o run -o 'expr Fn' -- \
clang++ -c -g test.cpp -o /dev/null
```
is far faster: from ~5000 ms to ~1500ms.
Building llvm-project + clang with and without this patch, and looking
at its impact on object file size:
```
ls -la $(find build_stage2_Debug_idx_parent_assert_dwarf5 -name \*.cpp.o) | awk '{s+=$5} END {printf "%\047d\n", s}'
11,507,327,592
-la $(find build_stage2_Debug_no_idx_parent_assert_dwarf5 -name \*.cpp.o) | awk '{s+=$5} END {printf "%\047d\n", s}'
11,436,446,616
```
That is, an increase of 0.62% in total object file size.
Looking only at debug_names:
```
$stage1_build/bin/llvm-objdump --section-headers $(find build_stage2_Debug_idx_parent_assert_dwarf5 -name \*.cpp.o) | grep __debug_names | awk '{s+="0x"$3} END {printf "%\047d\n", s}'
440,772,348
$stage1_build/bin/llvm-objdump --section-headers $(find build_stage2_Debug_no_idx_parent_assert_dwarf5 -name \*.cpp.o) | grep __debug_names | awk '{s+="0x"$3} END {printf "%\047d\n", s}'
369,867,920
```
That is an increase of 19%.
DWARF Linkers need to be changed in order to support this. This commit
already brings support to "base" linker, but it does not attempt to
modify the parallel linker. Accelerator entries refer to the
corresponding DIE offset, and this patch also requires the parent DIE
offset -- it's not clear how the parallel linker can access this. It may
be obvious to someone familiar with it, but it would be nice to get help
from its authors.
[1]:
https://discourse.llvm.org/t/rfc-improve-dwarf-5-debug-names-type-lookup-parsing-speed/74151/
show more ...
|
#
e8e9a335 |
| 12-Dec-2023 |
Alexander Yermolovich <43973793+ayermolo@users.noreply.github.com> |
[LLVM][DWARF] Add compilation directory and dwo name to TU in dwo section (#74909)
This adds support to help LLDB when binary is built with split dwarf,
has
.debug_names accelerator table and DWP
[LLVM][DWARF] Add compilation directory and dwo name to TU in dwo section (#74909)
This adds support to help LLDB when binary is built with split dwarf,
has
.debug_names accelerator table and DWP file.
Final linked binary might have Type Units (TUs) with the same type
signature in multiple
compilation units. Although the signature is the same, TUs are not
guranted to
be bit identical. This is not a problem when they are in .o/.dwo files
as LLDB
can find them by looking at the right one based on
DW_AT_comp_dir/DW_AT_name in
skeleton CU. Once DWP is created, TUs are de-duplicated, and we need to
know
from which CU remaining one came from.
This approach allows LLDB to figure it out, with minimal changes to the
rest of
the tooling. As would have been the case if .debug_tu_index section in
DWP was
modified.
show more ...
|
#
e8f3ccd2 |
| 04-Dec-2023 |
Alexander Yermolovich <43973793+ayermolo@users.noreply.github.com> |
[LLVM][DWARF] Add support for .debug_names with split dwarf (#73872)
Enables Type Units with DWARF5 accelerator tables for split dwarf. It is
still
under discussion what is the best way to impleme
[LLVM][DWARF] Add support for .debug_names with split dwarf (#73872)
Enables Type Units with DWARF5 accelerator tables for split dwarf. It is
still
under discussion what is the best way to implement support for
de-duplication in
DWP. This will be in follow up PR.
show more ...
|
Revision tags: llvmorg-17.0.6 |
|
#
197f3059 |
| 20-Nov-2023 |
Krasimir Georgiev <krasimir@google.com> |
NFCI: update debug-names-types test to use an output file unique to the test
This makes it work in environments where the test is running in a write-protected current directory. Updated similarly to
NFCI: update debug-names-types test to use an output file unique to the test
This makes it work in environments where the test is running in a write-protected current directory. Updated similarly to other such tests, like https://github.com/llvm/llvm-project/blob/8bd06d5b65845e5e01dd899a2deb773580460b89/llvm/test/tools/llvm-dwp/X86/absolute_paths.test#L3.
show more ...
|
#
b00e2f2a |
| 18-Nov-2023 |
Alexander Yermolovich <43973793+ayermolo@users.noreply.github.com> |
[LLVM][DWARF] Add support for monolithic types in .debug_names (#70515)
Enable Type Units with DWARF5 accelerator tables for monolithic DWARF.
Implementation relies on linker to tombstone offset in
[LLVM][DWARF] Add support for monolithic types in .debug_names (#70515)
Enable Type Units with DWARF5 accelerator tables for monolithic DWARF.
Implementation relies on linker to tombstone offset in LocalTU list to
-1 when
it deduplciates type units using COMDAT.
show more ...
|