Revert "Merge pull request #69807 from apple/revert-69450-uninarrayfix"

This reverts commit cabb5e109f, reversing
changes made to 09688abb02.
This commit is contained in:
Meghana Gupta
2023-11-29 12:26:38 -08:00
parent d4b1172537
commit 86b651330b
27 changed files with 375 additions and 230 deletions

View File

@@ -616,6 +616,13 @@ recursivelyCollectInteriorUses(ValueBase *DefInst,
AllUsers.insert(User);
continue;
}
if (auto *MDI = dyn_cast<MarkDependenceInst>(User)) {
if (!recursivelyCollectInteriorUses(MDI, AddressNode,
IsInteriorAddress)) {
return false;
}
continue;
}
if (auto PTAI = dyn_cast<PointerToAddressInst>(User)) {
// Only one pointer-to-address is allowed for safety.
if (SeenPtrToAddr)
@@ -1163,11 +1170,17 @@ bool DeadObjectElimination::processAllocApply(ApplyInst *AI,
LLVM_DEBUG(llvm::dbgs() << " Success! Eliminating apply allocate(...).\n");
auto *ARI = dyn_cast<AllocRefInst>(AI->getArgument(0));
deleter.forceDeleteWithUsers(AI);
for (auto *toDelete : instsDeadAfterInitializerRemoved) {
deleter.trackIfDead(toDelete);
}
if (ARI) {
deleter.forceDeleteWithUsers(ARI);
}
++DeadAllocApplyEliminated;
return true;
}