[PATCH] D51330: [ThinLTO] Efficiency fix for writing type id records in per-module indexes

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 29 13:52:07 PDT 2018


pcc added a comment.

Did you consider changing the type id mapping data structure in `ModuleSummaryIndex` instead of creating a new one? Since we now use a mapping from guids in several places it seems sensible to do that. I think that it would work to change the type of `TypeIdMap` to something like:

  DenseMap<GlobalValue::GUID, TinyPtrVector<std::pair<std::string, TypeIdSummary>>>



================
Comment at: include/llvm/IR/ModuleSummaryIndex.h:744
+    GlobalValue::GUID,
+    TinyPtrVector<const std::pair<const std::string, TypeIdSummary> *>>;
+
----------------
tejohnson wrote:
> @pcc - do you remember why you used a vector as the map value type? Presumably there should be a 1-1 ratio between the GUIDs computed from type ids and the type id map entry, but is this to handle the potential for GUID conflicts?
Yes, it was for guid conflicts.


Repository:
  rL LLVM

https://reviews.llvm.org/D51330





More information about the llvm-commits mailing list