Intoduce unchecked_ownership instruction in raw SIL

This instruction can be used to disable ownership verification on it's result and
will be allowed only in raw SIL.

Sometimes SILGen can produce invalid ownership SSA, that cannot be resolved until
mandatory passes run. We have a few ways to piecewise disable verification.
With unchecked_ownership instruction we can provide a uniform way to disable ownership
verification for a value.
This commit is contained in:
Meghana Gupta
2025-10-16 12:18:27 -07:00
parent a3aed17d63
commit 1dc5c9611c
17 changed files with 66 additions and 2 deletions

View File

@@ -1806,6 +1806,9 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
writeOneOperandExtraAttributeLayout(SI.getKind(), Attr, SI.getOperand(0));
break;
}
case SILInstructionKind::UncheckedOwnershipInst: {
llvm_unreachable("Invalid unchecked_ownership during serialzation");
}
case SILInstructionKind::YieldInst: {
auto YI = cast<YieldInst>(&SI);
SmallVector<ValueID, 4> args;