Skip to content

Commit e9be61d

Browse files
committed
[move-function] Shrink the size of UseState since to handle closures I need to store them.
Specifically, I need to perform the initial gathering of uses for all addresses at the same time so I can handle their closures all at the same time.
1 parent 35dbb3e commit e9be61d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lib/SILOptimizer/Mandatory/MoveKillsCopyableAddressesChecker.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,15 @@ namespace {
196196

197197
struct UseState {
198198
SILValue address;
199-
SmallVector<MarkUnresolvedMoveAddrInst *, 8> markMoves;
200-
SmallPtrSet<SILInstruction *, 8> seenMarkMoves;
201-
SmallSetVector<SILInstruction *, 8> inits;
202-
SmallSetVector<SILInstruction *, 8> livenessUses;
203-
SmallBlotSetVector<DestroyAddrInst *, 8> destroys;
204-
llvm::SmallDenseMap<SILInstruction *, unsigned, 8> destroyToIndexMap;
205-
SmallBlotSetVector<SILInstruction *, 8> reinits;
206-
llvm::SmallDenseMap<SILInstruction *, unsigned, 8> reinitToIndexMap;
199+
SmallVector<MarkUnresolvedMoveAddrInst *, 1> markMoves;
200+
SmallPtrSet<SILInstruction *, 1> seenMarkMoves;
201+
SmallSetVector<SILInstruction *, 2> inits;
202+
SmallSetVector<SILInstruction *, 4> livenessUses;
203+
SmallBlotSetVector<DestroyAddrInst *, 4> destroys;
204+
llvm::SmallDenseMap<SILInstruction *, unsigned, 4> destroyToIndexMap;
205+
SmallBlotSetVector<SILInstruction *, 4> reinits;
206+
llvm::SmallDenseMap<SILInstruction *, unsigned, 4> reinitToIndexMap;
207+
SmallBlotSetVector<Operand *, 2> partialApplyOperands;
207208

208209
void insertMarkUnresolvedMoveAddr(MarkUnresolvedMoveAddrInst *inst) {
209210
if (!seenMarkMoves.insert(inst).second)

0 commit comments

Comments
 (0)