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

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 24 13:51:35 PDT 2018


vitalybuka added inline comments.


================
Comment at: include/llvm/IR/ModuleSummaryIndex.h:760
+using TypeIdSummaryMapTy =
+    std::map<GlobalValue::GUID,
+             std::vector<std::pair<std::string, TypeIdSummary>>>;
----------------
Have you considered multimap?

```
using TypeIdSummaryMapTy =
    std::multimap<GlobalValue::GUID, std::pair<std::string, TypeIdSummary>>;
```

Not sure, but maybe code could be a little bit simpler with it.




================
Comment at: lib/IR/AsmWriter.cpp:2926
+      // Print all type id that correspond to this GUID.
+      for (auto &Tid : I->second) {
+        Out << FS;
----------------
So now we can have multiple entries here. Would be nice to reach this with a test?


================
Comment at: lib/IR/AsmWriter.cpp:2969
+    Out << FS;
+    Out << "vFuncId: (";
+    auto Slot = Machine.getTypeIdSlot(Tid.first);
----------------
Test?


Repository:
  rL LLVM

https://reviews.llvm.org/D51330





More information about the llvm-commits mailing list