[llvm] 61afebd - [MemProf][NFC] Switch to DenseMaps (#93868)
via llvm-commits
llvm-commits at lists.llvm.org
Thu May 30 12:57:18 PDT 2024
Author: Teresa Johnson
Date: 2024-05-30T12:57:14-07:00
New Revision: 61afebdacc3b980fb82ea606d78d742847a133c3
URL: https://github.com/llvm/llvm-project/commit/61afebdacc3b980fb82ea606d78d742847a133c3
DIFF: https://github.com/llvm/llvm-project/commit/61afebdacc3b980fb82ea606d78d742847a133c3.diff
LOG: [MemProf][NFC] Switch to DenseMaps (#93868)
Change a couple of maps from std::map to DenseMap, which showed
a modest (3.6%) reduction in peak RSS.
Added:
Modified:
llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp b/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
index c53b9451625c6..0512922e35ae9 100644
--- a/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
+++ b/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
@@ -552,13 +552,13 @@ class CallsiteContextGraph {
const DenseSet<uint32_t> &AllocContextIds);
/// Map from each context ID to the AllocationType assigned to that context.
- std::map<uint32_t, AllocationType> ContextIdToAllocationType;
+ DenseMap<uint32_t, AllocationType> ContextIdToAllocationType;
/// Identifies the context node created for a stack id when adding the MIB
/// contexts to the graph. This is used to locate the context nodes when
/// trying to assign the corresponding callsites with those stack ids to these
/// nodes.
- std::map<uint64_t, ContextNode *> StackEntryIdToContextNodeMap;
+ DenseMap<uint64_t, ContextNode *> StackEntryIdToContextNodeMap;
/// Maps to track the calls to their corresponding nodes in the graph.
MapVector<CallInfo, ContextNode *> AllocationCallToContextNodeMap;
More information about the llvm-commits
mailing list