Skip to content

Commit 82de2b9

Browse files
authored
Merge pull request #21401 from gottesmm/ossa_flag
[ownership] Use the SILFunction attribute [ossa] instead of the global flag -assume-parsing-unqualified-ownership-sil
2 parents 4cf741e + 40a09c9 commit 82de2b9

File tree

423 files changed

+3751
-3744
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

423 files changed

+3751
-3744
lines changed

lib/ParseSIL/ParseSIL.cpp

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,7 @@ void SILParser::convertRequirements(SILFunction *F,
942942
static bool parseDeclSILOptional(bool *isTransparent,
943943
IsSerialized_t *isSerialized,
944944
bool *isCanonical,
945+
bool *hasOwnershipSSA,
945946
IsThunk_t *isThunk,
946947
IsDynamicallyReplaceable_t *isDynamic,
947948
SILFunction **dynamicallyReplacedFunction,
@@ -976,6 +977,8 @@ static bool parseDeclSILOptional(bool *isTransparent,
976977
*isSerialized = IsSerializable;
977978
else if (isCanonical && SP.P.Tok.getText() == "canonical")
978979
*isCanonical = true;
980+
else if (hasOwnershipSSA && SP.P.Tok.getText() == "ossa")
981+
*hasOwnershipSSA = true;
979982
else if (isThunk && SP.P.Tok.getText() == "thunk")
980983
*isThunk = IsThunk;
981984
else if (isThunk && SP.P.Tok.getText() == "signature_optimized_thunk")
@@ -5148,9 +5151,7 @@ bool SILParser::parseSILBasicBlock(SILBuilder &B) {
51485151

51495152
// If SILOwnership is enabled and we are not assuming that we are
51505153
// parsing unqualified SIL, look for printed value ownership kinds.
5151-
if (!F->getModule()
5152-
.getOptions()
5153-
.AssumeUnqualifiedOwnershipWhenParsing &&
5154+
if (F->hasOwnership() &&
51545155
parseSILOwnership(OwnershipKind))
51555156
return true;
51565157

@@ -5193,7 +5194,7 @@ bool SILParser::parseSILBasicBlock(SILBuilder &B) {
51935194
// Qualification. For more details, see the comment on the
51945195
// FunctionOwnershipEvaluator class.
51955196
SILInstruction *ParsedInst = &*BB->rbegin();
5196-
if (!AssumeUnqualifiedOwnershipWhenParsing &&
5197+
if (BB->getParent()->hasOwnership() &&
51975198
!OwnershipEvaluator.evaluate(ParsedInst)) {
51985199
P.diagnose(ParsedInst->getLoc().getSourceLoc(),
51995200
diag::found_unqualified_instruction_in_qualified_function,
@@ -5228,6 +5229,7 @@ bool SILParserTUState::parseDeclSIL(Parser &P) {
52285229
IsSerialized_t isSerialized = IsNotSerialized;
52295230
bool isCanonical = false;
52305231
IsDynamicallyReplaceable_t isDynamic = IsNotDynamic;
5232+
bool hasOwnershipSSA = false;
52315233
IsThunk_t isThunk = IsNotThunk;
52325234
bool isGlobalInit = false, isWeakLinked = false;
52335235
bool isWithoutActuallyEscapingThunk = false;
@@ -5240,12 +5242,12 @@ bool SILParserTUState::parseDeclSIL(Parser &P) {
52405242
SILFunction *DynamicallyReplacedFunction = nullptr;
52415243
Identifier objCReplacementFor;
52425244
if (parseSILLinkage(FnLinkage, P) ||
5243-
parseDeclSILOptional(&isTransparent, &isSerialized, &isCanonical,
5244-
&isThunk, &isDynamic, &DynamicallyReplacedFunction,
5245-
&objCReplacementFor, &isGlobalInit, &inlineStrategy,
5246-
&optimizationMode, nullptr, &isWeakLinked,
5247-
&isWithoutActuallyEscapingThunk, &Semantics,
5248-
&SpecAttrs, &ClangDecl, &MRK, FunctionState, M) ||
5245+
parseDeclSILOptional(
5246+
&isTransparent, &isSerialized, &isCanonical, &hasOwnershipSSA,
5247+
&isThunk, &isDynamic, &DynamicallyReplacedFunction,
5248+
&objCReplacementFor, &isGlobalInit, &inlineStrategy, &optimizationMode, nullptr,
5249+
&isWeakLinked, &isWithoutActuallyEscapingThunk, &Semantics,
5250+
&SpecAttrs, &ClangDecl, &MRK, FunctionState, M) ||
52495251
P.parseToken(tok::at_sign, diag::expected_sil_function_name) ||
52505252
P.parseIdentifier(FnName, FnNameLoc, diag::expected_sil_function_name) ||
52515253
P.parseToken(tok::colon, diag::expected_sil_type))
@@ -5269,6 +5271,8 @@ bool SILParserTUState::parseDeclSIL(Parser &P) {
52695271
FunctionState.F->setTransparent(IsTransparent_t(isTransparent));
52705272
FunctionState.F->setSerialized(IsSerialized_t(isSerialized));
52715273
FunctionState.F->setWasDeserializedCanonical(isCanonical);
5274+
if (!hasOwnershipSSA)
5275+
FunctionState.F->setOwnershipEliminated();
52725276
FunctionState.F->setThunk(IsThunk_t(isThunk));
52735277
FunctionState.F->setIsDynamic(isDynamic);
52745278
FunctionState.F->setDynamicallyReplacedFunction(
@@ -5457,9 +5461,8 @@ bool SILParserTUState::parseSILGlobal(Parser &P) {
54575461
SILParser State(P);
54585462
if (parseSILLinkage(GlobalLinkage, P) ||
54595463
parseDeclSILOptional(nullptr, &isSerialized, nullptr, nullptr, nullptr,
5460-
nullptr, nullptr, nullptr, nullptr, nullptr, &isLet,
54615464
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
5462-
State, M) ||
5465+
&isLet, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, State, M) ||
54635466
P.parseToken(tok::at_sign, diag::expected_sil_value_name) ||
54645467
P.parseIdentifier(GlobalName, NameLoc, diag::expected_sil_value_name) ||
54655468
P.parseToken(tok::colon, diag::expected_sil_type))
@@ -5507,8 +5510,7 @@ bool SILParserTUState::parseSILProperty(Parser &P) {
55075510
IsSerialized_t Serialized = IsNotSerialized;
55085511
if (parseDeclSILOptional(nullptr, &Serialized, nullptr, nullptr, nullptr,
55095512
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
5510-
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
5511-
SP, M))
5513+
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, SP, M))
55125514
return true;
55135515

55145516
ValueDecl *VD;
@@ -5576,7 +5578,7 @@ bool SILParserTUState::parseSILVTable(Parser &P) {
55765578
IsSerialized_t Serialized = IsNotSerialized;
55775579
if (parseDeclSILOptional(nullptr, &Serialized, nullptr, nullptr, nullptr,
55785580
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
5579-
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
5581+
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
55805582
VTableState, M))
55815583
return true;
55825584

@@ -6112,7 +6114,7 @@ bool SILParserTUState::parseSILWitnessTable(Parser &P) {
61126114
IsSerialized_t isSerialized = IsNotSerialized;
61136115
if (parseDeclSILOptional(nullptr, &isSerialized, nullptr, nullptr, nullptr,
61146116
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
6115-
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
6117+
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
61166118
WitnessState, M))
61176119
return true;
61186120

lib/SIL/SILPrinter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2345,6 +2345,11 @@ void SILFunction::print(SILPrintContext &PrintCtx) const {
23452345
if (WasDeserializedCanonical && getModule().getStage() == SILStage::Raw)
23462346
OS << "[canonical] ";
23472347

2348+
// If this function is not an external declaration /and/ is in ownership ssa
2349+
// form, print [ossa].
2350+
if (!isExternalDeclaration() && hasOwnership())
2351+
OS << "[ossa] ";
2352+
23482353
printName(OS);
23492354
OS << " : $";
23502355

test/APINotes/versioned.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,14 @@ func testRenamedOptionyEnum() {
251251
#if !swift(>=5)
252252

253253
func useSwift4Name(_: ImportantCStruct) {}
254-
// CHECK-SILGEN-4: sil hidden @$s9versioned13useSwift4NameyySo11SomeCStructVF
254+
// CHECK-SILGEN-4: sil hidden [ossa] @$s9versioned13useSwift4NameyySo11SomeCStructVF
255255

256256
func useNewlyNested(_: InnerInSwift5) {}
257-
// CHECK-SILGEN-4: sil hidden @$s9versioned14useNewlyNestedyySo13InnerInSwift5VF
257+
// CHECK-SILGEN-4: sil hidden [ossa] @$s9versioned14useNewlyNestedyySo13InnerInSwift5VF
258258
#endif
259259

260260
func useSwift5Name(_: VeryImportantCStruct) {}
261-
// CHECK-SILGEN: sil hidden @$s9versioned13useSwift5NameyySo11SomeCStructVF
261+
// CHECK-SILGEN: sil hidden [ossa] @$s9versioned13useSwift5NameyySo11SomeCStructVF
262262

263263

264264

test/ClangImporter/nullability_silgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import nullability
99
import Foundation
1010

1111
// null_resettable properties.
12-
// CHECK-LABEL: sil hidden @$s18nullability_silgen18testNullResettable{{[_0-9a-zA-Z]*}}F
12+
// CHECK-LABEL: sil hidden [ossa] @$s18nullability_silgen18testNullResettable{{[_0-9a-zA-Z]*}}F
1313
func testNullResettable(_ sc: SomeClass) {
1414
sc.defaultedProperty = nil
1515
sc.defaultedProperty = "hello"

test/ClangImporter/optional.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class A {
1212
@objc func foo() -> String? {
1313
return ""
1414
}
15-
// CHECK-LABEL: sil hidden [thunk] @$s8optional1AC3fooSSSgyFTo : $@convention(objc_method) (A) -> @autoreleased Optional<NSString>
15+
// CHECK-LABEL: sil hidden [thunk] [ossa] @$s8optional1AC3fooSSSgyFTo : $@convention(objc_method) (A) -> @autoreleased Optional<NSString>
1616
// CHECK: bb0([[SELF:%.*]] : @unowned $A):
1717
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]]
1818
// CHECK: [[BORROWED_SELF_COPY:%.*]] = begin_borrow [[SELF_COPY]]
@@ -41,7 +41,7 @@ class A {
4141
// CHECK-NEXT: return [[T0]]
4242

4343
@objc func bar(x x : String?) {}
44-
// CHECK-LABEL: sil hidden [thunk] @$s8optional1AC3bar1xySSSg_tFTo : $@convention(objc_method) (Optional<NSString>, A) -> ()
44+
// CHECK-LABEL: sil hidden [thunk] [ossa] @$s8optional1AC3bar1xySSSg_tFTo : $@convention(objc_method) (Optional<NSString>, A) -> ()
4545
// CHECK: bb0([[ARG:%.*]] : @unowned $Optional<NSString>, [[SELF:%.*]] : @unowned $A):
4646
// CHECK: [[ARG_COPY:%.*]] = copy_value [[ARG]]
4747
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]]

test/Constraints/ranking.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func genericOverload<T>(_: T?) {}
3030
func genericOptional<T>(_: T?) {}
3131
func genericNoOptional<T>(_: T) {}
3232

33-
// CHECK-LABEL: sil hidden @$s7ranking22propertyVersusFunctionyyAA1P_p_xtAaCRzlF
33+
// CHECK-LABEL: sil hidden [ossa] @$s7ranking22propertyVersusFunctionyyAA1P_p_xtAaCRzlF
3434
func propertyVersusFunction<T : P>(_ p: P, _ t: T) {
3535
// CHECK: witness_method $@opened("{{.*}}") P, #P.p!getter.1
3636
let _ = p.p
@@ -149,7 +149,7 @@ func f1(_ a: A) -> A { return a }
149149
func f1(_ b: B) -> B { return b }
150150

151151
func testDerived(b: B) {
152-
// CHECK-LABEL: sil hidden @$s7ranking11testDerived1byAA1BC_tF
152+
// CHECK-LABEL: sil hidden [ossa] @$s7ranking11testDerived1byAA1BC_tF
153153
// CHECK: function_ref @$s7ranking2f1yAA1BCADF
154154
// CHECK: function_ref @$s7ranking2f0yyxlF
155155
f0(f1(b))
@@ -191,47 +191,47 @@ extension GenericClass {
191191

192192
// Make sure we favour the class implementation over the protocol requirement.
193193

194-
// CHECK-LABEL: sil hidden @$s7ranking32testGenericPropertyProtocolClassyyxAA1YCRbzAA1XRzlF
194+
// CHECK-LABEL: sil hidden [ossa] @$s7ranking32testGenericPropertyProtocolClassyyxAA1YCRbzAA1XRzlF
195195
func testGenericPropertyProtocolClass<T : X & Y>(_ t: T) {
196196
_ = t.foo // CHECK: class_method {{%.*}} : $Y, #Y.foo!getter.1
197197
_ = t.bar // CHECK: function_ref @$s7ranking1YC3barSivg
198198
_ = t.baz() // CHECK: class_method {{%.*}} : $Y, #Y.baz
199199
_ = t[""] // CHECK: class_method {{%.*}} : $Y, #Y.subscript!getter.1
200200
}
201201

202-
// CHECK-LABEL: sil hidden @$s7ranking36testExistentialPropertyProtocolClassyyAA1X_AA1YCXcF
202+
// CHECK-LABEL: sil hidden [ossa] @$s7ranking36testExistentialPropertyProtocolClassyyAA1X_AA1YCXcF
203203
func testExistentialPropertyProtocolClass(_ t: X & Y) {
204204
_ = t.foo // CHECK: class_method {{%.*}} : $Y, #Y.foo!getter.1
205205
_ = t.bar // CHECK: function_ref @$s7ranking1YC3barSivg
206206
_ = t.baz() // CHECK: class_method {{%.*}} : $Y, #Y.baz
207207
_ = t[""] // CHECK: class_method {{%.*}} : $Y, #Y.subscript!getter.1
208208
}
209209

210-
// CHECK-LABEL: sil hidden @$s7ranking46testGenericPropertySubclassConstrainedProtocolyyxAA1ZRzlF
210+
// CHECK-LABEL: sil hidden [ossa] @$s7ranking46testGenericPropertySubclassConstrainedProtocolyyxAA1ZRzlF
211211
func testGenericPropertySubclassConstrainedProtocol<T : Z>(_ t: T) {
212212
_ = t.foo // CHECK: class_method {{%.*}} : $Y, #Y.foo!getter.1
213213
_ = t.bar // CHECK: function_ref @$s7ranking1YC3barSivg
214214
_ = t.baz() // CHECK: class_method {{%.*}} : $Y, #Y.baz
215215
_ = t[""] // CHECK: class_method {{%.*}} : $Y, #Y.subscript!getter.1
216216
}
217217

218-
// CHECK-LABEL: sil hidden @$s7ranking50testExistentialPropertySubclassConstrainedProtocolyyAA1Z_pF
218+
// CHECK-LABEL: sil hidden [ossa] @$s7ranking50testExistentialPropertySubclassConstrainedProtocolyyAA1Z_pF
219219
func testExistentialPropertySubclassConstrainedProtocol(_ t: Z) {
220220
_ = t.foo // CHECK: class_method {{%.*}} : $Y, #Y.foo!getter.1
221221
_ = t.bar // CHECK: function_ref @$s7ranking1YC3barSivg
222222
_ = t.baz() // CHECK: class_method {{%.*}} : $Y, #Y.baz
223223
_ = t[""] // CHECK: class_method {{%.*}} : $Y, #Y.subscript!getter.1
224224
}
225225

226-
// CHECK-LABEL: sil hidden @$s7ranking43testExistentialPropertyProtocolGenericClassyyAA1X_AA0fG0CySiGXcF
226+
// CHECK-LABEL: sil hidden [ossa] @$s7ranking43testExistentialPropertyProtocolGenericClassyyAA1X_AA0fG0CySiGXcF
227227
func testExistentialPropertyProtocolGenericClass(_ t: GenericClass<Int> & X) {
228228
_ = t.foo // CHECK: class_method {{%.*}} : $GenericClass<Int>, #GenericClass.foo!getter.1
229229
_ = t.bar // CHECK: function_ref @$s7ranking12GenericClassC3barxvg
230230
_ = t.baz() // CHECK: class_method {{%.*}} : $GenericClass<Int>, #GenericClass.baz
231231
_ = t[""] // CHECK: function_ref @$s7ranking12GenericClassCySiSScig
232232
}
233233

234-
// CHECK-LABEL: sil hidden @$s7ranking43testExistentialPropertyProtocolGenericClassyyAA1X_AA0fG0CySSGXcF
234+
// CHECK-LABEL: sil hidden [ossa] @$s7ranking43testExistentialPropertyProtocolGenericClassyyAA1X_AA0fG0CySSGXcF
235235
func testExistentialPropertyProtocolGenericClass(_ t: GenericClass<String> & X) {
236236
_ = t.foo // CHECK: class_method {{%.*}} : $GenericClass<String>, #GenericClass.foo!getter.1
237237
_ = t.bar // CHECK: function_ref @$s7ranking12GenericClassC3barxvg
@@ -240,7 +240,7 @@ func testExistentialPropertyProtocolGenericClass(_ t: GenericClass<String> & X)
240240
}
241241

242242
extension X where Self : Y {
243-
// CHECK-LABEL: sil hidden @$s7ranking1XPA2A1YCRbzrlE32testGenericPropertyProtocolClassyyxF
243+
// CHECK-LABEL: sil hidden [ossa] @$s7ranking1XPA2A1YCRbzrlE32testGenericPropertyProtocolClassyyxF
244244
func testGenericPropertyProtocolClass(_ x: Self) {
245245
_ = self.foo // CHECK: class_method {{%.*}} : $Y, #Y.foo!getter.1
246246
_ = self.bar // CHECK: function_ref @$s7ranking1YC3barSivg
@@ -250,7 +250,7 @@ extension X where Self : Y {
250250
}
251251

252252
extension X where Self : GenericClass<Int> {
253-
// CHECK-LABEL: sil hidden @$s7ranking1XPA2A12GenericClassCySiGRbzrlE04testb16PropertyProtocolbC0yyxF
253+
// CHECK-LABEL: sil hidden [ossa] @$s7ranking1XPA2A12GenericClassCySiGRbzrlE04testb16PropertyProtocolbC0yyxF
254254
func testGenericPropertyProtocolGenericClass(_ x: Self) {
255255
_ = self.foo // CHECK: class_method {{%.*}} : $GenericClass<Int>, #GenericClass.foo!getter.1
256256
_ = self.bar // CHECK: function_ref @$s7ranking12GenericClassC3barxvg
@@ -260,7 +260,7 @@ extension X where Self : GenericClass<Int> {
260260
}
261261

262262
extension X where Self : GenericClass<String> {
263-
// CHECK-LABEL: sil hidden @$s7ranking1XPA2A12GenericClassCySSGRbzrlE04testb16PropertyProtocolbC0yyxF
263+
// CHECK-LABEL: sil hidden [ossa] @$s7ranking1XPA2A12GenericClassCySSGRbzrlE04testb16PropertyProtocolbC0yyxF
264264
func testGenericPropertyProtocolGenericClass(_ x: Self) {
265265
_ = self.foo // CHECK: class_method {{%.*}} : $GenericClass<String>, #GenericClass.foo!getter.1
266266
_ = self.bar // CHECK: function_ref @$s7ranking12GenericClassC3barxvg
@@ -274,15 +274,15 @@ extension X where Self : GenericClass<String> {
274274
//--------------------------------------------------------------------
275275

276276
struct UnsafePointerStruct {
277-
// CHECK-LABEL: sil hidden @$s7ranking19UnsafePointerStructVyACSPyxGSgclufC : $@convention(method) <U> (Optional<UnsafePointer<U>>, @thin UnsafePointerStruct.Type) -> UnsafePointerStruct
277+
// CHECK-LABEL: sil hidden [ossa] @$s7ranking19UnsafePointerStructVyACSPyxGSgclufC : $@convention(method) <U> (Optional<UnsafePointer<U>>, @thin UnsafePointerStruct.Type) -> UnsafePointerStruct
278278
init<U>(_ from: UnsafePointer<U>) {}
279279
init<U>(_ from: UnsafePointer<U>?) {
280280
// CHECK: function_ref @$s7ranking19UnsafePointerStructVyACSPyxGclufC : $@convention(method) <τ_0_0> (UnsafePointer<τ_0_0>, @thin UnsafePointerStruct.Type) -> UnsafePointerStruct
281281
self.init(from!)
282282
}
283283
}
284284

285-
// CHECK-LABEL: sil hidden @$s7ranking22useUnsafePointerStructyySPyxGlF : $@convention(thin) <U> (UnsafePointer<U>) -> ()
285+
// CHECK-LABEL: sil hidden [ossa] @$s7ranking22useUnsafePointerStructyySPyxGlF : $@convention(thin) <U> (UnsafePointer<U>) -> ()
286286
func useUnsafePointerStruct<U>(_ ptr: UnsafePointer<U>) {
287287
// CHECK: function_ref @$s7ranking19UnsafePointerStructVyACSPyxGclufC : $@convention(method) <τ_0_0> (UnsafePointer<τ_0_0>, @thin UnsafePointerStruct.Type) -> UnsafePointerStruct
288288
let _: UnsafePointerStruct = UnsafePointerStruct(ptr)

test/DebugInfo/simple.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sil_stage canonical
55
import Builtin
66
import Swift
77

8-
sil @square : $@convention(thin) (Int32) -> Int32 {
8+
sil [ossa] @square : $@convention(thin) (Int32) -> Int32 {
99
bb0(%0 : $Int32):
1010
debug_value %0 : $Int32, let, name "x" // id: %1
1111
%3 = struct_extract %0 : $Int32, #Int32._value // user: %6

test/IRGen/archetype_resilience.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public enum EnumWithClassArchetypeAndDynamicSize<T : AnyObject> {
1919
// CHECK-LABEL: define swiftcc void @copyDynamicMultiEnum(%swift.type* %"EnumWithClassArchetypeAndDynamicSize<T>", %swift.type* %U, %T20archetype_resilience36EnumWithClassArchetypeAndDynamicSizeO* noalias nocapture swiftself)
2020
// CHECK: call %T20archetype_resilience36EnumWithClassArchetypeAndDynamicSizeO* @"$s20archetype_resilience36EnumWithClassArchetypeAndDynamicSizeOyxGRlzCr0_lWOc"(%T20archetype_resilience36EnumWithClassArchetypeAndDynamicSizeO* %0, %T20archetype_resilience36EnumWithClassArchetypeAndDynamicSizeO* {{.*}}, %swift.type* %"EnumWithClassArchetypeAndDynamicSize<T>")
2121
// CHECK: ret void
22-
sil @copyDynamicMultiEnum : $@convention(method) <T, U where T: AnyObject> (@in_guaranteed EnumWithClassArchetypeAndDynamicSize<T>) -> () {
22+
sil [ossa] @copyDynamicMultiEnum : $@convention(method) <T, U where T: AnyObject> (@in_guaranteed EnumWithClassArchetypeAndDynamicSize<T>) -> () {
2323
bb0(%0 : $*EnumWithClassArchetypeAndDynamicSize<T>):
2424
%1 = alloc_stack $EnumWithClassArchetypeAndDynamicSize<T>
2525
copy_addr %0 to [initialization] %1 : $*EnumWithClassArchetypeAndDynamicSize<T>

test/IRGen/autorelease.sil

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import Swift
99

1010
class C {}
1111
sil_vtable C {}
12-
sil @_TFC11autorelease1Cd : $@convention(method) (@owned C) -> @owned Builtin.NativeObject {
12+
sil [ossa] @_TFC11autorelease1Cd : $@convention(method) (@owned C) -> @owned Builtin.NativeObject {
1313
bb0(%0 : @owned $C):
1414
%1 = unchecked_ref_cast %0 : $C to $Builtin.NativeObject // user: %2
1515
return %1 : $Builtin.NativeObject // id: %2
1616
}
1717

18-
sil @foo : $@convention(thin) (@owned C?) -> @autoreleased C? {
18+
sil [ossa] @foo : $@convention(thin) (@owned C?) -> @autoreleased C? {
1919
bb0(%0 : @owned $C?):
2020
return %0 : $C?
2121
}
@@ -28,7 +28,7 @@ bb0(%0 : @owned $C?):
2828
// CHECK-64: [[T0:%.*]] = tail call i64 bitcast ([[OBJC]]* ([[OBJC]]*)* @objc_autoreleaseReturnValue to i64 (i64)*)(i64 %0)
2929
// CHECK-64-NEXT: ret i64 [[T0]]
3030

31-
sil @bar : $@convention(thin) (@owned C?) -> @owned C? {
31+
sil [ossa] @bar : $@convention(thin) (@owned C?) -> @owned C? {
3232
bb0(%0 : @owned $C?):
3333
%1 = function_ref @foo : $@convention(thin) (@owned C?) -> @autoreleased C?
3434
%2 = apply %1(%0) : $@convention(thin) (@owned C?) -> @autoreleased C?

test/IRGen/autorelease_optimized_aarch64.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class C {}
1212

1313
sil_vtable C {}
1414

15-
sil @_TFC21autorelease_optimized1Cd : $@convention(method) (@owned C) -> @owned Builtin.NativeObject {
15+
sil [ossa] @_TFC21autorelease_optimized1Cd : $@convention(method) (@owned C) -> @owned Builtin.NativeObject {
1616
bb0(%0 : @owned $C):
1717
%1 = unchecked_ref_cast %0 : $C to $Builtin.NativeObject // user: %2
1818
return %1 : $Builtin.NativeObject // id: %2
@@ -21,7 +21,7 @@ bb0(%0 : @owned $C):
2121
sil public_external @foo : $@convention(thin) (@owned C) -> @autoreleased C
2222
sil public_external @bar : $@convention(thin) (@owned C) -> ()
2323

24-
sil @baz : $@convention(thin) (@owned C) -> () {
24+
sil [ossa] @baz : $@convention(thin) (@owned C) -> () {
2525
bb0(%0 : @owned $C):
2626
%1 = function_ref @foo : $@convention(thin) (@owned C) -> @autoreleased C
2727
%2 = apply %1(%0) : $@convention(thin) (@owned C) -> @autoreleased C

0 commit comments

Comments
 (0)