Skip to content

Commit 61afebd

Browse files
[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.
1 parent ce7b670 commit 61afebd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,13 +552,13 @@ class CallsiteContextGraph {
552552
const DenseSet<uint32_t> &AllocContextIds);
553553

554554
/// Map from each context ID to the AllocationType assigned to that context.
555-
std::map<uint32_t, AllocationType> ContextIdToAllocationType;
555+
DenseMap<uint32_t, AllocationType> ContextIdToAllocationType;
556556

557557
/// Identifies the context node created for a stack id when adding the MIB
558558
/// contexts to the graph. This is used to locate the context nodes when
559559
/// trying to assign the corresponding callsites with those stack ids to these
560560
/// nodes.
561-
std::map<uint64_t, ContextNode *> StackEntryIdToContextNodeMap;
561+
DenseMap<uint64_t, ContextNode *> StackEntryIdToContextNodeMap;
562562

563563
/// Maps to track the calls to their corresponding nodes in the graph.
564564
MapVector<CallInfo, ContextNode *> AllocationCallToContextNodeMap;

0 commit comments

Comments
 (0)