Skip to content

Commit 863b2c8

Browse files
[DAGCombiner] Use SmallDenseMap (NFC) (#79681)
The use of SmallDenseMap saves 0.48% of heap allocations during the compilation of a large preprocessed file, namely X86ISelLowering.cpp, for the X86 target. During the experiment, the maximum size of WorklistMap was 24 or less 74% of the time. (Note that DenseMap has the maximum occupancy rate of 3/4.)
1 parent 57a20d2 commit 863b2c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ namespace {
174174
/// This is used to find and remove nodes from the worklist (by nulling
175175
/// them) when they are deleted from the underlying DAG. It relies on
176176
/// stable indices of nodes within the worklist.
177-
DenseMap<SDNode *, unsigned> WorklistMap;
177+
SmallDenseMap<SDNode *, unsigned, 32> WorklistMap;
178178

179179
/// This records all nodes attempted to be added to the worklist since we
180180
/// considered a new worklist entry. As we keep do not add duplicate nodes

0 commit comments

Comments
 (0)