1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-unknown-unknown -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-FAST
3 # RUN: llc -mtriple=aarch64-unknown-unknown -mattr=+addr-lsl-slow-14 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SLOW
6 define void @strxrox(ptr %addr) { ret void }
7 define void @strxrox_p0(ptr %addr) { ret void }
8 define void @strdrox(ptr %addr) { ret void }
9 define void @strwrox(ptr %addr) { ret void }
10 define void @strsrox(ptr %addr) { ret void }
11 define void @strhrox(ptr %addr) { ret void }
12 define void @strqrox(ptr %addr) { ret void }
13 define void @shl_fast_3(ptr %addr) { ret void }
14 define void @shl_slow_1(ptr %addr) { ret void }
15 define void @shl_slow_1_more_than_one_use(ptr %addr) { ret void }
16 define void @shl_slow_4(ptr %addr) { ret void }
17 define void @shl_slow_4_more_than_one_use(ptr %addr) { ret void }
18 define void @shl_p0(ptr %addr) { ret void }
26 tracksRegLiveness: true
27 machineFunctionInfo: {}
30 liveins: $x0, $x1, $x2
31 ; CHECK-LABEL: name: strxrox
32 ; CHECK: liveins: $x0, $x1, $x2
34 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
35 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
36 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr64 = COPY $x2
37 ; CHECK-NEXT: STRXroX [[COPY2]], [[COPY]], [[COPY1]], 0, 0 :: (store (s64) into %ir.addr)
39 %1:gpr(s64) = COPY $x1
40 %ptr:gpr(p0) = G_PTR_ADD %0, %1
41 %3:gpr(s64) = COPY $x2
42 G_STORE %3, %ptr :: (store (s64) into %ir.addr)
49 tracksRegLiveness: true
50 machineFunctionInfo: {}
53 liveins: $x0, $x1, $x2
54 ; CHECK-LABEL: name: strxrox_p0
55 ; CHECK: liveins: $x0, $x1, $x2
57 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
58 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
59 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr64all = COPY $x2
60 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr64 = COPY [[COPY2]]
61 ; CHECK-NEXT: STRXroX [[COPY3]], [[COPY]], [[COPY1]], 0, 0 :: (store (p0) into %ir.addr)
63 %1:gpr(s64) = COPY $x1
64 %ptr:gpr(p0) = G_PTR_ADD %0, %1
66 G_STORE %3, %ptr :: (store (p0) into %ir.addr)
73 tracksRegLiveness: true
74 machineFunctionInfo: {}
77 liveins: $x0, $x1, $d2
78 ; CHECK-LABEL: name: strdrox
79 ; CHECK: liveins: $x0, $x1, $d2
81 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
82 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
83 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:fpr64 = COPY $d2
84 ; CHECK-NEXT: STRDroX [[COPY2]], [[COPY]], [[COPY1]], 0, 0 :: (store (s64) into %ir.addr)
86 %1:gpr(s64) = COPY $x1
87 %ptr:gpr(p0) = G_PTR_ADD %0, %1
88 %3:fpr(s64) = COPY $d2
89 G_STORE %3, %ptr :: (store (s64) into %ir.addr)
96 tracksRegLiveness: true
97 machineFunctionInfo: {}
100 liveins: $x0, $x1, $w2
101 ; CHECK-LABEL: name: strwrox
102 ; CHECK: liveins: $x0, $x1, $w2
104 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
105 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
106 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr32 = COPY $w2
107 ; CHECK-NEXT: STRWroX [[COPY2]], [[COPY]], [[COPY1]], 0, 0 :: (store (s32) into %ir.addr)
108 %0:gpr(p0) = COPY $x0
109 %1:gpr(s64) = COPY $x1
110 %ptr:gpr(p0) = G_PTR_ADD %0, %1
111 %3:gpr(s32) = COPY $w2
112 G_STORE %3, %ptr :: (store (s32) into %ir.addr)
118 regBankSelected: true
119 tracksRegLiveness: true
120 machineFunctionInfo: {}
123 liveins: $x0, $x1, $s2
124 ; CHECK-LABEL: name: strsrox
125 ; CHECK: liveins: $x0, $x1, $s2
127 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
128 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
129 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:fpr32 = COPY $s2
130 ; CHECK-NEXT: STRSroX [[COPY2]], [[COPY]], [[COPY1]], 0, 0 :: (store (s32) into %ir.addr)
131 %0:gpr(p0) = COPY $x0
132 %1:gpr(s64) = COPY $x1
133 %ptr:gpr(p0) = G_PTR_ADD %0, %1
134 %3:fpr(s32) = COPY $s2
135 G_STORE %3, %ptr :: (store (s32) into %ir.addr)
141 regBankSelected: true
142 tracksRegLiveness: true
143 machineFunctionInfo: {}
146 liveins: $x0, $x1, $h0
147 ; CHECK-LABEL: name: strhrox
148 ; CHECK: liveins: $x0, $x1, $h0
150 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
151 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
152 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:fpr16 = COPY $h0
153 ; CHECK-NEXT: STRHroX [[COPY2]], [[COPY]], [[COPY1]], 0, 0 :: (store (s16) into %ir.addr)
154 %0:gpr(p0) = COPY $x0
155 %1:gpr(s64) = COPY $x1
156 %ptr:gpr(p0) = G_PTR_ADD %0, %1
157 %3:fpr(s16) = COPY $h0
158 G_STORE %3, %ptr :: (store (s16) into %ir.addr)
164 regBankSelected: true
165 tracksRegLiveness: true
166 machineFunctionInfo: {}
169 liveins: $x0, $x1, $q2
170 ; CHECK-LABEL: name: strqrox
171 ; CHECK: liveins: $x0, $x1, $q2
173 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
174 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
175 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:fpr128 = COPY $q2
176 ; CHECK-NEXT: STRQroX [[COPY2]], [[COPY]], [[COPY1]], 0, 0 :: (store (<2 x s64>) into %ir.addr)
177 %0:gpr(p0) = COPY $x0
178 %1:gpr(s64) = COPY $x1
179 %ptr:gpr(p0) = G_PTR_ADD %0, %1
180 %2:fpr(<2 x s64>) = COPY $q2
181 G_STORE %2, %ptr :: (store (<2 x s64>) into %ir.addr)
187 regBankSelected: true
188 tracksRegLiveness: true
189 machineFunctionInfo: {}
192 liveins: $x0, $x1, $x2
193 ; CHECK-LABEL: name: shl_fast_3
194 ; CHECK: liveins: $x0, $x1, $x2
196 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
197 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64sp = COPY $x1
198 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr64 = COPY $x2
199 ; CHECK-NEXT: STRXroX [[COPY2]], [[COPY1]], [[COPY]], 0, 1 :: (store (s64) into %ir.addr)
200 %0:gpr(s64) = COPY $x0
201 %1:gpr(s64) = G_CONSTANT i64 3
202 %2:gpr(s64) = G_SHL %0, %1(s64)
203 %3:gpr(p0) = COPY $x1
204 %ptr:gpr(p0) = G_PTR_ADD %3, %2
205 %4:gpr(s64) = COPY $x2
206 G_STORE %4, %ptr :: (store (s64) into %ir.addr)
212 regBankSelected: true
213 tracksRegLiveness: true
214 machineFunctionInfo: {}
217 liveins: $x0, $x1, $x2
218 ; CHECK-LABEL: name: shl_slow_1
219 ; CHECK: liveins: $x0, $x1, $x2
221 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
222 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64sp = COPY $x1
223 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr64 = COPY $x2
224 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr32 = COPY [[COPY2]].sub_32
225 ; CHECK-NEXT: STRHHroX [[COPY3]], [[COPY1]], [[COPY]], 0, 1 :: (store (s16) into %ir.addr)
226 %0:gpr(s64) = COPY $x0
227 %1:gpr(s64) = G_CONSTANT i64 1
228 %2:gpr(s64) = G_SHL %0, %1(s64)
229 %3:gpr(p0) = COPY $x1
230 %ptr:gpr(p0) = G_PTR_ADD %3, %2
231 %4:gpr(s64) = COPY $x2
232 G_STORE %4, %ptr :: (store (s16) into %ir.addr)
235 name: shl_slow_1_more_than_one_use
238 regBankSelected: true
239 tracksRegLiveness: true
240 machineFunctionInfo: {}
243 liveins: $x0, $x1, $x2
244 ; CHECK-FAST-LABEL: name: shl_slow_1_more_than_one_use
245 ; CHECK-FAST: liveins: $x0, $x1, $x2
246 ; CHECK-FAST-NEXT: {{ $}}
247 ; CHECK-FAST-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
248 ; CHECK-FAST-NEXT: [[COPY1:%[0-9]+]]:gpr64sp = COPY $x1
249 ; CHECK-FAST-NEXT: [[COPY2:%[0-9]+]]:gpr64 = COPY $x2
250 ; CHECK-FAST-NEXT: [[COPY3:%[0-9]+]]:gpr32 = COPY [[COPY2]].sub_32
251 ; CHECK-FAST-NEXT: STRHHroX [[COPY3]], [[COPY1]], [[COPY]], 0, 1 :: (store (s16) into %ir.addr)
252 ; CHECK-FAST-NEXT: [[COPY4:%[0-9]+]]:gpr32 = COPY [[COPY2]].sub_32
253 ; CHECK-FAST-NEXT: STRHHroX [[COPY4]], [[COPY1]], [[COPY]], 0, 1 :: (store (s16) into %ir.addr)
255 ; CHECK-SLOW-LABEL: name: shl_slow_1_more_than_one_use
256 ; CHECK-SLOW: liveins: $x0, $x1, $x2
257 ; CHECK-SLOW-NEXT: {{ $}}
258 ; CHECK-SLOW-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
259 ; CHECK-SLOW-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
260 ; CHECK-SLOW-NEXT: %ptr:gpr64common = ADDXrs [[COPY1]], [[COPY]], 1
261 ; CHECK-SLOW-NEXT: [[COPY2:%[0-9]+]]:gpr64 = COPY $x2
262 ; CHECK-SLOW-NEXT: [[COPY3:%[0-9]+]]:gpr32 = COPY [[COPY2]].sub_32
263 ; CHECK-SLOW-NEXT: STRHHui [[COPY3]], %ptr, 0 :: (store (s16) into %ir.addr)
264 ; CHECK-SLOW-NEXT: [[COPY4:%[0-9]+]]:gpr32 = COPY [[COPY2]].sub_32
265 ; CHECK-SLOW-NEXT: STRHHui [[COPY4]], %ptr, 0 :: (store (s16) into %ir.addr)
266 %0:gpr(s64) = COPY $x0
267 %1:gpr(s64) = G_CONSTANT i64 1
268 %2:gpr(s64) = G_SHL %0, %1(s64)
269 %3:gpr(p0) = COPY $x1
270 %ptr:gpr(p0) = G_PTR_ADD %3, %2
271 %4:gpr(s64) = COPY $x2
272 %5:gpr(s16) = G_TRUNC %4
273 G_STORE %4, %ptr :: (store (s16) into %ir.addr)
274 G_STORE %4, %ptr :: (store (s16) into %ir.addr)
280 regBankSelected: true
281 tracksRegLiveness: true
282 machineFunctionInfo: {}
285 liveins: $x0, $x1, $x2, $q0
286 ; CHECK-LABEL: name: shl_slow_4
287 ; CHECK: liveins: $x0, $x1, $x2, $q0
289 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
290 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64sp = COPY $x1
291 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:fpr128 = COPY $q0
292 ; CHECK-NEXT: STRQroX [[COPY2]], [[COPY1]], [[COPY]], 0, 1 :: (store (s128) into %ir.addr)
293 %0:gpr(s64) = COPY $x0
294 %1:gpr(s64) = G_CONSTANT i64 4
295 %2:gpr(s64) = G_SHL %0, %1(s64)
296 %3:gpr(p0) = COPY $x1
297 %ptr:gpr(p0) = G_PTR_ADD %3, %2
298 %5:fpr(s128) = COPY $q0
299 G_STORE %5, %ptr :: (store (s128) into %ir.addr)
302 name: shl_slow_4_more_than_one_use
305 regBankSelected: true
306 tracksRegLiveness: true
307 machineFunctionInfo: {}
310 liveins: $x0, $x1, $x2, $q0
311 ; CHECK-FAST-LABEL: name: shl_slow_4_more_than_one_use
312 ; CHECK-FAST: liveins: $x0, $x1, $x2, $q0
313 ; CHECK-FAST-NEXT: {{ $}}
314 ; CHECK-FAST-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
315 ; CHECK-FAST-NEXT: [[COPY1:%[0-9]+]]:gpr64sp = COPY $x1
316 ; CHECK-FAST-NEXT: [[COPY2:%[0-9]+]]:fpr128 = COPY $q0
317 ; CHECK-FAST-NEXT: STRQroX [[COPY2]], [[COPY1]], [[COPY]], 0, 1 :: (store (s128) into %ir.addr)
318 ; CHECK-FAST-NEXT: STRQroX [[COPY2]], [[COPY1]], [[COPY]], 0, 1 :: (store (s128) into %ir.addr)
320 ; CHECK-SLOW-LABEL: name: shl_slow_4_more_than_one_use
321 ; CHECK-SLOW: liveins: $x0, $x1, $x2, $q0
322 ; CHECK-SLOW-NEXT: {{ $}}
323 ; CHECK-SLOW-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
324 ; CHECK-SLOW-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
325 ; CHECK-SLOW-NEXT: %ptr:gpr64common = ADDXrs [[COPY1]], [[COPY]], 4
326 ; CHECK-SLOW-NEXT: [[COPY2:%[0-9]+]]:fpr128 = COPY $q0
327 ; CHECK-SLOW-NEXT: STRQui [[COPY2]], %ptr, 0 :: (store (s128) into %ir.addr)
328 ; CHECK-SLOW-NEXT: STRQui [[COPY2]], %ptr, 0 :: (store (s128) into %ir.addr)
329 %0:gpr(s64) = COPY $x0
330 %1:gpr(s64) = G_CONSTANT i64 4
331 %2:gpr(s64) = G_SHL %0, %1(s64)
332 %3:gpr(p0) = COPY $x1
333 %ptr:gpr(p0) = G_PTR_ADD %3, %2
334 %5:fpr(s128) = COPY $q0
335 G_STORE %5, %ptr :: (store (s128) into %ir.addr)
336 G_STORE %5, %ptr :: (store (s128) into %ir.addr)
342 regBankSelected: true
343 tracksRegLiveness: true
344 machineFunctionInfo: {}
347 liveins: $x0, $x1, $x2
348 ; CHECK-LABEL: name: shl_p0
349 ; CHECK: liveins: $x0, $x1, $x2
351 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
352 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64sp = COPY $x1
353 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr64all = COPY $x2
354 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr64 = COPY [[COPY2]]
355 ; CHECK-NEXT: STRXroX [[COPY3]], [[COPY1]], [[COPY]], 0, 1 :: (store (p0) into %ir.addr)
356 %0:gpr(s64) = COPY $x0
357 %1:gpr(s64) = G_CONSTANT i64 3
358 %2:gpr(s64) = G_SHL %0, %1(s64)
359 %3:gpr(p0) = COPY $x1
360 %ptr:gpr(p0) = G_PTR_ADD %3, %2
361 %4:gpr(p0) = COPY $x2
362 G_STORE %4, %ptr :: (store (p0) into %ir.addr)