@@ -12,53 +12,53 @@ import Swift
12
12
import SwiftShims
13
13
14
14
class List {
15
- var x: Int
15
+ var x: Int64
16
16
let next: List
17
17
}
18
18
19
19
struct S {
20
20
var l: List
21
- var y: Int
21
+ var y: Int64
22
22
}
23
23
24
24
struct Ptr {
25
25
var p: Int64
26
26
}
27
27
28
28
// CHECK-LABEL: Accesses for readIdentifiedArg
29
- // CHECK-NEXT: Value: %0 = argument of bb0 : $*Int
29
+ // CHECK-NEXT: Value: %0 = argument of bb0 : $*Int64
30
30
// CHECK-NEXT: Scope: base
31
- // CHECK-NEXT: Base: argument - %0 = argument of bb0 : $*Int
31
+ // CHECK-NEXT: Base: argument - %0 = argument of bb0 : $*Int64
32
32
// CHECK-NEXT: Path: ""
33
- // CHECK-NEXT: Storage: %0 = argument of bb0 : $*Int
33
+ // CHECK-NEXT: Storage: %0 = argument of bb0 : $*Int64
34
34
// CHECK-NEXT: Path: ""
35
35
// CHECK-NEXT: End accesses for readIdentifiedArg
36
- sil [ossa] @readIdentifiedArg : $@convention(thin) (@in Int ) -> Int {
37
- bb0(%0 : $*Int ):
38
- %res = load [trivial] %0 : $*Int
39
- return %res : $Int
36
+ sil [ossa] @readIdentifiedArg : $@convention(thin) (@in Int64 ) -> Int64 {
37
+ bb0(%0 : $*Int64 ):
38
+ %res = load [trivial] %0 : $*Int64
39
+ return %res : $Int64
40
40
}
41
41
42
42
// CHECK-LABEL: Accesses for writeIdentifiedArg
43
- // CHECK-NEXT: Value: %0 = argument of bb0 : $*Int
43
+ // CHECK-NEXT: Value: %0 = argument of bb0 : $*Int64
44
44
// CHECK-NEXT: Scope: base
45
- // CHECK-NEXT: Base: argument - %0 = argument of bb0 : $*Int
45
+ // CHECK-NEXT: Base: argument - %0 = argument of bb0 : $*Int64
46
46
// CHECK-NEXT: Path: ""
47
- // CHECK-NEXT: Storage: %0 = argument of bb0 : $*Int
47
+ // CHECK-NEXT: Storage: %0 = argument of bb0 : $*Int64
48
48
// CHECK-NEXT: Path: ""
49
49
// CHECK-NEXT: End accesses for writeIdentifiedArg
50
- sil [ossa] @writeIdentifiedArg : $@convention(thin) (@inout Int ) -> () {
51
- bb0(%0 : $*Int ):
50
+ sil [ossa] @writeIdentifiedArg : $@convention(thin) (@inout Int64 ) -> () {
51
+ bb0(%0 : $*Int64 ):
52
52
%2 = integer_literal $Builtin.Int64, 42
53
- %3 = struct $Int (%2 : $Builtin.Int64)
54
- store %3 to [trivial] %0 : $*Int
53
+ %3 = struct $Int64 (%2 : $Builtin.Int64)
54
+ store %3 to [trivial] %0 : $*Int64
55
55
%5 = tuple ()
56
56
return %5 : $()
57
57
}
58
58
59
59
// CHECK-LABEL: Accesses for $writeToHead
60
- // CHECK-NEXT: Value: %7 = begin_access [modify] [dynamic] %6 : $*Int
61
- // CHECK-NEXT: Scope: %7 = begin_access [modify] [dynamic] %6 : $*Int
60
+ // CHECK-NEXT: Value: %7 = begin_access [modify] [dynamic] %6 : $*Int64
61
+ // CHECK-NEXT: Scope: %7 = begin_access [modify] [dynamic] %6 : $*Int64
62
62
// CHECK-NEXT: Base: class - %6 = ref_element_addr %5 : $List, #List.x
63
63
// CHECK-NEXT: Path: ""
64
64
// CHECK-NEXT: Storage: %0 = argument of bb0 : $S
@@ -69,26 +69,26 @@ bb0(%0 : @guaranteed $S):
69
69
debug_value %0 : $S, let, name "s", argno 1
70
70
%2 = struct_extract %0 : $S, #S.l
71
71
%3 = integer_literal $Builtin.Int64, 10
72
- %4 = struct $Int (%3 : $Builtin.Int64)
72
+ %4 = struct $Int64 (%3 : $Builtin.Int64)
73
73
%5 = begin_borrow [lexical] %2 : $List
74
74
%6 = ref_element_addr %5 : $List, #List.x
75
- %7 = begin_access [modify] [dynamic] %6 : $*Int
76
- store %4 to [trivial] %7 : $*Int
77
- end_access %7 : $*Int
75
+ %7 = begin_access [modify] [dynamic] %6 : $*Int64
76
+ store %4 to [trivial] %7 : $*Int64
77
+ end_access %7 : $*Int64
78
78
end_borrow %5 : $List
79
79
%11 = tuple ()
80
80
return %11 : $()
81
81
}
82
82
83
83
// CHECK-LABEL: Accesses for storeToArgs
84
- // CHECK-NEXT: Value: %6 = begin_access [modify] [dynamic] %5 : $*Int
85
- // CHECK-NEXT: Scope: %6 = begin_access [modify] [dynamic] %5 : $*Int
84
+ // CHECK-NEXT: Value: %6 = begin_access [modify] [dynamic] %5 : $*Int64
85
+ // CHECK-NEXT: Scope: %6 = begin_access [modify] [dynamic] %5 : $*Int64
86
86
// CHECK-NEXT: Base: class - %5 = ref_element_addr %0 : $List, #List.x
87
87
// CHECK-NEXT: Path: ""
88
88
// CHECK-NEXT: Storage: %0 = argument of bb0 : $List
89
89
// CHECK-NEXT: Path: "c0"
90
- // CHECK-NEXT: Value: %14 = begin_access [modify] [dynamic] %13 : $*Int
91
- // CHECK-NEXT: Scope: %14 = begin_access [modify] [dynamic] %13 : $*Int
90
+ // CHECK-NEXT: Value: %14 = begin_access [modify] [dynamic] %13 : $*Int64
91
+ // CHECK-NEXT: Scope: %14 = begin_access [modify] [dynamic] %13 : $*Int64
92
92
// CHECK-NEXT: Base: class - %13 = ref_element_addr %1 : $List, #List.x
93
93
// CHECK-NEXT: Path: ""
94
94
// CHECK-NEXT: Storage: %1 = argument of bb0 : $List
@@ -100,21 +100,21 @@ bb0(%1 : @guaranteed $List, %2 : @guaranteed $List):
100
100
101
101
bb1:
102
102
%8 = integer_literal $Builtin.Int64, 10
103
- %9 = struct $Int (%8 : $Builtin.Int64)
103
+ %9 = struct $Int64 (%8 : $Builtin.Int64)
104
104
%10 = ref_element_addr %1 : $List, #List.x
105
- %11 = begin_access [modify] [dynamic] %10 : $*Int
106
- store %9 to [trivial] %11 : $*Int
107
- end_access %11 : $*Int
105
+ %11 = begin_access [modify] [dynamic] %10 : $*Int64
106
+ store %9 to [trivial] %11 : $*Int64
107
+ end_access %11 : $*Int64
108
108
%14 = tuple ()
109
109
br bb3
110
110
111
111
bb2:
112
112
%16 = integer_literal $Builtin.Int64, 20
113
- %17 = struct $Int (%16 : $Builtin.Int64)
113
+ %17 = struct $Int64 (%16 : $Builtin.Int64)
114
114
%18 = ref_element_addr %2 : $List, #List.x
115
- %19 = begin_access [modify] [dynamic] %18 : $*Int
116
- store %17 to [trivial] %19 : $*Int
117
- end_access %19 : $*Int
115
+ %19 = begin_access [modify] [dynamic] %18 : $*Int64
116
+ store %17 to [trivial] %19 : $*Int64
117
+ end_access %19 : $*Int64
118
118
%22 = tuple ()
119
119
br bb3
120
120
124
124
}
125
125
126
126
// CHECK-LABEL: Accesses for storeMaybeLocalPhi
127
- // CHECK-NEXT: Value: %10 = begin_access [modify] [dynamic] %9 : $*Int
128
- // CHECK-NEXT: Scope: %10 = begin_access [modify] [dynamic] %9 : $*Int
127
+ // CHECK-NEXT: Value: %10 = begin_access [modify] [dynamic] %9 : $*Int64
128
+ // CHECK-NEXT: Scope: %10 = begin_access [modify] [dynamic] %9 : $*Int64
129
129
// CHECK-NEXT: Base: class - %9 = ref_element_addr %6 : $List, #List.x
130
130
// CHECK-NEXT: Path: ""
131
131
// CHECK-NEXT: Storage: %4 = alloc_ref $List
@@ -147,11 +147,11 @@ bb2:
147
147
148
148
bb3(%12 : $List):
149
149
%14 = integer_literal $Builtin.Int64, 20
150
- %15 = struct $Int (%14 : $Builtin.Int64)
150
+ %15 = struct $Int64 (%14 : $Builtin.Int64)
151
151
%16 = ref_element_addr %12 : $List, #List.x
152
- %17 = begin_access [modify] [dynamic] %16 : $*Int
153
- store %15 to %17 : $*Int
154
- end_access %17 : $*Int
152
+ %17 = begin_access [modify] [dynamic] %16 : $*Int64
153
+ store %15 to %17 : $*Int64
154
+ end_access %17 : $*Int64
155
155
%20 = tuple ()
156
156
strong_release %12 : $List
157
157
%22 = tuple ()
@@ -224,20 +224,20 @@ bb3(%6 : $Builtin.RawPointer) :
224
224
225
225
226
226
// CHECK-LABEL: Accesses for readIdentifiedBoxArg
227
- // CHECK-NEXT: Value: %2 = begin_access [read] [dynamic] %1 : $*Int
228
- // CHECK-NEXT: Scope: %2 = begin_access [read] [dynamic] %1 : $*Int
229
- // CHECK-NEXT: Base: box - %1 = project_box %0 : ${ var Int }, 0
227
+ // CHECK-NEXT: Value: %2 = begin_access [read] [dynamic] %1 : $*Int64
228
+ // CHECK-NEXT: Scope: %2 = begin_access [read] [dynamic] %1 : $*Int64
229
+ // CHECK-NEXT: Base: box - %1 = project_box %0 : ${ var Int64 }, 0
230
230
// CHECK-NEXT: Path: ""
231
- // CHECK-NEXT: Storage: %0 = argument of bb0 : ${ var Int }
231
+ // CHECK-NEXT: Storage: %0 = argument of bb0 : ${ var Int64 }
232
232
// CHECK-NEXT: Path: "c0"
233
233
// CHECK-NEXT: End accesses for readIdentifiedBoxArg
234
- sil [ossa] @readIdentifiedBoxArg : $@convention(thin) (@guaranteed { var Int }) -> Int {
235
- bb0(%0 : @guaranteed ${ var Int }):
236
- %1 = project_box %0 : ${ var Int }, 0
237
- %5 = begin_access [read] [dynamic] %1 : $*Int
238
- %6 = load [trivial] %5 : $*Int
239
- end_access %5 : $*Int
240
- return %6 : $Int
234
+ sil [ossa] @readIdentifiedBoxArg : $@convention(thin) (@guaranteed { var Int64 }) -> Int64 {
235
+ bb0(%0 : @guaranteed ${ var Int64 }):
236
+ %1 = project_box %0 : ${ var Int64 }, 0
237
+ %5 = begin_access [read] [dynamic] %1 : $*Int64
238
+ %6 = load [trivial] %5 : $*Int64
239
+ end_access %5 : $*Int64
240
+ return %6 : $Int64
241
241
}
242
242
243
243
@@ -274,6 +274,18 @@ bb0(%0 : $Int64):
274
274
return %99 : $()
275
275
}
276
276
277
+ struct MySwiftArrayBodyStorage {
278
+ @_hasStorage var count : Int64
279
+ }
280
+
281
+ struct MyArrayBody {
282
+ @_hasStorage var _storage : MySwiftArrayBodyStorage
283
+ }
284
+
285
+ class MyContiguousArrayStorageBase {
286
+ @_hasStorage var countAndCapacity : MyArrayBody
287
+ }
288
+
277
289
struct _MyBridgeStorage {
278
290
@_hasStorage var rawValue : Builtin.BridgeObject
279
291
}
@@ -288,21 +300,21 @@ struct MyArray<T> {
288
300
}
289
301
290
302
// CHECK-LABEL: Accesses for testRefTailAndStruct0
291
- // CHECK-NEXT: Value: %8 = struct_element_addr %7 : $*Int , #Int ._value // user: %9
303
+ // CHECK-NEXT: Value: %8 = struct_element_addr %7 : $*Int64 , #Int64 ._value // user: %9
292
304
// CHECK-NEXT: Scope: base
293
- // CHECK-NEXT: Base: class - %5 = ref_element_addr [immutable] %4 : $__ContiguousArrayStorageBase , #__ContiguousArrayStorageBase .countAndCapacity
305
+ // CHECK-NEXT: Base: class - %5 = ref_element_addr [immutable] %4 : $MyContiguousArrayStorageBase , #MyContiguousArrayStorageBase .countAndCapacity
294
306
// CHECK-NEXT: Path: "s0.s0.s0"
295
307
// CHECK-NEXT: Storage: %0 = argument of bb0 : $MyArray<String>
296
308
// CHECK-NEXT: Path: "s0.s0.s0.c0.s0.s0.s0"
297
309
// CHECK-NEXT: Value: %11 = struct_element_addr %10 : $*String, #String._guts
298
310
// CHECK-NEXT: Scope: base
299
- // CHECK-NEXT: Base: tail - %10 = ref_tail_addr [immutable] %4 : $__ContiguousArrayStorageBase , $String
311
+ // CHECK-NEXT: Base: tail - %10 = ref_tail_addr [immutable] %4 : $MyContiguousArrayStorageBase , $String
300
312
// CHECK-NEXT: Path: "s0"
301
313
// CHECK-NEXT: Storage: %0 = argument of bb0 : $MyArray<String>
302
314
// CHECK-NEXT: Path: "s0.s0.s0.ct.s0"
303
- // CHECK-NEXT: Value: %10 = ref_tail_addr [immutable] %4 : $__ContiguousArrayStorageBase , $String
315
+ // CHECK-NEXT: Value: %10 = ref_tail_addr [immutable] %4 : $MyContiguousArrayStorageBase , $String
304
316
// CHECK-NEXT: Scope: base
305
- // CHECK-NEXT: Base: tail - %10 = ref_tail_addr [immutable] %4 : $__ContiguousArrayStorageBase , $String
317
+ // CHECK-NEXT: Base: tail - %10 = ref_tail_addr [immutable] %4 : $MyContiguousArrayStorageBase , $String
306
318
// CHECK-NEXT: Path: ""
307
319
// CHECK-NEXT: Storage: %0 = argument of bb0 : $MyArray<String>
308
320
// CHECK-NEXT: Path: "s0.s0.s0.ct"
@@ -312,16 +324,16 @@ bb0(%0 : $MyArray<String>):
312
324
%1 = struct_extract %0 : $MyArray<String>, #MyArray._buffer
313
325
%2 = struct_extract %1 : $_MyArrayBuffer<String>, #_MyArrayBuffer._storage
314
326
%3 = struct_extract %2 : $_MyBridgeStorage, #_MyBridgeStorage.rawValue
315
- %4 = unchecked_ref_cast %3 : $Builtin.BridgeObject to $__ContiguousArrayStorageBase
316
- %5 = ref_element_addr [immutable] %4 : $__ContiguousArrayStorageBase , #__ContiguousArrayStorageBase .countAndCapacity
317
- %6 = struct_element_addr %5 : $*_ArrayBody , #_ArrayBody ._storage
318
- %7 = struct_element_addr %6 : $*_SwiftArrayBodyStorage , #_SwiftArrayBodyStorage .count
319
- %8 = struct_element_addr %7 : $*Int , #Int ._value
327
+ %4 = unchecked_ref_cast %3 : $Builtin.BridgeObject to $MyContiguousArrayStorageBase
328
+ %5 = ref_element_addr [immutable] %4 : $MyContiguousArrayStorageBase , #MyContiguousArrayStorageBase .countAndCapacity
329
+ %6 = struct_element_addr %5 : $*MyArrayBody , #MyArrayBody ._storage
330
+ %7 = struct_element_addr %6 : $*MySwiftArrayBodyStorage , #MySwiftArrayBodyStorage .count
331
+ %8 = struct_element_addr %7 : $*Int64 , #Int64 ._value
320
332
%9 = load %8 : $*Builtin.Int64
321
- %10 = ref_tail_addr [immutable] %4 : $__ContiguousArrayStorageBase , $String
333
+ %10 = ref_tail_addr [immutable] %4 : $MyContiguousArrayStorageBase , $String
322
334
%11 = struct_element_addr %10 : $*String, #String._guts
323
335
%12 = load %11 : $*_StringGuts
324
336
%13 = load %10 : $*String
325
337
%14 = tuple ()
326
338
return %14 : $()
327
- }
339
+ }
0 commit comments