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

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 15:31:48 PST 2018


rnk added inline comments.


================
Comment at: llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp:376-377
+                               MutableArrayRef<uint8_t> Storage) {
+  SmallVector<TiReference, 4> Refs;
+  discoverTypeIndices(OriginalType.RecordData, Refs);
+  if (Refs.empty())
----------------
Maybe the next step is to templatize this so we don't have to build a vector of offsets to iterate? Maybe it doesn't matter, though. It'd save the branch on the TiRefKind inside the loop, though.

I think the ideal code for type index remapping would basically be a giant switch on record kind followed by inlined code that implements the remappings inline in each case block.


================
Comment at: llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp:393
+      (Ref.Kind == TiRefKind::IndexRef) ? remapItemIndex(TI)
+                                        : remapTypeIndex(TI);
     }
----------------
Looks like we lost error handling here.


https://reviews.llvm.org/D42559





More information about the llvm-commits mailing list