Swift SIL: replace the set_deallocating instruction with begin_dealloc_ref

Codegen is the same, but `begin_dealloc_ref` consumes the operand and produces a new SSA value.
This cleanly splits the liferange to the region before and within the destructor of a class.
This commit is contained in:
Erik Eckstein
2023-09-06 18:39:18 +02:00
parent d457368014
commit e5eb15dcbe
52 changed files with 453 additions and 278 deletions

View File

@@ -776,6 +776,7 @@ LLVM_ATTRIBUTE_USED void AccessBase::dump() const { print(llvm::dbgs()); }
bool swift::isIdentityPreservingRefCast(SingleValueInstruction *svi) {
// Ignore both copies and other identity and ownership preserving casts
return isa<CopyValueInst>(svi) || isa<BeginBorrowInst>(svi)
|| isa<BeginDeallocRefInst>(svi)
|| isIdentityAndOwnershipPreservingRefCast(svi);
}