Skip to content

Commit 28a2b85

Browse files
[DeadStoreElimination] Use SmallSetVector (NFC) (#79410)
The use of SmallSetVector saves 0.58% of heap allocations during the compilation of a large preprocessed file, namely X86ISelLowering.cpp, for the X86 target. During the experiment, the final size of ToCheck was 8 or less 88% of the time.
1 parent 89dc706 commit 28a2b85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2096,7 +2096,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA,
20962096
unsigned WalkerStepLimit = MemorySSAUpwardsStepLimit;
20972097
unsigned PartialLimit = MemorySSAPartialStoreLimit;
20982098
// Worklist of MemoryAccesses that may be killed by KillingDef.
2099-
SetVector<MemoryAccess *> ToCheck;
2099+
SmallSetVector<MemoryAccess *, 8> ToCheck;
21002100
ToCheck.insert(KillingDef->getDefiningAccess());
21012101

21022102
bool Shortend = false;

0 commit comments

Comments
 (0)