@@ -35,9 +35,10 @@ class Obj {
35
35
// CHECK: return
36
36
sil @outline_global_simple : $@convention(thin) () -> () {
37
37
bb0:
38
+ %0 = integer_literal $Builtin.Word, 0
38
39
%1 = integer_literal $Builtin.Int64, 1
39
40
%4 = struct $Int64 (%1 : $Builtin.Int64)
40
- %7 = alloc_ref $Obj
41
+ %7 = alloc_ref [tail_elems $Int64 * %0 : $Builtin.Word] $Obj
41
42
%9 = ref_element_addr %7 : $Obj, #Obj.value
42
43
store %4 to %9 : $*Int64
43
44
strong_release %7 : $Obj
83
84
// CHECK-NEXT: return
84
85
sil @handle_deallocation : $@convention(thin) () -> () {
85
86
bb0:
87
+ %0 = integer_literal $Builtin.Word, 0
86
88
%3 = integer_literal $Builtin.Int64, 3
87
89
%4 = struct $Int64 (%3 : $Builtin.Int64)
88
- %5 = alloc_ref $Obj
90
+ %5 = alloc_ref [tail_elems $Int64 * %0 : $Builtin.Word] $Obj
89
91
%6 = ref_element_addr %5 : $Obj, #Obj.value
90
92
store %4 to %6 : $*Int64
91
93
set_deallocating %5 : $Obj
94
96
return %r : $()
95
97
}
96
98
99
+ // CHECK-LABEL: sil @dont_outline_without_tail_elems
100
+ // CHECK: alloc_ref
101
+ // CHECK: store
102
+ // CHECK: return
103
+ sil @dont_outline_without_tail_elems : $@convention(thin) () -> () {
104
+ bb0:
105
+ %1 = integer_literal $Builtin.Int64, 1
106
+ %4 = struct $Int64 (%1 : $Builtin.Int64)
107
+ %7 = alloc_ref $Obj
108
+ %9 = ref_element_addr %7 : $Obj, #Obj.value
109
+ store %4 to %9 : $*Int64
110
+ strong_release %7 : $Obj
111
+ %r = tuple ()
112
+ return %r : $()
113
+ }
114
+
97
115
// CHECK-LABEL: sil @dont_outline_global_double_store
98
116
// CHECK: alloc_ref
99
117
// CHECK: store
100
118
// CHECK: return
101
119
sil @dont_outline_global_double_store : $@convention(thin) () -> () {
102
120
bb0:
121
+ %0 = integer_literal $Builtin.Word, 0
103
122
%1 = integer_literal $Builtin.Int64, 1
104
123
%4 = struct $Int64 (%1 : $Builtin.Int64)
105
- %7 = alloc_ref $Obj
124
+ %7 = alloc_ref [tail_elems $Int64 * %0 : $Builtin.Word] $Obj
106
125
%9 = ref_element_addr %7 : $Obj, #Obj.value
107
126
store %4 to %9 : $*Int64
108
127
store %4 to %9 : $*Int64
@@ -116,9 +135,10 @@ bb0:
116
135
// CHECK: return
117
136
sil @dont_outline_global_missing_store : $@convention(thin) () -> () {
118
137
bb0:
138
+ %0 = integer_literal $Builtin.Word, 0
119
139
%1 = integer_literal $Builtin.Int64, 1
120
140
%4 = struct $Int64 (%1 : $Builtin.Int64)
121
- %7 = alloc_ref $Obj
141
+ %7 = alloc_ref [tail_elems $Int64 * %0 : $Builtin.Word] $Obj
122
142
%9 = ref_element_addr %7 : $Obj, #Obj.value
123
143
strong_release %7 : $Obj
124
144
%r = tuple ()
@@ -148,9 +168,10 @@ sil @take_pointer : $@convention(thin) (Builtin.RawPointer) -> ()
148
168
// CHECK: return
149
169
sil @dont_outline_global_unknown_addr_use : $@convention(thin) () -> () {
150
170
bb0:
171
+ %0 = integer_literal $Builtin.Word, 0
151
172
%1 = integer_literal $Builtin.Int64, 1
152
173
%4 = struct $Int64 (%1 : $Builtin.Int64)
153
- %7 = alloc_ref $Obj
174
+ %7 = alloc_ref [tail_elems $Int64 * %0 : $Builtin.Word] $Obj
154
175
%9 = ref_element_addr %7 : $Obj, #Obj.value
155
176
store %4 to %9 : $*Int64
156
177
%10 = address_to_pointer %9 : $*Int64 to $Builtin.RawPointer
167
188
sil @dont_outline_global_escaping_obj : $@convention(thin) (@inout Obj) -> () {
168
189
bb0(%0: $*Obj):
169
190
%1 = integer_literal $Builtin.Int64, 1
191
+ %2 = integer_literal $Builtin.Word, 0
170
192
%4 = struct $Int64 (%1 : $Builtin.Int64)
171
- %7 = alloc_ref $Obj
193
+ %7 = alloc_ref [tail_elems $Int64 * %2 : $Builtin.Word] $Obj
172
194
%9 = ref_element_addr %7 : $Obj, #Obj.value
173
195
store %4 to %9 : $*Int64
174
196
store %7 to %0 : $*Obj
0 commit comments