Skip to content

Commit b84928f

Browse files
authored
Merge pull request #23260 from gottesmm/pr-285a2392739649b4abf8d4b3a3464c983416b4e0
[lit] Change all %target-swift-frontend invocations to verify ownership.
2 parents a6158c9 + dfe65c2 commit b84928f

13 files changed

+114
-176
lines changed

test/IRGen/class_isa_pointers.sil

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ sil_vtable Purebred {}
2222
// CHECK: [[ISA:%.*]] = load %swift.type*, %swift.type** [[ISA_PTR]]
2323
// CHECK: [[VTABLE:%.*]] = bitcast %swift.type* [[ISA]]
2424
// CHECK: getelementptr inbounds {{.*}} [[VTABLE]]
25-
sil [ossa] @purebred_method : $@convention(thin) (@owned Purebred) -> () {
26-
entry(%0 : @owned $Purebred):
25+
sil @purebred_method : $@convention(thin) (@owned Purebred) -> () {
26+
entry(%0 : $Purebred):
2727
%m = class_method %0 : $Purebred, #Purebred.method!1 : (Purebred) -> () -> (), $@convention(method) (@guaranteed Purebred) -> ()
2828
%z = apply %m(%0) : $@convention(method) (@guaranteed Purebred) -> ()
2929
return %z : $()
@@ -46,24 +46,24 @@ sil_vtable Mongrel {}
4646
// CHECK: [[ISA:%.*]] = inttoptr i64 [[T3]] to %swift.type*
4747
// CHECK: [[VTABLE:%.*]] = bitcast %swift.type* [[ISA]]
4848
// CHECK: getelementptr inbounds {{.*}} [[VTABLE]]
49-
sil [ossa] @mongrel_method : $@convention(thin) (@owned Mongrel) -> () {
50-
entry(%0 : @owned $Mongrel):
49+
sil @mongrel_method : $@convention(thin) (@owned Mongrel) -> () {
50+
entry(%0 : $Mongrel):
5151
%m = class_method %0 : $Mongrel, #Mongrel.method!1 : (Mongrel) -> () -> (), $@convention(method) (@guaranteed Mongrel) -> ()
5252
%z = apply %m(%0) : $@convention(method) (@guaranteed Mongrel) -> ()
5353
return %z : $()
5454
}
5555

5656
// ObjC stubs expected by ObjC metadata emission
5757

58-
sil private [ossa] @$s18class_isa_pointers7MongrelC6methodyyFTo : $@convention(objc_method) (Purebred) -> () {
59-
entry(%0 : @unowned $Purebred):
58+
sil private @$s18class_isa_pointers7MongrelC6methodyyFTo : $@convention(objc_method) (Purebred) -> () {
59+
entry(%0 : $Purebred):
6060
unreachable
6161
}
62-
sil private [ossa] @$s18class_isa_pointers7MongrelC7bellsOnACSgSi_tcfcTo : $@convention(objc_method) (Int, Purebred) -> () {
63-
entry(%0 : $Int, %1 : @unowned $Purebred):
62+
sil private @$s18class_isa_pointers7MongrelC7bellsOnACSgSi_tcfcTo : $@convention(objc_method) (Int, Purebred) -> () {
63+
entry(%0 : $Int, %1 : $Purebred):
6464
unreachable
6565
}
66-
sil private [ossa] @$s18class_isa_pointers7MongrelCACycfcTo : $@convention(objc_method) (Purebred) -> () {
67-
entry(%0 : @unowned $Purebred):
66+
sil private @$s18class_isa_pointers7MongrelCACycfcTo : $@convention(objc_method) (Purebred) -> () {
67+
entry(%0 : $Purebred):
6868
unreachable
6969
}

test/IRGen/exclusivity.sil

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ sil_vtable A {}
1313
sil public_external @changeInt : $@convention(thin) (@inout Int) -> ()
1414

1515
// CHECK-LABEL: define {{.*}} @test1(
16-
sil [ossa] @test1 : $@convention(thin) (@owned A) -> Int {
17-
bb0(%0 : @owned $A):
16+
sil @test1 : $@convention(thin) (@owned A) -> Int {
17+
bb0(%0 : $A):
1818
// CHECK: [[SCRATCH0:%.*]] = alloca [[BUFFER_T:\[.* x i8\]]],
1919
// CHECK: [[SCRATCH1:%.*]] = alloca [[BUFFER_T:\[.* x i8\]]],
2020

@@ -25,11 +25,11 @@ bb0(%0 : @owned $A):
2525
// CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* [[T0]])
2626
// CHECK: [[T0:%.*]] = bitcast [[INT:%TSi]]* [[PROP]] to i8*
2727
// CHECK: call void @swift_beginAccess(i8* [[T0]], [[BUFFER_T]]* [[SCRATCH0]], [[SIZE_T:i32|i64]] 32, i8* null)
28-
%4 = begin_access [read] [dynamic] %3 : $*Int
28+
%4 = begin_access [read] [dynamic] %3 : $*Int
2929

3030
// CHECK: [[T0:%.*]] = getelementptr inbounds [[INT]], [[INT]]* %1, i32 0, i32 0
3131
// CHECK: load {{.*}}* [[T0]]
32-
%5 = load [trivial] %4 : $*Int
32+
%5 = load %4 : $*Int
3333

3434
// CHECK: call void @swift_endAccess([[BUFFER_T]]* [[SCRATCH0]])
3535
// CHECK: [[T0:%.*]] = bitcast [[BUFFER_T]]* [[SCRATCH0]] to i8*
@@ -54,6 +54,6 @@ bb0(%0 : @owned $A):
5454
// CHECK: [[T0:%.*]] = bitcast [[BUFFER_T]]* [[SCRATCH1]] to i8*
5555
// CHECK: call void @llvm.lifetime.end.p0i8(i64 -1, i8* [[T0]])
5656
end_access %12 : $*Int
57-
destroy_value %0 : $A
57+
strong_release %0 : $A
5858
return %5 : $Int
5959
}

test/IRGen/generic_classes.sil

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,10 @@ entry:
266266
// RootGeneric.x has fixed layout
267267
// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @RootGeneric_concrete_fragile_dependent_member_access_x
268268
// CHECK: getelementptr inbounds [[ROOTGENERIC]], [[ROOTGENERIC]]* %0, i32 0, i32 1
269-
sil [ossa] @RootGeneric_concrete_fragile_dependent_member_access_x : $<F> (RootGeneric<F>) -> UInt8 {
270-
entry(%c : @unowned $RootGeneric<F>):
269+
sil @RootGeneric_concrete_fragile_dependent_member_access_x : $<F> (RootGeneric<F>) -> UInt8 {
270+
entry(%c : $RootGeneric<F>):
271271
%p = ref_element_addr %c : $RootGeneric<F>, #RootGeneric.x
272-
%x = load_borrow %p : $*UInt8
272+
%x = load %p : $*UInt8
273273
return %x : $UInt8
274274
}
275275

@@ -281,8 +281,8 @@ entry(%c : @unowned $RootGeneric<F>):
281281
// CHECK: [[CLASS_BYTE_ARRAY:%.*]] = bitcast [[ROOTGENERIC]]* {{%.*}} to i8*
282282
// CHECK: [[Y_ADDR:%.*]] = getelementptr inbounds i8, i8* [[CLASS_BYTE_ARRAY]], i64 [[Y_OFFSET]]
283283
// CHECK: bitcast i8* [[Y_ADDR]] to %swift.opaque*
284-
sil [ossa] @RootGeneric_concrete_fragile_dependent_member_access_y : $<F> (RootGeneric<F>) -> @out F {
285-
entry(%z : $*F, %c : @unowned $RootGeneric<F>):
284+
sil @RootGeneric_concrete_fragile_dependent_member_access_y : $<F> (RootGeneric<F>) -> @out F {
285+
entry(%z : $*F, %c : $RootGeneric<F>):
286286
%p = ref_element_addr %c : $RootGeneric<F>, #RootGeneric.y
287287
copy_addr %p to [initialization] %z : $*F
288288
%t = tuple ()
@@ -292,8 +292,8 @@ entry(%z : $*F, %c : @unowned $RootGeneric<F>):
292292
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @RootGeneric_subst_concrete_fragile_dependent_member_access_y
293293
// CHECK: [[Y_ADDR:%.*]] = getelementptr inbounds {{.*}}, {{.*}}* %1, i32 0, i32 3
294294
// CHECK: bitcast %TSi* [[Y_ADDR]] to i8*
295-
sil [ossa] @RootGeneric_subst_concrete_fragile_dependent_member_access_y : $(RootGeneric<Int>) -> @out Int {
296-
entry(%z : $*Int, %c : @unowned $RootGeneric<Int>):
295+
sil @RootGeneric_subst_concrete_fragile_dependent_member_access_y : $(RootGeneric<Int>) -> @out Int {
296+
entry(%z : $*Int, %c : $RootGeneric<Int>):
297297
%p = ref_element_addr %c : $RootGeneric<Int>, #RootGeneric.y
298298
copy_addr %p to [initialization] %z : $*Int
299299
%t = tuple ()
@@ -308,21 +308,21 @@ entry(%z : $*Int, %c : @unowned $RootGeneric<Int>):
308308
// CHECK: [[CLASS_BYTE_ARRAY:%.*]] = bitcast [[ROOTGENERIC]]* {{%.*}} to i8*
309309
// CHECK: [[Z_ADDR:%.*]] = getelementptr inbounds i8, i8* [[CLASS_BYTE_ARRAY]], i64 [[Z_OFFSET]]
310310
// CHECK: bitcast i8* [[Z_ADDR]] to %Ts5UInt8V*
311-
sil [ossa] @RootGeneric_concrete_fragile_dependent_member_access_z : $<F> (RootGeneric<F>) -> UInt8 {
312-
entry(%c : @unowned $RootGeneric<F>):
311+
sil @RootGeneric_concrete_fragile_dependent_member_access_z : $<F> (RootGeneric<F>) -> UInt8 {
312+
entry(%c : $RootGeneric<F>):
313313
%p = ref_element_addr %c : $RootGeneric<F>, #RootGeneric.z
314-
%z = load_borrow %p : $*UInt8
314+
%z = load %p : $*UInt8
315315
return %z : $UInt8
316316
}
317317

318318
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @RootGeneric_subst_concrete_fragile_dependent_member_access_z
319319
// CHECK: [[Z_ADDR:%.*]] = getelementptr inbounds {{.*}}, {{.*}}* %0, i32 0, i32 4
320320
// CHECK: [[T0:%.*]] = getelementptr inbounds %Ts5UInt8V, %Ts5UInt8V* [[Z_ADDR]], i32 0, i32 0
321321
// CHECK: load i8, i8* [[T0]], align
322-
sil [ossa] @RootGeneric_subst_concrete_fragile_dependent_member_access_z : $(RootGeneric<Int>) -> UInt8 {
323-
entry(%c : @unowned $RootGeneric<Int>):
322+
sil @RootGeneric_subst_concrete_fragile_dependent_member_access_z : $(RootGeneric<Int>) -> UInt8 {
323+
entry(%c : $RootGeneric<Int>):
324324
%p = ref_element_addr %c : $RootGeneric<Int>, #RootGeneric.z
325-
%z = load_borrow %p : $*UInt8
325+
%z = load %p : $*UInt8
326326
return %z : $UInt8
327327
}
328328

test/IRGen/ownership_qualified_memopts.sil

Lines changed: 0 additions & 92 deletions
This file was deleted.

test/IRGen/protocol_with_superclass.sil

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class MoreDerived : Concrete, SubProto {}
2727

2828
// CHECK-objc-LABEL: define hidden swiftcc void @checkExistentialDowncast(%T24protocol_with_superclass8ConcreteC*, {{.*}} {
2929
// CHECK-native-LABEL: define hidden swiftcc void @checkExistentialDowncast(%T24protocol_with_superclass8ConcreteC*, %swift.refcounted*, i8**, %T24protocol_with_superclass8ConcreteC*, i8**, %T24protocol_with_superclass8ConcreteC*, i8**, %T24protocol_with_superclass8ConcreteC*, i8**) {{.*}} {
30-
sil hidden [ossa] @checkExistentialDowncast : $@convention(thin) (@owned Concrete, @owned SuperProto, @owned SuperProto & Concrete, @owned ProtoRefinesClass, @owned SubProto) -> () {
30+
sil hidden @checkExistentialDowncast : $@convention(thin) (@owned Concrete, @owned SuperProto, @owned SuperProto & Concrete, @owned ProtoRefinesClass, @owned SubProto) -> () {
3131
bb0(%0 : $Concrete, %1 : $SuperProto, %2 : $SuperProto & Concrete, %3 : $ProtoRefinesClass, %4 : $SubProto):
3232

3333
// CHECK: [[ISA_ADDR:%.*]] = bitcast %T24protocol_with_superclass8ConcreteC* %0 to %swift.type**
@@ -39,7 +39,7 @@ bb0(%0 : $Concrete, %1 : $SuperProto, %2 : $SuperProto & Concrete, %3 : $ProtoRe
3939
%5 = unconditional_checked_cast %0 : $Concrete to $ProtoRefinesClass
4040

4141
// CHECK: call void bitcast (void (%swift.refcounted*)* @swift_release to void (%T24protocol_with_superclass8ConcreteC*)*)(%T24protocol_with_superclass8ConcreteC* [[REFERENCE]])
42-
destroy_value %5 : $ProtoRefinesClass
42+
strong_release %5 : $ProtoRefinesClass
4343

4444
// CHECK: [[ISA_ADDR:%.*]] = bitcast %T24protocol_with_superclass8ConcreteC* %0 to %swift.type**
4545
// CHECK-NEXT: [[ISA:%.*]] = load %swift.type*, %swift.type** [[ISA_ADDR]]
@@ -50,7 +50,7 @@ bb0(%0 : $Concrete, %1 : $SuperProto, %2 : $SuperProto & Concrete, %3 : $ProtoRe
5050
%6 = unconditional_checked_cast %0 : $Concrete to $SubProto
5151

5252
// CHECK: call void bitcast (void (%swift.refcounted*)* @swift_release to void (%T24protocol_with_superclass8ConcreteC*)*)(%T24protocol_with_superclass8ConcreteC* [[REFERENCE]])
53-
destroy_value %6 : $SubProto
53+
strong_release %6 : $SubProto
5454

5555
// CHECK-objc: [[ISA:%.*]] = call %swift.type* @swift_getObjectType(%objc_object* %{{[0-9]+}})
5656
// CHECK-objc-NEXT: [[OBJECT:%.*]] = bitcast %objc_object* %{{[0-9]+}} to i8*
@@ -63,7 +63,7 @@ bb0(%0 : $Concrete, %1 : $SuperProto, %2 : $SuperProto & Concrete, %3 : $ProtoRe
6363
%7 = unconditional_checked_cast %1 : $SuperProto to $ProtoRefinesClass
6464

6565
// CHECK: call void bitcast (void (%swift.refcounted*)* @swift_release to void (%T24protocol_with_superclass8ConcreteC*)*)(%T24protocol_with_superclass8ConcreteC* [[REFERENCE]])
66-
destroy_value %7 : $ProtoRefinesClass
66+
strong_release %7 : $ProtoRefinesClass
6767

6868
// CHECK-objc: [[ISA:%.*]] = call %swift.type* @swift_getObjectType(%objc_object* %{{[0-9]+}})
6969
// CHECK-objc-NEXT: [[OBJECT:%.*]] = bitcast %objc_object* %{{[0-9]+}} to i8*
@@ -76,7 +76,7 @@ bb0(%0 : $Concrete, %1 : $SuperProto, %2 : $SuperProto & Concrete, %3 : $ProtoRe
7676
%8 = unconditional_checked_cast %1 : $SuperProto to $SubProto
7777

7878
// CHECK: call void bitcast (void (%swift.refcounted*)* @swift_release to void (%T24protocol_with_superclass8ConcreteC*)*)(%T24protocol_with_superclass8ConcreteC* [[REFERENCE]])
79-
destroy_value %8 : $SubProto
79+
strong_release %8 : $SubProto
8080

8181
// CHECK: [[ISA_ADDR:%.*]] = bitcast %T24protocol_with_superclass8ConcreteC* %{{[0-9]+}} to %swift.type**
8282
// CHECK-NEXT: [[ISA:%.*]] = load %swift.type*, %swift.type** [[ISA_ADDR]]
@@ -87,7 +87,7 @@ bb0(%0 : $Concrete, %1 : $SuperProto, %2 : $SuperProto & Concrete, %3 : $ProtoRe
8787
%9 = unconditional_checked_cast %2 : $SuperProto & Concrete to $ProtoRefinesClass
8888

8989
// CHECK: call void bitcast (void (%swift.refcounted*)* @swift_release to void (%T24protocol_with_superclass8ConcreteC*)*)(%T24protocol_with_superclass8ConcreteC* [[REFERENCE]])
90-
destroy_value %9 : $ProtoRefinesClass
90+
strong_release %9 : $ProtoRefinesClass
9191

9292
// CHECK: [[ISA_ADDR:%.*]] = bitcast %T24protocol_with_superclass8ConcreteC* %{{[0-9]+}} to %swift.type**
9393
// CHECK-NEXT: [[ISA:%.*]] = load %swift.type*, %swift.type** [[ISA_ADDR]]
@@ -98,7 +98,7 @@ bb0(%0 : $Concrete, %1 : $SuperProto, %2 : $SuperProto & Concrete, %3 : $ProtoRe
9898
%10 = unconditional_checked_cast %2 : $SuperProto & Concrete to $SubProto
9999

100100
// CHECK: call void bitcast (void (%swift.refcounted*)* @swift_release to void (%T24protocol_with_superclass8ConcreteC*)*)(%T24protocol_with_superclass8ConcreteC* [[REFERENCE]])
101-
destroy_value %10 : $SubProto
101+
strong_release %10 : $SubProto
102102

103103
// CHECK: [[OBJECT:%.*]] = bitcast %T24protocol_with_superclass8ConcreteC* %{{[0-9]+}} to i8*
104104
// CHECK-NEXT: [[RESPONSE:%.*]] = call swiftcc %swift.metadata_response @"$s24protocol_with_superclass7DerivedCMa"(i{{[0-9]+}} 0)
@@ -109,7 +109,7 @@ bb0(%0 : $Concrete, %1 : $SuperProto, %2 : $SuperProto & Concrete, %3 : $ProtoRe
109109
%11 = unconditional_checked_cast %3 : $ProtoRefinesClass to $Derived
110110

111111
// CHECK: call void bitcast (void (%swift.refcounted*)* @swift_release to void (%T24protocol_with_superclass7DerivedC*)*)(%T24protocol_with_superclass7DerivedC* [[REFERENCE]])
112-
destroy_value %11 : $Derived
112+
strong_release %11 : $Derived
113113

114114
// CHECK: [[OBJECT:%.*]] = bitcast %T24protocol_with_superclass8ConcreteC* %{{[0-9]+}} to i8*
115115
// CHECK-NEXT: [[RESPONSE:%.*]] = call swiftcc %swift.metadata_response @"$s24protocol_with_superclass10SubDerivedCMa"(i{{[0-9]+}} 0)
@@ -120,7 +120,7 @@ bb0(%0 : $Concrete, %1 : $SuperProto, %2 : $SuperProto & Concrete, %3 : $ProtoRe
120120
%12 = unconditional_checked_cast %3 : $ProtoRefinesClass to $SubDerived
121121

122122
// CHECK: call void bitcast (void (%swift.refcounted*)* @swift_release to void (%T24protocol_with_superclass10SubDerivedC*)*)(%T24protocol_with_superclass10SubDerivedC* [[REFERENCE]])
123-
destroy_value %12 : $SubDerived
123+
strong_release %12 : $SubDerived
124124

125125
// CHECK: [[ISA_ADDR:%.*]] = bitcast %T24protocol_with_superclass8ConcreteC* %{{[0-9]+}} to %swift.type**
126126
// CHECK-NEXT: [[ISA:%.*]] = load %swift.type*, %swift.type** [[ISA_ADDR]]
@@ -131,7 +131,7 @@ bb0(%0 : $Concrete, %1 : $SuperProto, %2 : $SuperProto & Concrete, %3 : $ProtoRe
131131
%13 = unconditional_checked_cast %3 : $ProtoRefinesClass to $OtherProto & Concrete
132132

133133
// CHECK: call void bitcast (void (%swift.refcounted*)* @swift_release to void (%T24protocol_with_superclass8ConcreteC*)*)(%T24protocol_with_superclass8ConcreteC* [[REFERENCE]])
134-
destroy_value %13 : $OtherProto & Concrete
134+
strong_release %13 : $OtherProto & Concrete
135135

136136
// CHECK: [[ISA_ADDR:%.*]] = bitcast %T24protocol_with_superclass8ConcreteC* %{{[0-9]+}} to %swift.type**
137137
// CHECK-NEXT: [[ISA:%.*]] = load %swift.type*, %swift.type** [[ISA_ADDR]]
@@ -144,7 +144,7 @@ bb0(%0 : $Concrete, %1 : $SuperProto, %2 : $SuperProto & Concrete, %3 : $ProtoRe
144144
%14 = unconditional_checked_cast %3 : $ProtoRefinesClass to $OtherProto & SubConcrete
145145

146146
// CHECK: call void bitcast (void (%swift.refcounted*)* @swift_release to void (%T24protocol_with_superclass11SubConcreteC*)*)(%T24protocol_with_superclass11SubConcreteC* [[REFERENCE]])
147-
destroy_value %14 : $OtherProto & SubConcrete
147+
strong_release %14 : $OtherProto & SubConcrete
148148

149149
// CHECK: [[OBJECT:%.*]] = bitcast %T24protocol_with_superclass8ConcreteC* %{{[0-9]+}} to i8*
150150
// CHECK-NEXT: [[RESPONSE:%.*]] = call swiftcc %swift.metadata_response @"$s24protocol_with_superclass11MoreDerivedCMa"(i{{[0-9]+}} 0)
@@ -155,7 +155,7 @@ bb0(%0 : $Concrete, %1 : $SuperProto, %2 : $SuperProto & Concrete, %3 : $ProtoRe
155155
%15 = unconditional_checked_cast %4 : $SubProto to $MoreDerived
156156

157157
// CHECK: call void bitcast (void (%swift.refcounted*)* @swift_release to void (%T24protocol_with_superclass11MoreDerivedC*)*)(%T24protocol_with_superclass11MoreDerivedC* [[REFERENCE]])
158-
destroy_value %15 : $MoreDerived
158+
strong_release %15 : $MoreDerived
159159

160160
// CHECK: [[ISA_ADDR:%.*]] = bitcast %T24protocol_with_superclass8ConcreteC* %{{[0-9]+}} to %swift.type**
161161
// CHECK-NEXT: [[ISA:%.*]] = load %swift.type*, %swift.type** [[ISA_ADDR]]
@@ -166,7 +166,7 @@ bb0(%0 : $Concrete, %1 : $SuperProto, %2 : $SuperProto & Concrete, %3 : $ProtoRe
166166
%16 = unconditional_checked_cast %4 : $SubProto to $OtherProto & Concrete
167167

168168
// CHECK: call void bitcast (void (%swift.refcounted*)* @swift_release to void (%T24protocol_with_superclass8ConcreteC*)*)(%T24protocol_with_superclass8ConcreteC* [[REFERENCE]])
169-
destroy_value %16 : $OtherProto & Concrete
169+
strong_release %16 : $OtherProto & Concrete
170170

171171
%result = tuple ()
172172
return %result : $()

0 commit comments

Comments
 (0)