[PATCH] D13743: Lazily sort ScopesWithImportedEntities to speed up LTO linking.

Ivan Krasin via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 13:28:20 PDT 2015


krasin added a comment.

In http://reviews.llvm.org/D13743#269169, @dblaikie wrote:

> When is not all the debug info needed? & how did it end up in the IR if it wasn't needed?


See lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:342:
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp&q=lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:342&sq=package:chromium&type=cs&l=342

// Skip imported directives in gmlt-like data.                                                                                                                                                                
if (!includeMinimalInlineScopes()) {

  // There is no need to emit empty lexical block DIE.
  for (const auto &E : DD->findImportedEntitiesForScope(DS))
     Children.push_back(
         constructImportedEntityDIE(cast<DIImportedEntity>(E.second)));

}

When the official Chrome is compiled, includeMinimalInlineScopes() returns true, and DwarfDebug::findImportedEntitiesForScope is never called.
It's defined in lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:823:
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp&q=includeMinimalInlineScopes%20file:%5Esrc/third_party/llvm/&sq=package:chromium&type=cs&l=823

bool DwarfCompileUnit::includeMinimalInlineScopes() const {

  return getCUNode()->getEmissionKind() == DIBuilder::LineTablesOnly ||
         (DD->useSplitDwarf() && !Skeleton);

}

At some point, the official Chrome was compiled with LineTablesOnly, then it was realized that stack traces in crash reports are not complete, and I conclude that Chrome uses split Dwarf. See https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/8tKb9-Wr8gk


http://reviews.llvm.org/D13743





More information about the llvm-commits mailing list