Skip to content

Commit

Permalink
[DAGCombiner] Use SmallDenseMap (NFC) (#79681)
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
kazutakahirata authored Jan 27, 2024
1 parent 57a20d2 commit 863b2c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ namespace {
/// This is used to find and remove nodes from the worklist (by nulling
/// them) when they are deleted from the underlying DAG. It relies on
/// stable indices of nodes within the worklist.
DenseMap<SDNode *, unsigned> WorklistMap;
SmallDenseMap<SDNode *, unsigned, 32> WorklistMap;

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

0 comments on commit 863b2c8

Please sign in to comment.