@@ -228,7 +228,7 @@ namespace {
228
228
229
229
// / Promotes a single AllocStackInst into registers..
230
230
class StackAllocationPromoter {
231
- using BlockSet = BasicBlockSetVector;
231
+ using BlockSetVector = BasicBlockSetVector;
232
232
using BlockToInstMap = llvm::DenseMap<SILBasicBlock *, SILInstruction *>;
233
233
234
234
// Use a priority queue keyed on dominator tree level so that inserted nodes
@@ -291,26 +291,27 @@ class StackAllocationPromoter {
291
291
void promoteAllocationToPhi ();
292
292
293
293
// / Replace the dummy nodes with new block arguments.
294
- void addBlockArguments (BlockSet &phiBlocks);
294
+ void addBlockArguments (BlockSetVector &phiBlocks);
295
295
296
296
// / Fix all of the branch instructions and the uses to use
297
297
// / the AllocStack definitions (which include stores and Phis).
298
- void fixBranchesAndUses (BlockSet &blocks);
298
+ void fixBranchesAndUses (BlockSetVector &blocks);
299
299
300
300
// / update the branch instructions with the new Phi argument.
301
301
// / The blocks in \p PhiBlocks are blocks that define a value, \p Dest is
302
302
// / the branch destination, and \p Pred is the predecessors who's branch we
303
303
// / modify.
304
- void fixPhiPredBlock (BlockSet &phiBlocks, SILBasicBlock *dest,
304
+ void fixPhiPredBlock (BlockSetVector &phiBlocks, SILBasicBlock *dest,
305
305
SILBasicBlock *pred);
306
306
307
307
// / Get the value for this AllocStack variable that is
308
308
// / flowing out of StartBB.
309
- SILValue getLiveOutValue (BlockSet &phiBlocks, SILBasicBlock *startBlock);
309
+ SILValue getLiveOutValue (BlockSetVector &phiBlocks,
310
+ SILBasicBlock *startBlock);
310
311
311
312
// / Get the value for this AllocStack variable that is
312
313
// / flowing into BB.
313
- SILValue getLiveInValue (BlockSet &phiBlocks, SILBasicBlock *block);
314
+ SILValue getLiveInValue (BlockSetVector &phiBlocks, SILBasicBlock *block);
314
315
315
316
// / Prune AllocStacks usage in the function. Scan the function
316
317
// / and remove in-block usage of the AllocStack. Leave only the first
@@ -450,14 +451,14 @@ StoreInst *StackAllocationPromoter::promoteAllocationInBlock(
450
451
return lastStore;
451
452
}
452
453
453
- void StackAllocationPromoter::addBlockArguments (BlockSet &phiBlocks) {
454
+ void StackAllocationPromoter::addBlockArguments (BlockSetVector &phiBlocks) {
454
455
LLVM_DEBUG (llvm::dbgs () << " *** Adding new block arguments.\n " );
455
456
456
457
for (auto *block : phiBlocks)
457
458
block->createPhiArgument (asi->getElementType (), OwnershipKind::Owned);
458
459
}
459
460
460
- SILValue StackAllocationPromoter::getLiveOutValue (BlockSet &phiBlocks,
461
+ SILValue StackAllocationPromoter::getLiveOutValue (BlockSetVector &phiBlocks,
461
462
SILBasicBlock *startBlock) {
462
463
LLVM_DEBUG (llvm::dbgs () << " *** Searching for a value definition.\n " );
463
464
// Walk the Dom tree in search of a defining value:
@@ -489,7 +490,7 @@ SILValue StackAllocationPromoter::getLiveOutValue(BlockSet &phiBlocks,
489
490
return SILUndef::get (asi->getElementType (), *asi->getFunction ());
490
491
}
491
492
492
- SILValue StackAllocationPromoter::getLiveInValue (BlockSet &phiBlocks,
493
+ SILValue StackAllocationPromoter::getLiveInValue (BlockSetVector &phiBlocks,
493
494
SILBasicBlock *block) {
494
495
// First, check if there is a Phi value in the current block. We know that
495
496
// our loads happen before stores, so we need to first check for Phi nodes
@@ -512,7 +513,7 @@ SILValue StackAllocationPromoter::getLiveInValue(BlockSet &phiBlocks,
512
513
return getLiveOutValue (phiBlocks, iDom->getBlock ());
513
514
}
514
515
515
- void StackAllocationPromoter::fixPhiPredBlock (BlockSet &phiBlocks,
516
+ void StackAllocationPromoter::fixPhiPredBlock (BlockSetVector &phiBlocks,
516
517
SILBasicBlock *destBlock,
517
518
SILBasicBlock *predBlock) {
518
519
TermInst *ti = predBlock->getTerminator ();
@@ -526,7 +527,7 @@ void StackAllocationPromoter::fixPhiPredBlock(BlockSet &phiBlocks,
526
527
deleter.forceDelete (ti);
527
528
}
528
529
529
- void StackAllocationPromoter::fixBranchesAndUses (BlockSet &phiBlocks) {
530
+ void StackAllocationPromoter::fixBranchesAndUses (BlockSetVector &phiBlocks) {
530
531
// First update uses of the value.
531
532
SmallVector<LoadInst *, 4 > collectedLoads;
532
533
@@ -609,7 +610,7 @@ void StackAllocationPromoter::fixBranchesAndUses(BlockSet &phiBlocks) {
609
610
610
611
void StackAllocationPromoter::pruneAllocStackUsage () {
611
612
LLVM_DEBUG (llvm::dbgs () << " *** Pruning : " << *asi);
612
- BlockSet functionBlocks (asi->getFunction ());
613
+ BlockSetVector functionBlocks (asi->getFunction ());
613
614
614
615
// Insert all of the blocks that asi is live in.
615
616
for (auto *use : asi->getUses ())
@@ -630,7 +631,7 @@ void StackAllocationPromoter::promoteAllocationToPhi() {
630
631
LLVM_DEBUG (llvm::dbgs () << " *** Placing Phis for : " << *asi);
631
632
632
633
// A list of blocks that will require new Phi values.
633
- BlockSet phiBlocks (asi->getFunction ());
634
+ BlockSetVector phiBlocks (asi->getFunction ());
634
635
635
636
// The "piggy-bank" data-structure that we use for processing the dom-tree
636
637
// bottom-up.
0 commit comments