[llvm] [LLVM[NFC] Refactor to allow debug_names entries to conatain DIE offset (PR #69399)

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 17:16:27 PDT 2023


================
@@ -1246,6 +1246,14 @@ void DwarfDebug::finishSubprogramDefinitions() {
   }
 }
 
+void DwarfDebug::finalizeAccelerationTables() {
+  for (auto &Entry : AccelDebugNames.getEntries()) {
+    for (AccelTableData *Value : Entry.second.Values) {
+      static_cast<DWARF5AccelTableData *>(Value)->normalizeDIEToOffset();
+    }
+  }
+}
----------------
ayermolo wrote:

Thanks for suggestions. I expanded this refactor.

I removed DWARF5AccelTableStaticData (24 bytes), and changed to use DWARF5AccelTableData (32 bytes).
I added class DWARF5AccelTable : public AccelTable<DWARF5AccelTableData>
  -- to move getEntries into it, to reduce the scope of where it's called, and to reduce number of template instantiations.
Made the finalize function static that takes in DWARF5AccelTable

My reasoning for living std::variant in place for now:
  -- Data in above comments shows when we are compiling sema from bit code it is noise. 
  -- The DWARF5AccelTableStaticData is used in DWARF*Linker It raises entire debug information into an IR form, so extra 8 bytes for a acceleration table I don't think matter that much. For example in BOLT which uses similar approach peak memory is 50-60 GB with breaking up how many CUs we process in IR form before writing them out. Without it it's 100+GB. 
  -- Using variant vs bit packing is more inline with c++ usage in llvm (I think).
  
 WDYT?

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


More information about the llvm-commits mailing list