Skip to content

Commit 9d41905

Browse files
Xin TongXin Tong
authored andcommitted
[RLE-DSE] Use SmallDenseMap instead of DenseMap in RLE to save memory allocations.
Many, if not most functions do not have more than 64 BasicBlocks (BBState) which is the default for DenseMap.
1 parent 25f1743 commit 9d41905

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILPasses/Scalar/RedundantLoadElimination.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ class RLEContext {
326326
llvm::DenseMap<MemLocation, unsigned> LocToBitIndex;
327327

328328
/// A map from each BasicBlock to its BBState.
329-
llvm::DenseMap<SILBasicBlock *, BBState> BBToLocState;
329+
llvm::SmallDenseMap<SILBasicBlock *, BBState, 4> BBToLocState;
330330

331331
/// A map for each basic block and whether its predecessors have forwardable
332332
/// edges.

0 commit comments

Comments
 (0)