Skip to content

Commit b33a14b

Browse files
committed
[NFC] Switched to StackList.
No need for a worklist of any sort, a simple list suffices.
1 parent 5e13af4 commit b33a14b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/SILOptimizer/Transforms/CopyPropagation.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -419,15 +419,15 @@ void CopyPropagation::run() {
419419
InstructionDeleter deleter(std::move(callbacks));
420420
bool changed = false;
421421

422-
GraphNodeWorklist<BeginBorrowInst *, 16> beginBorrowsToShrink;
422+
StackList<BeginBorrowInst *> beginBorrowsToShrink(f);
423423

424424
// Driver: Find all copied or borrowed defs.
425425
for (auto &bb : *f) {
426426
for (auto &i : bb) {
427427
if (auto *copy = dyn_cast<CopyValueInst>(&i)) {
428428
defWorklist.updateForCopy(copy);
429429
} else if (auto *borrow = dyn_cast<BeginBorrowInst>(&i)) {
430-
beginBorrowsToShrink.insert(borrow);
430+
beginBorrowsToShrink.push_back(borrow);
431431
} else if (canonicalizeAll) {
432432
if (auto *destroy = dyn_cast<DestroyValueInst>(&i)) {
433433
defWorklist.updateForCopy(destroy->getOperand());
@@ -446,7 +446,7 @@ void CopyPropagation::run() {
446446
// NOTE: We assume that the function is in reverse post order so visiting the
447447
// blocks and pushing begin_borrows as we see them and then popping them
448448
// off the end will result in shrinking inner borrow scopes first.
449-
while (auto *bbi = beginBorrowsToShrink.pop()) {
449+
for (auto *bbi : beginBorrowsToShrink) {
450450
bool firstRun = true;
451451
// Run the sequence of utilities:
452452
// - ShrinkBorrowScope

0 commit comments

Comments
 (0)