From bb3ea6c810ccdffd176589e608bfa79dd25268ff Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Wed, 7 Feb 2024 13:32:08 -0800 Subject: [PATCH] [MemProf] Switch to DenseMap for performance (NFC) (#81035) Some profiling showed that the accesses to this map during bitcode reading was incurring over 10% of the time in a large thin link. There is no need for it to be std::map, and I measured around 8.5% time reduction in the same thin link from switching to DenseMap. --- llvm/include/llvm/IR/ModuleSummaryIndex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/include/llvm/IR/ModuleSummaryIndex.h b/llvm/include/llvm/IR/ModuleSummaryIndex.h index 395c9e332eb8f3..d5ff15063671d8 100644 --- a/llvm/include/llvm/IR/ModuleSummaryIndex.h +++ b/llvm/include/llvm/IR/ModuleSummaryIndex.h @@ -1377,7 +1377,7 @@ class ModuleSummaryIndex { // Temporary map while building StackIds list. Clear when index is completely // built via releaseTemporaryMemory. - std::map StackIdToIndex; + DenseMap StackIdToIndex; // YAML I/O support. friend yaml::MappingTraits;