[PATCH] D35148: Use DenseMap instead std::map for GVSummaryMapTy.

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 9 06:14:42 PDT 2017


danielcdh created this revision.
Herald added subscribers: mehdi_amini, sanjoy.

This speeds-up thin-link by ~47% for large programs.


https://reviews.llvm.org/D35148

Files:
  include/llvm/IR/ModuleSummaryIndex.h
  lib/LTO/LTO.cpp


Index: lib/LTO/LTO.cpp
===================================================================
--- lib/LTO/LTO.cpp
+++ lib/LTO/LTO.cpp
@@ -1030,7 +1030,7 @@
 
   // Collect for each module the list of function it defines (GUID ->
   // Summary).
-  StringMap<std::map<GlobalValue::GUID, GlobalValueSummary *>>
+  StringMap<DenseMap<GlobalValue::GUID, GlobalValueSummary *>>
       ModuleToDefinedGVSummaries(ThinLTO.ModuleMap.size());
   ThinLTO.CombinedIndex.collectDefinedGVSummariesPerModule(
       ModuleToDefinedGVSummaries);
Index: include/llvm/IR/ModuleSummaryIndex.h
===================================================================
--- include/llvm/IR/ModuleSummaryIndex.h
+++ include/llvm/IR/ModuleSummaryIndex.h
@@ -522,7 +522,7 @@
 
 /// Map of global value GUID to its summary, used to identify values defined in
 /// a particular module, and provide efficient access to their summary.
-using GVSummaryMapTy = std::map<GlobalValue::GUID, GlobalValueSummary *>;
+using GVSummaryMapTy = DenseMap<GlobalValue::GUID, GlobalValueSummary *>;
 
 /// Class to hold module path string table and global value map,
 /// and encapsulate methods for operating on them.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35148.105701.patch
Type: text/x-patch
Size: 1168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170709/c9edbe3d/attachment-0001.bin>


More information about the llvm-commits mailing list