@@ -34,14 +34,17 @@ sil [ossa] [transparent] @partial_apply_on_stack_nesting_violator : $@convention
34
34
35
35
// Verify that when inlining partial_apply_on_stack_nesting_violator, the stack
36
36
// nesting of the on_stack closures is fixed.
37
- // CHECK-LABEL: sil [no_locks] [perf_constraint] @test_inline_stack_violating_ossa_func : {{.*}} {
37
+ //
38
+ // NON_OSSA: stack nesting is not fixed until after OSSA lowering. These tests only run mandatory optimization.
39
+ //
40
+ // CHECK-LABEL: sil [no_locks] [perf_constraint] [ossa] @test_inline_stack_violating_ossa_func : {{.*}} {
38
41
// CHECK: [[PAABLE:%[^,]+]] = function_ref @paable
39
42
// CHECK: [[FIRST:%[^,]+]] = partial_apply [callee_guaranteed] [on_stack] [[PAABLE]]
40
43
// CHECK: [[SECOND:%[^,]+]] = partial_apply [callee_guaranteed] [on_stack] [[PAABLE]]
41
- // CHECK: dealloc_stack [[SECOND]]
42
- // CHECK: dealloc_stack [[FIRST]]
44
+ // NON_OSSA: dealloc_stack [[SECOND]]
45
+ // NON_OSSA: dealloc_stack [[FIRST]]
43
46
// CHECK-LABEL: } // end sil function 'test_inline_stack_violating_ossa_func'
44
- sil [no_locks] @test_inline_stack_violating_ossa_func : $@convention(thin) () -> () {
47
+ sil [no_locks] [ossa] @test_inline_stack_violating_ossa_func : $@convention(thin) () -> () {
45
48
%callee = function_ref @partial_apply_on_stack_nesting_violator : $@convention(thin) <T> () -> ()
46
49
apply %callee<Builtin.Int64>() : $@convention(thin) <T> () -> ()
47
50
%retval = tuple ()
69
72
return %retval : $Builtin.Int64
70
73
}
71
74
72
- // CHECK-LABEL: sil [no_allocation] [perf_constraint] @deserialize_and_inline_after_devirtualize
75
+ // CHECK-LABEL: sil [no_allocation] [perf_constraint] [ossa] @deserialize_and_inline_after_devirtualize
73
76
// CHECK-NOT: apply
74
77
// CHECK: } // end sil function 'deserialize_and_inline_after_devirtualize'
75
- sil [no_allocation] @deserialize_and_inline_after_devirtualize : $@convention(thin) (@in Int) -> () {
78
+ sil [no_allocation] [ossa] @deserialize_and_inline_after_devirtualize : $@convention(thin) (@in Int) -> () {
76
79
bb0(%0 : $*Int):
77
80
%1 = metatype $@thick Int.Type
78
81
%2 = witness_method $Int, #Comparable."<" : <Self where Self : Comparable> (Self.Type) -> (Self, Self) -> Bool : $@convention(witness_method: Comparable) <τ_0_0 where τ_0_0 : Comparable> (@in_guaranteed τ_0_0, @in_guaranteed τ_0_0, @thick τ_0_0.Type) -> Bool
@@ -95,25 +98,11 @@ bb0(%0 : $Builtin.Int32):
95
98
return %2 : $Builtin.Int32
96
99
}
97
100
98
- // CHECK-LABEL: sil [no_allocation] [perf_constraint] @dont_do_dead_alloc_elimination_on_non_ossa
99
- // CHECK: alloc_stack
100
- // CHECK-NOT: load
101
- // CHECK: return %0
102
- // CHECK: } // end sil function 'dont_do_dead_alloc_elimination_on_non_ossa'
103
- sil [no_allocation] @dont_do_dead_alloc_elimination_on_non_ossa : $@convention(thin) (Builtin.Int32) -> Builtin.Int32 {
104
- bb0(%0 : $Builtin.Int32):
105
- %1 = alloc_stack $Builtin.Int32
106
- store %0 to %1 : $*Builtin.Int32
107
- %2 = load %1 : $*Builtin.Int32
108
- dealloc_stack %1 : $*Builtin.Int32
109
- return %2 : $Builtin.Int32
110
- }
111
-
112
- // CHECK-LABEL: sil [no_allocation] [perf_constraint] @dead_metatype :
101
+ // CHECK-LABEL: sil [no_allocation] [perf_constraint] [ossa] @dead_metatype :
113
102
// CHECK-NOT: metatype
114
103
// CHECK-NOT: debug_value
115
104
// CHECK: } // end sil function 'dead_metatype'
116
- sil [no_allocation] @dead_metatype : $@convention(thin) () -> () {
105
+ sil [no_allocation] [ossa] @dead_metatype : $@convention(thin) () -> () {
117
106
bb0:
118
107
%0 = metatype $@thick Int.Type
119
108
debug_value %0 : $@thick Int.Type
@@ -132,47 +121,47 @@ sil_witness_table public_external [serialized] Int: Comparable module Swift {
132
121
method #Comparable."<": <Self where Self : Comparable> (Self.Type) -> (Self, Self) -> Bool : @$sSiSLsSL1loiySbx_xtFZTW
133
122
}
134
123
135
- sil @get_int_value : $@convention(thin) () -> Int32 {
124
+ sil [ossa] @get_int_value : $@convention(thin) () -> Int32 {
136
125
bb0:
137
126
%0 = integer_literal $Builtin.Int32, 10
138
127
%1 = struct $Int32 (%0 : $Builtin.Int32)
139
128
return %1 : $Int32
140
129
}
141
130
142
- // CHECK-LABEL: sil [global_init_once_fn] [no_locks] [perf_constraint] @globalinit_inline_into_init :
131
+ // CHECK-LABEL: sil [global_init_once_fn] [no_locks] [perf_constraint] [ossa] @globalinit_inline_into_init :
143
132
// CHECK-NOT: apply
144
133
// CHECK: } // end sil function 'globalinit_inline_into_init'
145
- sil [global_init_once_fn] [no_locks] @globalinit_inline_into_init : $@convention(c) () -> () {
134
+ sil [global_init_once_fn] [no_locks] [ossa] @globalinit_inline_into_init : $@convention(c) () -> () {
146
135
bb0:
147
136
alloc_global @g1
148
137
%1 = global_addr @g1 : $*Int32
149
138
%2 = function_ref @get_int_value : $@convention(thin) () -> Int32
150
139
%3 = apply %2() : $@convention(thin) () -> Int32
151
- store %3 to %1 : $*Int32
140
+ store %3 to [trivial] %1 : $*Int32
152
141
%6 = tuple ()
153
142
return %6 : $()
154
143
}
155
144
156
- // CHECK-LABEL: sil [serialized] [global_init_once_fn] [no_locks] [perf_constraint] @globalinit_dont_inline_non_inlinable_into_inlinable :
145
+ // CHECK-LABEL: sil [serialized] [global_init_once_fn] [no_locks] [perf_constraint] [ossa] @globalinit_dont_inline_non_inlinable_into_inlinable :
157
146
// CHECK: apply
158
147
// CHECK: } // end sil function 'globalinit_dont_inline_non_inlinable_into_inlinable'
159
- sil [serialized] [global_init_once_fn] [no_locks] @globalinit_dont_inline_non_inlinable_into_inlinable : $@convention(c) () -> () {
148
+ sil [serialized] [global_init_once_fn] [no_locks] [ossa] @globalinit_dont_inline_non_inlinable_into_inlinable : $@convention(c) () -> () {
160
149
bb0:
161
150
alloc_global @g2
162
151
%1 = global_addr @g2 : $*Int32
163
152
%2 = function_ref @get_int_value : $@convention(thin) () -> Int32
164
153
%3 = apply %2() : $@convention(thin) () -> Int32
165
- store %3 to %1 : $*Int32
154
+ store %3 to [trivial] %1 : $*Int32
166
155
%6 = tuple ()
167
156
return %6 : $()
168
157
}
169
158
170
159
// Check that we don't crash on global init-once declarations.
171
160
172
161
// CHECK-LABEL: sil [global_init_once_fn] [no_locks] @external_global_init_once : $@convention(c) () -> ()
173
- sil [global_init_once_fn] [no_locks] @external_global_init_once : $@convention(c) () -> ()
162
+ sil [global_init_once_fn] [no_locks] [ossa] @external_global_init_once : $@convention(c) () -> ()
174
163
175
- sil @yield_int_value : $@convention(thin) @yield_once () -> (@yields Int32) {
164
+ sil [ossa] @yield_int_value : $@convention(thin) @yield_once () -> (@yields Int32) {
176
165
bb0:
177
166
%0 = integer_literal $Builtin.Int32, 10
178
167
%1 = struct $Int32 (%0 : $Builtin.Int32)
@@ -184,21 +173,21 @@ bb2:
184
173
unwind
185
174
}
186
175
187
- // CHECK-LABEL: sil [no_locks] [perf_constraint] @inline_begin_apply :
176
+ // CHECK-LABEL: sil [no_locks] [perf_constraint] [ossa] @inline_begin_apply :
188
177
// CHECK-NOT: begin_apply
189
178
// CHECK: } // end sil function 'inline_begin_apply'
190
- sil [no_locks] @inline_begin_apply : $@convention(thin) () -> Int32 {
179
+ sil [no_locks] [ossa] @inline_begin_apply : $@convention(thin) () -> Int32 {
191
180
bb0:
192
181
%0 = function_ref @yield_int_value : $@convention(thin) @yield_once () -> (@yields Int32)
193
182
(%1, %2) = begin_apply %0() : $@convention(thin) @yield_once () -> (@yields Int32)
194
183
end_apply %2 as $()
195
184
return %1 : $Int32
196
185
}
197
186
198
- // CHECK-LABEL: sil [no_locks] [perf_constraint] @dont_inline_begin_apply :
187
+ // CHECK-LABEL: sil [no_locks] [perf_constraint] [ossa] @dont_inline_begin_apply :
199
188
// CHECK: begin_apply
200
189
// CHECK: } // end sil function 'dont_inline_begin_apply'
201
- sil [no_locks] @dont_inline_begin_apply : $@convention(thin) () -> Int32 {
190
+ sil [no_locks] [ossa] @dont_inline_begin_apply : $@convention(thin) () -> Int32 {
202
191
bb0:
203
192
%0 = function_ref @yield_int_value : $@convention(thin) @yield_once () -> (@yields Int32)
204
193
(%1, %2) = begin_apply %0() : $@convention(thin) @yield_once () -> (@yields Int32)
0 commit comments