Skip to content

Commit cd45058

Browse files
committed
ReleaseCodeMotion: use a SmallVector instead of a SetVector for RCRootVault.
We don't need a set for this vector.
1 parent 8dbbfab commit cd45058

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/SILOptimizer/Transforms/ARCCodeMotion.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class CodeMotionContext {
161161
RCIdentityFunctionInfo *RCFI;
162162

163163
/// All the unique refcount roots retained or released in the function.
164-
llvm::SetVector<SILValue> RCRootVault;
164+
llvm::SmallVector<SILValue, 16> RCRootVault;
165165

166166
/// Contains a map between RC roots to their index in the RCRootVault.
167167
/// used to facilitate fast RC roots to index lookup.
@@ -413,7 +413,7 @@ void RetainCodeMotionContext::initializeCodeMotionDataFlow() {
413413
if (RCRootIndex.find(Root) != RCRootIndex.end())
414414
continue;
415415
RCRootIndex[Root] = RCRootVault.size();
416-
RCRootVault.insert(Root);
416+
RCRootVault.push_back(Root);
417417
LLVM_DEBUG(llvm::dbgs()
418418
<< "Retain Root #" << RCRootVault.size() << " " << Root);
419419
}
@@ -801,7 +801,7 @@ void ReleaseCodeMotionContext::initializeCodeMotionDataFlow() {
801801
if (RCRootIndex.find(Root) != RCRootIndex.end())
802802
continue;
803803
RCRootIndex[Root] = RCRootVault.size();
804-
RCRootVault.insert(Root);
804+
RCRootVault.push_back(Root);
805805
LLVM_DEBUG(llvm::dbgs()
806806
<< "Release Root #" << RCRootVault.size() << " " << Root);
807807
}

0 commit comments

Comments
 (0)