[PATCH] D37162: [CodeView] Don't output S_UDT records for incomplete typedefs

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 16:29:48 PDT 2017


zturner updated this revision to Diff 112762.
zturner added a comment.

Update to be a little big more aggressive.  From the bug <https://bugs.llvm.org/show_bug.cgi?id=34239>:

Making progress.  I found that in ELFObjectWriter.cpp.obj, we were emitting about 1,100 S_UDT records that referred to LF_POINTER types, while MSVC was emitting only 9.  Almost all of them were from STL template instantiations.

I dug into this and found that of the first 8 of the LF_POINTERs that I looked at, they all were pointers to types that did not have a complete decl in the debug info.  So, it sounds like my original optimization was correct, but I just needed to be more aggressive.  Instead of dropping it if it is "just" a typedef to a type with incomplete debug info, we need to also drill through const, volatile, pointer, reference, etc until we get to the real type.

This is a very marked improvement.

                          before           after          msvc    Gap Closed
  FileCheck.pdb        4,452,352       4,165,632     5,165,056     -40.23%
  opt.pdb            466,702,336     421,957,632   365,957,120      44.41%
  libclang.pdb     1,304,383,488   1,177,718,784   935,817,216      34.37%
  clang.pdb        1,098,010,624     977,195,008   822,833,152      43.90%
  lld.pdb            508,645,376     454,995,968   404,697,088      51.61%
  llvm-tblgen.pdb     59,822,080      51,105,792    38,465,536      40.81%
  clang-tblgen.pdb    15,085,568      13,332,480    13,545,472     113.83%

So we're now about 50% of the way to parity.  Now that I'm on the right track hopefully I can figure out the rest of them pretty easily.


https://reviews.llvm.org/D37162

Files:
  llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h
  llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
  llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h
  llvm/test/DebugInfo/COFF/purge-typedef-udts.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37162.112762.patch
Type: text/x-patch
Size: 14193 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170825/f248f96f/attachment.bin>


More information about the llvm-commits mailing list