[PATCH] D42559: [CodeView] Speed up type merging by about 20%

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 15:07:03 PST 2018


zturner created this revision.
zturner added a reviewer: rnk.
Herald added a subscriber: hiraditya.

The critical loop in type merging is (unsurprisingly) the one that iterates over every type record and remaps indices.

The patch here mostly focuses on improving inlining behavior and saving unnecessary memcpys.  The way the algorithm works is that for every record, it tries to insert it into a hash table, and if it succeeded (because it was new), it then calls into a callback to serialize the record and save it off.  There were multiple levels of outlined functions in this tight loop.  This brings my test case down from 40 seconds to ~35 seconds when built with clang with optimizations.


https://reviews.llvm.org/D42559

Files:
  llvm/include/llvm/DebugInfo/CodeView/CVRecord.h
  llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h
  llvm/lib/DebugInfo/CodeView/GlobalTypeTableBuilder.cpp
  llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42559.131517.patch
Type: text/x-patch
Size: 12846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180125/3ff90b7c/attachment.bin>


More information about the llvm-commits mailing list