[llvm] 28a2b85 - [DeadStoreElimination] Use SmallSetVector (NFC) (#79410)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 11:01:15 PST 2024


Author: Kazu Hirata
Date: 2024-01-25T11:01:11-08:00
New Revision: 28a2b85602a583496fa06ebf1e64239a6399d60c

URL: https://github.com/llvm/llvm-project/commit/28a2b85602a583496fa06ebf1e64239a6399d60c
DIFF: https://github.com/llvm/llvm-project/commit/28a2b85602a583496fa06ebf1e64239a6399d60c.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index 11a91bfbe5baffa..663c06ebafb5f41 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -2096,7 +2096,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA,
     unsigned WalkerStepLimit = MemorySSAUpwardsStepLimit;
     unsigned PartialLimit = MemorySSAPartialStoreLimit;
     // Worklist of MemoryAccesses that may be killed by KillingDef.
-    SetVector<MemoryAccess *> ToCheck;
+    SmallSetVector<MemoryAccess *, 8> ToCheck;
     ToCheck.insert(KillingDef->getDefiningAccess());
 
     bool Shortend = false;


        


More information about the llvm-commits mailing list