Skip to content

Commit 9c84631

Browse files
committed
Rename misleading using BlockSet to BlockSetVector
1 parent 910d918 commit 9c84631

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ namespace {
228228

229229
/// Promotes a single AllocStackInst into registers..
230230
class StackAllocationPromoter {
231-
using BlockSet = BasicBlockSetVector;
231+
using BlockSetVector = BasicBlockSetVector;
232232
using BlockToInstMap = llvm::DenseMap<SILBasicBlock *, SILInstruction *>;
233233

234234
// Use a priority queue keyed on dominator tree level so that inserted nodes
@@ -291,26 +291,27 @@ class StackAllocationPromoter {
291291
void promoteAllocationToPhi();
292292

293293
/// Replace the dummy nodes with new block arguments.
294-
void addBlockArguments(BlockSet &phiBlocks);
294+
void addBlockArguments(BlockSetVector &phiBlocks);
295295

296296
/// Fix all of the branch instructions and the uses to use
297297
/// the AllocStack definitions (which include stores and Phis).
298-
void fixBranchesAndUses(BlockSet &blocks);
298+
void fixBranchesAndUses(BlockSetVector &blocks);
299299

300300
/// update the branch instructions with the new Phi argument.
301301
/// The blocks in \p PhiBlocks are blocks that define a value, \p Dest is
302302
/// the branch destination, and \p Pred is the predecessors who's branch we
303303
/// modify.
304-
void fixPhiPredBlock(BlockSet &phiBlocks, SILBasicBlock *dest,
304+
void fixPhiPredBlock(BlockSetVector &phiBlocks, SILBasicBlock *dest,
305305
SILBasicBlock *pred);
306306

307307
/// Get the value for this AllocStack variable that is
308308
/// flowing out of StartBB.
309-
SILValue getLiveOutValue(BlockSet &phiBlocks, SILBasicBlock *startBlock);
309+
SILValue getLiveOutValue(BlockSetVector &phiBlocks,
310+
SILBasicBlock *startBlock);
310311

311312
/// Get the value for this AllocStack variable that is
312313
/// flowing into BB.
313-
SILValue getLiveInValue(BlockSet &phiBlocks, SILBasicBlock *block);
314+
SILValue getLiveInValue(BlockSetVector &phiBlocks, SILBasicBlock *block);
314315

315316
/// Prune AllocStacks usage in the function. Scan the function
316317
/// and remove in-block usage of the AllocStack. Leave only the first
@@ -450,14 +451,14 @@ StoreInst *StackAllocationPromoter::promoteAllocationInBlock(
450451
return lastStore;
451452
}
452453

453-
void StackAllocationPromoter::addBlockArguments(BlockSet &phiBlocks) {
454+
void StackAllocationPromoter::addBlockArguments(BlockSetVector &phiBlocks) {
454455
LLVM_DEBUG(llvm::dbgs() << "*** Adding new block arguments.\n");
455456

456457
for (auto *block : phiBlocks)
457458
block->createPhiArgument(asi->getElementType(), OwnershipKind::Owned);
458459
}
459460

460-
SILValue StackAllocationPromoter::getLiveOutValue(BlockSet &phiBlocks,
461+
SILValue StackAllocationPromoter::getLiveOutValue(BlockSetVector &phiBlocks,
461462
SILBasicBlock *startBlock) {
462463
LLVM_DEBUG(llvm::dbgs() << "*** Searching for a value definition.\n");
463464
// Walk the Dom tree in search of a defining value:
@@ -489,7 +490,7 @@ SILValue StackAllocationPromoter::getLiveOutValue(BlockSet &phiBlocks,
489490
return SILUndef::get(asi->getElementType(), *asi->getFunction());
490491
}
491492

492-
SILValue StackAllocationPromoter::getLiveInValue(BlockSet &phiBlocks,
493+
SILValue StackAllocationPromoter::getLiveInValue(BlockSetVector &phiBlocks,
493494
SILBasicBlock *block) {
494495
// First, check if there is a Phi value in the current block. We know that
495496
// our loads happen before stores, so we need to first check for Phi nodes
@@ -512,7 +513,7 @@ SILValue StackAllocationPromoter::getLiveInValue(BlockSet &phiBlocks,
512513
return getLiveOutValue(phiBlocks, iDom->getBlock());
513514
}
514515

515-
void StackAllocationPromoter::fixPhiPredBlock(BlockSet &phiBlocks,
516+
void StackAllocationPromoter::fixPhiPredBlock(BlockSetVector &phiBlocks,
516517
SILBasicBlock *destBlock,
517518
SILBasicBlock *predBlock) {
518519
TermInst *ti = predBlock->getTerminator();
@@ -526,7 +527,7 @@ void StackAllocationPromoter::fixPhiPredBlock(BlockSet &phiBlocks,
526527
deleter.forceDelete(ti);
527528
}
528529

529-
void StackAllocationPromoter::fixBranchesAndUses(BlockSet &phiBlocks) {
530+
void StackAllocationPromoter::fixBranchesAndUses(BlockSetVector &phiBlocks) {
530531
// First update uses of the value.
531532
SmallVector<LoadInst *, 4> collectedLoads;
532533

@@ -609,7 +610,7 @@ void StackAllocationPromoter::fixBranchesAndUses(BlockSet &phiBlocks) {
609610

610611
void StackAllocationPromoter::pruneAllocStackUsage() {
611612
LLVM_DEBUG(llvm::dbgs() << "*** Pruning : " << *asi);
612-
BlockSet functionBlocks(asi->getFunction());
613+
BlockSetVector functionBlocks(asi->getFunction());
613614

614615
// Insert all of the blocks that asi is live in.
615616
for (auto *use : asi->getUses())
@@ -630,7 +631,7 @@ void StackAllocationPromoter::promoteAllocationToPhi() {
630631
LLVM_DEBUG(llvm::dbgs() << "*** Placing Phis for : " << *asi);
631632

632633
// A list of blocks that will require new Phi values.
633-
BlockSet phiBlocks(asi->getFunction());
634+
BlockSetVector phiBlocks(asi->getFunction());
634635

635636
// The "piggy-bank" data-structure that we use for processing the dom-tree
636637
// bottom-up.

0 commit comments

Comments
 (0)