[llvm] [LLVM][DWARF] Add support for monolithic types in .debug_names (PR #68131)

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 13 13:31:15 PDT 2023


================
@@ -3514,11 +3520,15 @@ void DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU,
       return;
     }
 
-    // If the type wasn't dependent on fission addresses, finish adding the type
-    // and all its dependent types.
     for (auto &TU : TypeUnitsToAdd) {
       InfoHolder.computeSizeAndOffsetsForUnit(TU.first.get());
       InfoHolder.emitUnit(TU.first.get(), useSplitDwarf());
+      if (getDwarfVersion() >= 5 &&
+          getAccelTableKind() == AccelTableKind::Dwarf) {
+        addTypeUnit(std::move(TU.first));
----------------
ayermolo wrote:

OK using LLC
time ~/local/llvm-build-upstream-release/bin/llc -filetype=obj tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/Sema.cpp.ir.o -dwarf-version=5 -generate-type-units -mtriple x86_64-pc-linux -o foo.o
Looks like there is some reduction.
with changes
0:07.42 real,   7.21 user,      0.19 sys,       0 amem, 335256 mmem
0:07.96 real,   7.76 user,      0.19 sys,       0 amem, 334812 mmem
0:07.55 real,   7.35 user,      0.19 sys,       0 amem, 334112 mmem

without changes


0:07.19 real,   7.01 user,      0.16 sys,       0 amem, 307616 mmem
0:07.27 real,   7.10 user,      0.17 sys,       0 amem, 305080 mmem
0:07.21 real,   7.05 user,      0.15 sys,       0 amem, 303628 mmem

So about 35MB difference.

https://github.com/llvm/llvm-project/pull/68131


More information about the llvm-commits mailing list