Skip to content

Commit a5458ac

Browse files
authored
Merge pull request swiftlang#21607 from gottesmm/pr-93a87b0bbeffbd8b1ff7b960dc07b6951293e534
2 parents c932f60 + b70f6f8 commit a5458ac

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

lib/SILOptimizer/Mandatory/PMOMemoryUseCollector.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,12 @@ bool ElementUseCollector::collectFrom() {
260260
return false;
261261

262262
// Collect information about the retain count result as well.
263-
for (auto UI : TheMemory.MemoryInst->getUses()) {
264-
auto *User = UI->getUser();
263+
for (auto *op : TheMemory.MemoryInst->getUses()) {
264+
auto *user = op->getUser();
265265

266-
// If this is a release or dealloc_stack, then remember it as such.
267-
if (isa<StrongReleaseInst>(User) || isa<DeallocStackInst>(User) ||
268-
isa<DeallocBoxInst>(User)) {
269-
Releases.push_back(User);
266+
// If this is a strong_release, stash it.
267+
if (isa<StrongReleaseInst>(user)) {
268+
Releases.push_back(user);
270269
}
271270
}
272271

lib/SILOptimizer/Mandatory/PredictableMemOpt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ bool AllocOptimize::tryToRemoveDeadAllocation() {
12821282
if (!MemoryType.isTrivial(Module)) {
12831283
for (auto P : llvm::enumerate(Releases)) {
12841284
auto *R = P.value();
1285-
if (R == nullptr || isa<DeallocStackInst>(R) || isa<DeallocBoxInst>(R))
1285+
if (R == nullptr)
12861286
continue;
12871287

12881288
// We stash all of the destroy_addr that we see.

0 commit comments

Comments
 (0)