Skip to content

Commit 24a871b

Browse files
committed
Rename misleading using BlockSet to BlockSetVector
1 parent 200c51c commit 24a871b

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
@@ -226,7 +226,7 @@ namespace {
226226

227227
/// Promotes a single AllocStackInst into registers..
228228
class StackAllocationPromoter {
229-
using BlockSet = BasicBlockSetVector;
229+
using BlockSetVector = BasicBlockSetVector;
230230
using BlockToInstMap = llvm::DenseMap<SILBasicBlock *, SILInstruction *>;
231231

232232
// Use a priority queue keyed on dominator tree level so that inserted nodes
@@ -286,26 +286,27 @@ class StackAllocationPromoter {
286286
void promoteAllocationToPhi();
287287

288288
/// Replace the dummy nodes with new block arguments.
289-
void addBlockArguments(BlockSet &phiBlocks);
289+
void addBlockArguments(BlockSetVector &phiBlocks);
290290

291291
/// Fix all of the branch instructions and the uses to use
292292
/// the AllocStack definitions (which include stores and Phis).
293-
void fixBranchesAndUses(BlockSet &blocks);
293+
void fixBranchesAndUses(BlockSetVector &blocks);
294294

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

302302
/// Get the value for this AllocStack variable that is
303303
/// flowing out of StartBB.
304-
SILValue getLiveOutValue(BlockSet &phiBlocks, SILBasicBlock *startBlock);
304+
SILValue getLiveOutValue(BlockSetVector &phiBlocks,
305+
SILBasicBlock *startBlock);
305306

306307
/// Get the value for this AllocStack variable that is
307308
/// flowing into BB.
308-
SILValue getLiveInValue(BlockSet &phiBlocks, SILBasicBlock *block);
309+
SILValue getLiveInValue(BlockSetVector &phiBlocks, SILBasicBlock *block);
309310

310311
/// Prune AllocStacks usage in the function. Scan the function
311312
/// and remove in-block usage of the AllocStack. Leave only the first
@@ -445,14 +446,14 @@ StoreInst *StackAllocationPromoter::promoteAllocationInBlock(
445446
return lastStore;
446447
}
447448

448-
void StackAllocationPromoter::addBlockArguments(BlockSet &phiBlocks) {
449+
void StackAllocationPromoter::addBlockArguments(BlockSetVector &phiBlocks) {
449450
LLVM_DEBUG(llvm::dbgs() << "*** Adding new block arguments.\n");
450451

451452
for (auto *block : phiBlocks)
452453
block->createPhiArgument(asi->getElementType(), OwnershipKind::Owned);
453454
}
454455

455-
SILValue StackAllocationPromoter::getLiveOutValue(BlockSet &phiBlocks,
456+
SILValue StackAllocationPromoter::getLiveOutValue(BlockSetVector &phiBlocks,
456457
SILBasicBlock *startBlock) {
457458
LLVM_DEBUG(llvm::dbgs() << "*** Searching for a value definition.\n");
458459
// Walk the Dom tree in search of a defining value:
@@ -484,7 +485,7 @@ SILValue StackAllocationPromoter::getLiveOutValue(BlockSet &phiBlocks,
484485
return SILUndef::get(asi->getElementType(), *asi->getFunction());
485486
}
486487

487-
SILValue StackAllocationPromoter::getLiveInValue(BlockSet &phiBlocks,
488+
SILValue StackAllocationPromoter::getLiveInValue(BlockSetVector &phiBlocks,
488489
SILBasicBlock *block) {
489490
// First, check if there is a Phi value in the current block. We know that
490491
// our loads happen before stores, so we need to first check for Phi nodes
@@ -507,7 +508,7 @@ SILValue StackAllocationPromoter::getLiveInValue(BlockSet &phiBlocks,
507508
return getLiveOutValue(phiBlocks, iDom->getBlock());
508509
}
509510

510-
void StackAllocationPromoter::fixPhiPredBlock(BlockSet &phiBlocks,
511+
void StackAllocationPromoter::fixPhiPredBlock(BlockSetVector &phiBlocks,
511512
SILBasicBlock *destBlock,
512513
SILBasicBlock *predBlock) {
513514
TermInst *ti = predBlock->getTerminator();
@@ -521,7 +522,7 @@ void StackAllocationPromoter::fixPhiPredBlock(BlockSet &phiBlocks,
521522
ti->eraseFromParent();
522523
}
523524

524-
void StackAllocationPromoter::fixBranchesAndUses(BlockSet &phiBlocks) {
525+
void StackAllocationPromoter::fixBranchesAndUses(BlockSetVector &phiBlocks) {
525526
// First update uses of the value.
526527
SmallVector<LoadInst *, 4> collectedLoads;
527528

@@ -604,7 +605,7 @@ void StackAllocationPromoter::fixBranchesAndUses(BlockSet &phiBlocks) {
604605

605606
void StackAllocationPromoter::pruneAllocStackUsage() {
606607
LLVM_DEBUG(llvm::dbgs() << "*** Pruning : " << *asi);
607-
BlockSet functionBlocks(asi->getFunction());
608+
BlockSetVector functionBlocks(asi->getFunction());
608609

609610
// Insert all of the blocks that asi is live in.
610611
for (auto *use : asi->getUses())
@@ -625,7 +626,7 @@ void StackAllocationPromoter::promoteAllocationToPhi() {
625626
LLVM_DEBUG(llvm::dbgs() << "*** Placing Phis for : " << *asi);
626627

627628
// A list of blocks that will require new Phi values.
628-
BlockSet phiBlocks(asi->getFunction());
629+
BlockSetVector phiBlocks(asi->getFunction());
629630

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

0 commit comments

Comments
 (0)