[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

@@ -392,35 +392,6 @@ private:
/// Match a call to a trap BB with no ARC relevant side effects.
bool isARCInertTrapBB(const SILBasicBlock *BB);
/// Get the two result values of the builtin "unsafeGuaranteed" instruction.
///
/// Gets the (GuaranteedValue, Token) tuple from a call to "unsafeGuaranteed"
/// if the tuple elements are identified by a single tuple_extract use.
/// Otherwise, returns a (nullptr, nullptr) tuple.
std::pair<SingleValueInstruction *, SingleValueInstruction *>
getSingleUnsafeGuaranteedValueResult(BuiltinInst *UnsafeGuaranteedInst);
/// Get the single builtin "unsafeGuaranteedEnd" user of a builtin
/// "unsafeGuaranteed"'s token.
BuiltinInst *getUnsafeGuaranteedEndUser(SILValue UnsafeGuaranteedToken);
/// Walk forwards from an unsafeGuaranteedEnd builtin instruction looking for a
/// release on the reference returned by the matching unsafeGuaranteed builtin
/// ignoring releases on the way.
/// Return nullptr if no release is found.
///
/// %4 = builtin "unsafeGuaranteed"<Foo>(%0 : $Foo) : $(Foo, Builtin.Int8)
/// %5 = tuple_extract %4 : $(Foo, Builtin.Int8), 0
/// %6 = tuple_extract %4 : $(Foo, Builtin.Int8), 1
/// %12 = builtin "unsafeGuaranteedEnd"(%6 : $Builtin.Int8) : $()
/// strong_release %5 : $Foo // <-- Matching release.
///
/// Alternatively, look for the release before the unsafeGuaranteedEnd.
SILInstruction *findReleaseToMatchUnsafeGuaranteedValue(
SILInstruction *UnsafeGuaranteedEndI, SILInstruction *UnsafeGuaranteedI,
SILValue UnsafeGuaranteedValue, SILBasicBlock &BB,
RCIdentityFunctionInfo &RCFI);
} // end namespace swift
#endif

View File

@@ -410,8 +410,6 @@ PASS(StringOptimization, "string-optimization",
"Optimization for String operations")
PASS(SwiftArrayPropertyOpt, "array-property-opt",
"Loop Specialization for Array Properties")
PASS(UnsafeGuaranteedPeephole, "unsafe-guaranteed-peephole",
"SIL retain/release Peephole Removal for Builtin.unsafeGuaranteed")
PASS(UsePrespecialized, "use-prespecialized",
"Use Pre-Specialized Functions")
PASS(OwnershipDumper, "ownership-dumper",