summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2017-07-10 20:12:54 +0000
committerDehao Chen <dehao@google.com>2017-07-10 20:12:54 +0000
commit5d96ee4fab0cf7ce5665803950a7dae5a5dd27c6 (patch)
tree661b18d7a2fb868b3a1adb515ce405bdd5d9718d
parent0b4ebb1d0b1e3d89b76609e9aaec21bbd7076458 (diff)
downloadbcm5719-llvm-5d96ee4fab0cf7ce5665803950a7dae5a5dd27c6.tar.gz
bcm5719-llvm-5d96ee4fab0cf7ce5665803950a7dae5a5dd27c6.zip
Use DenseMap instead std::map for GVSummaryMapTy.
Summary: This speeds-up thin-link by ~47% for large programs. Reviewers: tejohnson Reviewed By: tejohnson Subscribers: sanjoy, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D35148 llvm-svn: 307578
-rw-r--r--llvm/include/llvm/IR/ModuleSummaryIndex.h2
-rw-r--r--llvm/lib/LTO/LTO.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/include/llvm/IR/ModuleSummaryIndex.h b/llvm/include/llvm/IR/ModuleSummaryIndex.h
index c043c159ac1..4aa8a0199ab 100644
--- a/llvm/include/llvm/IR/ModuleSummaryIndex.h
+++ b/llvm/include/llvm/IR/ModuleSummaryIndex.h
@@ -522,7 +522,7 @@ using ModulePathStringTableTy = StringMap<std::pair<uint64_t, ModuleHash>>;
/// 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.
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 8be5312b920..19973946ac5 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -1030,7 +1030,7 @@ Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache,
// Collect for each module the list of function it defines (GUID ->
// Summary).
- StringMap<std::map<GlobalValue::GUID, GlobalValueSummary *>>
+ StringMap<GVSummaryMapTy>
ModuleToDefinedGVSummaries(ThinLTO.ModuleMap.size());
ThinLTO.CombinedIndex.collectDefinedGVSummariesPerModule(
ModuleToDefinedGVSummaries);
OpenPOWER on IntegriCloud