[AMDGPU] Add True16 register classes.
[llvm-project.git] / llvm / test / Transforms / Inline / AArch64 / sme-pstatesm-attrs.ll
blob4e7074ec75dd63ee5263734090056d588be37f71
1 ; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -mattr=+sme -S -passes=inline | FileCheck %s
3 declare void @inlined_body() "aarch64_pstate_sm_compatible";
6 ; Define some functions that will be called by the functions below.
7 ; These just call a '...body()' function. If we see the call to one of
8 ; these functions being replaced by '...body()', then we know it has been
9 ; inlined.
12 define void @normal_callee() {
13 entry:
14   call void @inlined_body()
15   ret void
18 define void @streaming_callee() "aarch64_pstate_sm_enabled" {
19 entry:
20   call void @inlined_body()
21   ret void
24 define void @locally_streaming_callee() "aarch64_pstate_sm_body" {
25 entry:
26   call void @inlined_body()
27   ret void
30 define void @streaming_compatible_callee() "aarch64_pstate_sm_compatible" {
31 entry:
32   call void @inlined_body()
33   ret void
36 define void @streaming_compatible_locally_streaming_callee() "aarch64_pstate_sm_compatible" "aarch64_pstate_sm_body" {
37 entry:
38   call void @inlined_body()
39   ret void
43 ; Now test that inlining only happens when their streaming modes match.
44 ; Test for a number of combinations, where:
45 ; N       Normal-interface (PSTATE.SM=0 on entry/exit)
46 ; S       Streaming-interface (PSTATE.SM=1 on entry/exit)
47 ; SC      Streaming-compatible interface
48 ;         (PSTATE.SM=0 or 1, unchanged on exit)
49 ; N + B   Normal-interface, streaming body
50 ;         (PSTATE.SM=0 on entry/exit, but 1 within the body of the function)
51 ; SC + B  Streaming-compatible-interface, streaming body
52 ;         (PSTATE.SM=0 or 1 on entry, unchanged on exit,
53 ;          but guaranteed to be 1 within the body of the function)
55 ; [x] N  -> N
56 ; [ ] N  -> S
57 ; [ ] N  -> SC
58 ; [ ] N  -> N + B
59 ; [ ] N  -> SC + B
60 define void @normal_caller_normal_callee_inline() {
61 ; CHECK-LABEL: @normal_caller_normal_callee_inline(
62 ; CHECK: call void @inlined_body()
63 entry:
64   call void @normal_callee()
65   ret void
68 ; [ ] N  -> N
69 ; [x] N  -> S
70 ; [ ] N  -> SC
71 ; [ ] N  -> N + B
72 ; [ ] N  -> SC + B
73 define void @normal_caller_streaming_callee_dont_inline() {
74 ; CHECK-LABEL: @normal_caller_streaming_callee_dont_inline(
75 ; CHECK: call void @streaming_callee()
76 entry:
77   call void @streaming_callee()
78   ret void
81 ; [ ] N  -> N
82 ; [ ] N  -> S
83 ; [x] N  -> SC
84 ; [ ] N  -> N + B
85 ; [ ] N  -> SC + B
86 define void @normal_caller_streaming_compatible_callee_inline() {
87 ; CHECK-LABEL: @normal_caller_streaming_compatible_callee_inline(
88 ; CHECK: call void @inlined_body()
89 entry:
90   call void @streaming_compatible_callee()
91   ret void
94 ; [ ] N  -> N
95 ; [ ] N  -> S
96 ; [ ] N  -> SC
97 ; [x] N  -> N + B
98 ; [ ] N  -> SC + B
99 define void @normal_caller_locally_streaming_callee_dont_inline() {
100 ; CHECK-LABEL: @normal_caller_locally_streaming_callee_dont_inline(
101 ; CHECK: call void @locally_streaming_callee()
102 entry:
103   call void @locally_streaming_callee()
104   ret void
107 ; [ ] N  -> N
108 ; [ ] N  -> S
109 ; [ ] N  -> SC
110 ; [ ] N  -> N + B
111 ; [x] N  -> SC + B
112 define void @normal_caller_streaming_compatible_locally_streaming_callee_dont_inline() {
113 ; CHECK-LABEL: @normal_caller_streaming_compatible_locally_streaming_callee_dont_inline(
114 ; CHECK: call void @streaming_compatible_locally_streaming_callee()
115 entry:
116   call void @streaming_compatible_locally_streaming_callee()
117   ret void
120 ; [x] S  -> N
121 ; [ ] S  -> S
122 ; [ ] S  -> SC
123 ; [ ] S  -> N + B
124 ; [ ] S  -> SC + B
125 define void @streaming_caller_normal_callee_dont_inline() "aarch64_pstate_sm_enabled" {
126 ; CHECK-LABEL: @streaming_caller_normal_callee_dont_inline(
127 ; CHECK: call void @normal_callee()
128 entry:
129   call void @normal_callee()
130   ret void
133 ; [ ] S  -> N
134 ; [x] S  -> S
135 ; [ ] S  -> SC
136 ; [ ] S  -> N + B
137 ; [ ] S  -> SC + B
138 define void @streaming_caller_streaming_callee_inline() "aarch64_pstate_sm_enabled" {
139 ; CHECK-LABEL: @streaming_caller_streaming_callee_inline(
140 ; CHECK: call void @inlined_body()
141 entry:
142   call void @streaming_callee()
143   ret void
146 ; [ ] S  -> N
147 ; [ ] S  -> S
148 ; [x] S  -> SC
149 ; [ ] S  -> N + B
150 ; [ ] S  -> SC + B
151 define void @streaming_caller_streaming_compatible_callee_inline() "aarch64_pstate_sm_enabled" {
152 ; CHECK-LABEL: @streaming_caller_streaming_compatible_callee_inline(
153 ; CHECK: call void @inlined_body()
154 entry:
155   call void @streaming_compatible_callee()
156   ret void
159 ; [ ] S  -> N
160 ; [ ] S  -> S
161 ; [ ] S  -> SC
162 ; [x] S  -> N + B
163 ; [ ] S  -> SC + B
164 define void @streaming_caller_locally_streaming_callee_inline() "aarch64_pstate_sm_enabled" {
165 ; CHECK-LABEL: @streaming_caller_locally_streaming_callee_inline(
166 ; CHECK: call void @inlined_body()
167 entry:
168   call void @locally_streaming_callee()
169   ret void
172 ; [ ] S  -> N
173 ; [ ] S  -> S
174 ; [ ] S  -> SC
175 ; [ ] S  -> N + B
176 ; [x] S  -> SC + B
177 define void @streaming_caller_streaming_compatible_locally_streaming_callee_inline() "aarch64_pstate_sm_enabled" {
178 ; CHECK-LABEL: @streaming_caller_streaming_compatible_locally_streaming_callee_inline(
179 ; CHECK: call void @inlined_body()
180 entry:
181   call void @streaming_compatible_locally_streaming_callee()
182   ret void
185 ; [x] N + B -> N
186 ; [ ] N + B -> S
187 ; [ ] N + B -> SC
188 ; [ ] N + B -> N + B
189 ; [ ] N + B -> SC + B
190 define void @locally_streaming_caller_normal_callee_dont_inline() "aarch64_pstate_sm_body" {
191 ; CHECK-LABEL: @locally_streaming_caller_normal_callee_dont_inline(
192 ; CHECK: call void @normal_callee()
193 entry:
194   call void @normal_callee()
195   ret void
198 ; [ ] N + B -> N
199 ; [x] N + B -> S
200 ; [ ] N + B -> SC
201 ; [ ] N + B -> N + B
202 ; [ ] N + B -> SC + B
203 define void @locally_streaming_caller_streaming_callee_inline() "aarch64_pstate_sm_body" {
204 ; CHECK-LABEL: @locally_streaming_caller_streaming_callee_inline(
205 ; CHECK: call void @inlined_body()
206 entry:
207   call void @streaming_callee()
208   ret void
211 ; [ ] N + B -> N
212 ; [ ] N + B -> S
213 ; [x] N + B -> SC
214 ; [ ] N + B -> N + B
215 ; [ ] N + B -> SC + B
216 define void @locally_streaming_caller_streaming_compatible_callee_inline() "aarch64_pstate_sm_body" {
217 ; CHECK-LABEL: @locally_streaming_caller_streaming_compatible_callee_inline(
218 ; CHECK: call void @inlined_body()
219 entry:
220   call void @streaming_compatible_callee()
221   ret void
224 ; [ ] N + B -> N
225 ; [ ] N + B -> S
226 ; [ ] N + B -> SC
227 ; [x] N + B -> N + B
228 ; [ ] N + B -> SC + B
229 define void @locally_streaming_caller_locally_streaming_callee_inline() "aarch64_pstate_sm_body" {
230 ; CHECK-LABEL: @locally_streaming_caller_locally_streaming_callee_inline(
231 ; CHECK: call void @inlined_body()
232 entry:
233   call void @locally_streaming_callee()
234   ret void
237 ; [ ] N + B -> N
238 ; [ ] N + B -> S
239 ; [ ] N + B -> SC
240 ; [ ] N + B -> N + B
241 ; [x] N + B -> SC + B
242 define void @locally_streaming_caller_streaming_compatible_locally_streaming_callee_inline() "aarch64_pstate_sm_body" {
243 ; CHECK-LABEL: @locally_streaming_caller_streaming_compatible_locally_streaming_callee_inline(
244 ; CHECK: call void @inlined_body()
245 entry:
246   call void @streaming_compatible_locally_streaming_callee()
247   ret void
250 ; [x] SC -> N
251 ; [ ] SC -> S
252 ; [ ] SC -> SC
253 ; [ ] SC -> N + B
254 ; [ ] SC -> SC + B
255 define void @streaming_compatible_caller_normal_callee_dont_inline() "aarch64_pstate_sm_compatible" {
256 ; CHECK-LABEL: @streaming_compatible_caller_normal_callee_dont_inline(
257 ; CHECK: call void @normal_callee()
258 entry:
259   call void @normal_callee()
260   ret void
263 ; [ ] SC -> N
264 ; [x] SC -> S
265 ; [ ] SC -> SC
266 ; [ ] SC -> N + B
267 ; [ ] SC -> SC + B
268 define void @streaming_compatible_caller_streaming_callee_dont_inline() "aarch64_pstate_sm_compatible" {
269 ; CHECK-LABEL: @streaming_compatible_caller_streaming_callee_dont_inline(
270 ; CHECK: call void @streaming_callee()
271 entry:
272   call void @streaming_callee()
273   ret void
276 ; [ ] SC -> N
277 ; [ ] SC -> S
278 ; [x] SC -> SC
279 ; [ ] SC -> N + B
280 ; [ ] SC -> SC + B
281 define void @streaming_compatible_caller_streaming_compatible_callee_inline() "aarch64_pstate_sm_compatible" {
282 ; CHECK-LABEL: @streaming_compatible_caller_streaming_compatible_callee_inline(
283 ; CHECK: call void @inlined_body()
284 entry:
285   call void @streaming_compatible_callee()
286   ret void
289 ; [ ] SC -> N
290 ; [ ] SC -> S
291 ; [ ] SC -> SC
292 ; [x] SC -> N + B
293 ; [ ] SC -> SC + B
294 define void @streaming_compatible_caller_locally_streaming_callee_dont_inline() "aarch64_pstate_sm_compatible" {
295 ; CHECK-LABEL: @streaming_compatible_caller_locally_streaming_callee_dont_inline(
296 ; CHECK: call void @locally_streaming_callee()
297 entry:
298   call void @locally_streaming_callee()
299   ret void
302 ; [ ] SC -> N
303 ; [ ] SC -> S
304 ; [ ] SC -> SC
305 ; [ ] SC -> N + B
306 ; [x] SC -> SC + B
307 define void @streaming_compatible_caller_streaming_compatible_locally_streaming_callee_dont_inline() "aarch64_pstate_sm_compatible" {
308 ; CHECK-LABEL: @streaming_compatible_caller_streaming_compatible_locally_streaming_callee_dont_inline(
309 ; CHECK: call void @streaming_compatible_locally_streaming_callee()
310 entry:
311   call void @streaming_compatible_locally_streaming_callee()
312   ret void
314 ; [x] SC + B -> N
315 ; [ ] SC + B -> S
316 ; [ ] SC + B -> SC
317 ; [ ] SC + B -> N + B
318 ; [ ] SC + B -> SC + B
319 define void @streaming_compatible_locally_streaming_caller_normal_callee_dont_inline() "aarch64_pstate_sm_compatible" "aarch64_pstate_sm_body" {
320 ; CHECK-LABEL: @streaming_compatible_locally_streaming_caller_normal_callee_dont_inline(
321 ; CHECK: call void @normal_callee()
322 entry:
323   call void @normal_callee()
324   ret void
327 ; [ ] SC + B -> N
328 ; [x] SC + B -> S
329 ; [ ] SC + B -> SC
330 ; [ ] SC + B -> N + B
331 ; [ ] SC + B -> SC + B
332 define void @streaming_compatible_locally_streaming_caller_streaming_callee_inline() "aarch64_pstate_sm_compatible" "aarch64_pstate_sm_body" {
333 ; CHECK-LABEL: @streaming_compatible_locally_streaming_caller_streaming_callee_inline(
334 ; CHECK: call void @inlined_body()
335 entry:
336   call void @streaming_callee()
337   ret void
340 ; [ ] SC + B -> N
341 ; [ ] SC + B -> S
342 ; [x] SC + B -> SC
343 ; [ ] SC + B -> N + B
344 ; [ ] SC + B -> SC + B
345 define void @streaming_compatible_locally_streaming_caller_streaming_compatible_callee_inline() "aarch64_pstate_sm_compatible" "aarch64_pstate_sm_body" {
346 ; CHECK-LABEL: @streaming_compatible_locally_streaming_caller_streaming_compatible_callee_inline(
347 ; CHECK: call void @inlined_body()
348 entry:
349   call void @streaming_compatible_callee()
350   ret void
353 ; [ ] SC + B -> N
354 ; [ ] SC + B -> S
355 ; [ ] SC + B -> SC
356 ; [x] SC + B -> N + B
357 ; [ ] SC + B -> SC + B
358 define void @streaming_compatible_locally_streaming_caller_locally_streaming_callee_inline() "aarch64_pstate_sm_compatible" "aarch64_pstate_sm_body" {
359 ; CHECK-LABEL: @streaming_compatible_locally_streaming_caller_locally_streaming_callee_inline(
360 ; CHECK: call void @inlined_body()
361 entry:
362   call void @locally_streaming_callee()
363   ret void
366 ; [ ] SC + B -> N
367 ; [ ] SC + B -> S
368 ; [ ] SC + B -> SC
369 ; [ ] SC + B -> N + B
370 ; [x] SC + B -> SC + B
371 define void @streaming_compatible_locally_streaming_caller_and_callee_inline() "aarch64_pstate_sm_compatible" "aarch64_pstate_sm_body" {
372 ; CHECK-LABEL: @streaming_compatible_locally_streaming_caller_and_callee_inline(
373 ; CHECK: call void @inlined_body()
374 entry:
375   call void @streaming_compatible_locally_streaming_callee()
376   ret void