[builtin] Remove "unsafeGuaranteed" and related code since Unmanaged now has an Ownership SSA based implementation that works completely in SILGen.

This isn't used in the stdlib anymore as well.
This commit is contained in:
Michael Gottesman
2022-08-19 14:38:20 -07:00
parent 64cfb11e5d
commit 3e52007562
22 changed files with 2 additions and 1237 deletions

View File

@@ -372,17 +372,6 @@ static bool tryToSpeculateTarget(FullApplySite AI, ClassHierarchyAnalysis *CHA,
OptRemark::Emitter &ORE) {
ClassMethodInst *CMI = cast<ClassMethodInst>(AI.getCallee());
// Don't devirtualize withUnsafeGuaranteed 'self' as this would prevent
// retain/release removal.
// unmanged._withUnsafeGuaranteedRef { $0.method() }
if (auto *TupleExtract = dyn_cast<TupleExtractInst>(CMI->getOperand()))
if (auto *UnsafeGuaranteedSelf =
dyn_cast<BuiltinInst>(TupleExtract->getOperand()))
if (UnsafeGuaranteedSelf->getBuiltinKind() ==
BuiltinValueKind::UnsafeGuaranteed &&
TupleExtract->getFieldIndex() == 0)
return false;
// Strip any upcasts off of our 'self' value, potentially leaving us
// with a value whose type is closer (in the class hierarchy) to the
// actual dynamic type.