1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s -mtriple aarch64 -verify-machineinstrs | FileCheck %s
4 define i64 @Str64Ldr64(ptr nocapture %P, i64 %v, i64 %n) {
5 ; CHECK-LABEL: Str64Ldr64:
6 ; CHECK: // %bb.0: // %entry
7 ; CHECK-NEXT: mov x8, x0
8 ; CHECK-NEXT: mov x0, x1
9 ; CHECK-NEXT: str x1, [x8, #8]
12 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 1
13 store i64 %v, ptr %arrayidx0
14 %arrayidx1 = getelementptr inbounds i64, ptr %P, i64 1
15 %0 = load i64, ptr %arrayidx1
19 define i32 @Str64Ldr32_0(ptr nocapture %P, i64 %v, i64 %n) {
20 ; CHECK-LABEL: Str64Ldr32_0:
21 ; CHECK: // %bb.0: // %entry
22 ; CHECK-NEXT: mov x8, x0
23 ; CHECK-NEXT: mov w0, w1
24 ; CHECK-NEXT: str x1, [x8, #8]
27 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 1
28 store i64 %v, ptr %arrayidx0
29 %arrayidx1 = getelementptr inbounds i32, ptr %P, i64 2
30 %0 = load i32, ptr %arrayidx1
34 define i32 @Str64Ldr32_1(ptr nocapture %P, i64 %v, i64 %n) {
35 ; CHECK-LABEL: Str64Ldr32_1:
36 ; CHECK: // %bb.0: // %entry
37 ; CHECK-NEXT: str x1, [x0, #8]
38 ; CHECK-NEXT: lsr x0, x1, #32
41 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 1
42 store i64 %v, ptr %arrayidx0
43 %arrayidx1 = getelementptr inbounds i32, ptr %P, i64 3
44 %0 = load i32, ptr %arrayidx1
48 define i16 @Str64Ldr16_0(ptr nocapture %P, i64 %v, i64 %n) {
49 ; CHECK-LABEL: Str64Ldr16_0:
50 ; CHECK: // %bb.0: // %entry
51 ; CHECK-NEXT: mov x8, x0
52 ; CHECK-NEXT: mov w0, w1
53 ; CHECK-NEXT: str x1, [x8, #8]
56 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 1
57 store i64 %v, ptr %arrayidx0
58 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 4
59 %0 = load i16, ptr %arrayidx1
63 define i16 @Str64Ldr16_1(ptr nocapture %P, i64 %v, i64 %n) {
64 ; CHECK-LABEL: Str64Ldr16_1:
65 ; CHECK: // %bb.0: // %entry
66 ; CHECK-NEXT: str x1, [x0, #8]
67 ; CHECK-NEXT: ubfx x0, x1, #16, #16
70 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 1
71 store i64 %v, ptr %arrayidx0
72 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 5
73 %0 = load i16, ptr %arrayidx1
77 define i16 @Str64Ldr16_2(ptr nocapture %P, i64 %v, i64 %n) {
78 ; CHECK-LABEL: Str64Ldr16_2:
79 ; CHECK: // %bb.0: // %entry
80 ; CHECK-NEXT: str x1, [x0, #8]
81 ; CHECK-NEXT: ubfx x0, x1, #32, #16
84 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 1
85 store i64 %v, ptr %arrayidx0
86 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 6
87 %0 = load i16, ptr %arrayidx1
91 define i16 @Str64Ldr16_3(ptr nocapture %P, i64 %v, i64 %n) {
92 ; CHECK-LABEL: Str64Ldr16_3:
93 ; CHECK: // %bb.0: // %entry
94 ; CHECK-NEXT: str x1, [x0, #8]
95 ; CHECK-NEXT: lsr x0, x1, #48
98 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 1
99 store i64 %v, ptr %arrayidx0
100 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 7
101 %0 = load i16, ptr %arrayidx1
105 define i8 @Str64Ldr8_0(ptr nocapture %P, i64 %v, i64 %n) {
106 ; CHECK-LABEL: Str64Ldr8_0:
107 ; CHECK: // %bb.0: // %entry
108 ; CHECK-NEXT: mov x8, x0
109 ; CHECK-NEXT: mov w0, w1
110 ; CHECK-NEXT: str x1, [x8, #8]
113 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 1
114 store i64 %v, ptr %arrayidx0
115 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 8
116 %0 = load i8, ptr %arrayidx1
120 define i8 @Str64Ldr8_1(ptr nocapture %P, i64 %v, i64 %n) {
121 ; CHECK-LABEL: Str64Ldr8_1:
122 ; CHECK: // %bb.0: // %entry
123 ; CHECK-NEXT: str x1, [x0, #8]
124 ; CHECK-NEXT: ubfx x0, x1, #8, #8
127 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 1
128 store i64 %v, ptr %arrayidx0
129 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 9
130 %0 = load i8, ptr %arrayidx1
134 define i8 @Str64Ldr8_2(ptr nocapture %P, i64 %v, i64 %n) {
135 ; CHECK-LABEL: Str64Ldr8_2:
136 ; CHECK: // %bb.0: // %entry
137 ; CHECK-NEXT: str x1, [x0, #8]
138 ; CHECK-NEXT: ubfx x0, x1, #16, #8
141 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 1
142 store i64 %v, ptr %arrayidx0
143 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 10
144 %0 = load i8, ptr %arrayidx1
148 define i8 @Str64Ldr8_3(ptr nocapture %P, i64 %v, i64 %n) {
149 ; CHECK-LABEL: Str64Ldr8_3:
150 ; CHECK: // %bb.0: // %entry
151 ; CHECK-NEXT: str x1, [x0, #8]
152 ; CHECK-NEXT: ubfx x0, x1, #24, #8
155 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 1
156 store i64 %v, ptr %arrayidx0
157 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 11
158 %0 = load i8, ptr %arrayidx1
162 define i8 @Str64Ldr8_4(ptr nocapture %P, i64 %v, i64 %n) {
163 ; CHECK-LABEL: Str64Ldr8_4:
164 ; CHECK: // %bb.0: // %entry
165 ; CHECK-NEXT: str x1, [x0, #8]
166 ; CHECK-NEXT: ubfx x0, x1, #32, #8
169 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 1
170 store i64 %v, ptr %arrayidx0
171 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 12
172 %0 = load i8, ptr %arrayidx1
176 define i8 @Str64Ldr8_5(ptr nocapture %P, i64 %v, i64 %n) {
177 ; CHECK-LABEL: Str64Ldr8_5:
178 ; CHECK: // %bb.0: // %entry
179 ; CHECK-NEXT: str x1, [x0, #8]
180 ; CHECK-NEXT: ubfx x0, x1, #40, #8
183 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 1
184 store i64 %v, ptr %arrayidx0
185 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 13
186 %0 = load i8, ptr %arrayidx1
190 define i8 @Str64Ldr8_6(ptr nocapture %P, i64 %v, i64 %n) {
191 ; CHECK-LABEL: Str64Ldr8_6:
192 ; CHECK: // %bb.0: // %entry
193 ; CHECK-NEXT: str x1, [x0, #8]
194 ; CHECK-NEXT: ubfx x0, x1, #48, #8
197 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 1
198 store i64 %v, ptr %arrayidx0
199 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 14
200 %0 = load i8, ptr %arrayidx1
204 define i8 @Str64Ldr8_7(ptr nocapture %P, i64 %v, i64 %n) {
205 ; CHECK-LABEL: Str64Ldr8_7:
206 ; CHECK: // %bb.0: // %entry
207 ; CHECK-NEXT: str x1, [x0, #8]
208 ; CHECK-NEXT: lsr x0, x1, #56
211 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 1
212 store i64 %v, ptr %arrayidx0
213 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 15
214 %0 = load i8, ptr %arrayidx1
218 define i32 @Str32Ldr32(ptr nocapture %P, i32 %v, i64 %n) {
219 ; CHECK-LABEL: Str32Ldr32:
220 ; CHECK: // %bb.0: // %entry
221 ; CHECK-NEXT: mov x8, x0
222 ; CHECK-NEXT: mov w0, w1
223 ; CHECK-NEXT: str w1, [x8, #4]
226 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 1
227 store i32 %v, ptr %arrayidx0
228 %arrayidx1 = getelementptr inbounds i32, ptr %P, i64 1
229 %0 = load i32, ptr %arrayidx1
233 define i16 @Str32Ldr16_0(ptr nocapture %P, i32 %v, i64 %n) {
234 ; CHECK-LABEL: Str32Ldr16_0:
235 ; CHECK: // %bb.0: // %entry
236 ; CHECK-NEXT: mov x8, x0
237 ; CHECK-NEXT: mov w0, w1
238 ; CHECK-NEXT: str w1, [x8, #4]
241 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 1
242 store i32 %v, ptr %arrayidx0
243 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 2
244 %0 = load i16, ptr %arrayidx1
248 define i16 @Str32Ldr16_1(ptr nocapture %P, i32 %v, i64 %n) {
249 ; CHECK-LABEL: Str32Ldr16_1:
250 ; CHECK: // %bb.0: // %entry
251 ; CHECK-NEXT: str w1, [x0, #4]
252 ; CHECK-NEXT: lsr w0, w1, #16
255 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 1
256 store i32 %v, ptr %arrayidx0
257 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 3
258 %0 = load i16, ptr %arrayidx1
262 define i8 @Str32Ldr8_0(ptr nocapture %P, i32 %v, i64 %n) {
263 ; CHECK-LABEL: Str32Ldr8_0:
264 ; CHECK: // %bb.0: // %entry
265 ; CHECK-NEXT: mov x8, x0
266 ; CHECK-NEXT: mov w0, w1
267 ; CHECK-NEXT: str w1, [x8, #4]
270 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 1
271 store i32 %v, ptr %arrayidx0
272 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 4
273 %0 = load i8, ptr %arrayidx1
277 define i8 @Str32Ldr8_1(ptr nocapture %P, i32 %v, i64 %n) {
278 ; CHECK-LABEL: Str32Ldr8_1:
279 ; CHECK: // %bb.0: // %entry
280 ; CHECK-NEXT: str w1, [x0, #4]
281 ; CHECK-NEXT: ubfx w0, w1, #8, #8
284 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 1
285 store i32 %v, ptr %arrayidx0
286 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 5
287 %0 = load i8, ptr %arrayidx1
291 define i8 @Str32Ldr8_2(ptr nocapture %P, i32 %v, i64 %n) {
292 ; CHECK-LABEL: Str32Ldr8_2:
293 ; CHECK: // %bb.0: // %entry
294 ; CHECK-NEXT: str w1, [x0, #4]
295 ; CHECK-NEXT: ubfx w0, w1, #16, #8
298 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 1
299 store i32 %v, ptr %arrayidx0
300 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 6
301 %0 = load i8, ptr %arrayidx1
305 define i8 @Str32Ldr8_3(ptr nocapture %P, i32 %v, i64 %n) {
306 ; CHECK-LABEL: Str32Ldr8_3:
307 ; CHECK: // %bb.0: // %entry
308 ; CHECK-NEXT: str w1, [x0, #4]
309 ; CHECK-NEXT: lsr w0, w1, #24
312 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 1
313 store i32 %v, ptr %arrayidx0
314 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 7
315 %0 = load i8, ptr %arrayidx1
319 define i16 @Str16Ldr16(ptr nocapture %P, i16 %v, i64 %n) {
320 ; CHECK-LABEL: Str16Ldr16:
321 ; CHECK: // %bb.0: // %entry
322 ; CHECK-NEXT: mov x8, x0
323 ; CHECK-NEXT: mov w0, w1
324 ; CHECK-NEXT: strh w1, [x8, #2]
327 %arrayidx0 = getelementptr inbounds i16, ptr %P, i64 1
328 store i16 %v, ptr %arrayidx0
329 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 1
330 %0 = load i16, ptr %arrayidx1
334 define i8 @Str16Ldr8_0(ptr nocapture %P, i16 %v, i64 %n) {
335 ; CHECK-LABEL: Str16Ldr8_0:
336 ; CHECK: // %bb.0: // %entry
337 ; CHECK-NEXT: mov x8, x0
338 ; CHECK-NEXT: mov w0, w1
339 ; CHECK-NEXT: strh w1, [x8, #2]
342 %arrayidx0 = getelementptr inbounds i16, ptr %P, i64 1
343 store i16 %v, ptr %arrayidx0
344 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 2
345 %0 = load i8, ptr %arrayidx1
349 define i8 @Str16Ldr8_1(ptr nocapture %P, i16 %v, i64 %n) {
350 ; CHECK-LABEL: Str16Ldr8_1:
351 ; CHECK: // %bb.0: // %entry
352 ; CHECK-NEXT: strh w1, [x0, #2]
353 ; CHECK-NEXT: ubfx w0, w1, #8, #8
356 %arrayidx0 = getelementptr inbounds i16, ptr %P, i64 1
357 store i16 %v, ptr %arrayidx0
358 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 3
359 %0 = load i8, ptr %arrayidx1
364 define i64 @Unscaled_Str64Ldr64(ptr nocapture %P, i64 %v, i64 %n) {
365 ; CHECK-LABEL: Unscaled_Str64Ldr64:
366 ; CHECK: // %bb.0: // %entry
367 ; CHECK-NEXT: mov x8, x0
368 ; CHECK-NEXT: mov x0, x1
369 ; CHECK-NEXT: stur x1, [x8, #-8]
372 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 -1
373 store i64 %v, ptr %arrayidx0
374 %arrayidx1 = getelementptr inbounds i64, ptr %P, i64 -1
375 %0 = load i64, ptr %arrayidx1
379 define i32 @Unscaled_Str64Ldr32_0(ptr nocapture %P, i64 %v, i64 %n) {
380 ; CHECK-LABEL: Unscaled_Str64Ldr32_0:
381 ; CHECK: // %bb.0: // %entry
382 ; CHECK-NEXT: mov x8, x0
383 ; CHECK-NEXT: mov w0, w1
384 ; CHECK-NEXT: stur x1, [x8, #-8]
387 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 -1
388 store i64 %v, ptr %arrayidx0
389 %arrayidx1 = getelementptr inbounds i32, ptr %P, i64 -2
390 %0 = load i32, ptr %arrayidx1
394 define i32 @Unscaled_Str64Ldr32_1(ptr nocapture %P, i64 %v, i64 %n) {
395 ; CHECK-LABEL: Unscaled_Str64Ldr32_1:
396 ; CHECK: // %bb.0: // %entry
397 ; CHECK-NEXT: stur x1, [x0, #-8]
398 ; CHECK-NEXT: lsr x0, x1, #32
401 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 -1
402 store i64 %v, ptr %arrayidx0
403 %arrayidx1 = getelementptr inbounds i32, ptr %P, i64 -1
404 %0 = load i32, ptr %arrayidx1
408 define i16 @Unscaled_Str64Ldr16_0(ptr nocapture %P, i64 %v, i64 %n) {
409 ; CHECK-LABEL: Unscaled_Str64Ldr16_0:
410 ; CHECK: // %bb.0: // %entry
411 ; CHECK-NEXT: mov x8, x0
412 ; CHECK-NEXT: mov w0, w1
413 ; CHECK-NEXT: stur x1, [x8, #-8]
416 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 -1
417 store i64 %v, ptr %arrayidx0
418 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 -4
419 %0 = load i16, ptr %arrayidx1
423 define i16 @Unscaled_Str64Ldr16_1(ptr nocapture %P, i64 %v, i64 %n) {
424 ; CHECK-LABEL: Unscaled_Str64Ldr16_1:
425 ; CHECK: // %bb.0: // %entry
426 ; CHECK-NEXT: stur x1, [x0, #-8]
427 ; CHECK-NEXT: ubfx x0, x1, #16, #16
430 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 -1
431 store i64 %v, ptr %arrayidx0
432 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 -3
433 %0 = load i16, ptr %arrayidx1
437 define i16 @Unscaled_Str64Ldr16_2(ptr nocapture %P, i64 %v, i64 %n) {
438 ; CHECK-LABEL: Unscaled_Str64Ldr16_2:
439 ; CHECK: // %bb.0: // %entry
440 ; CHECK-NEXT: stur x1, [x0, #-8]
441 ; CHECK-NEXT: ubfx x0, x1, #32, #16
444 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 -1
445 store i64 %v, ptr %arrayidx0
446 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 -2
447 %0 = load i16, ptr %arrayidx1
451 define i16 @Unscaled_Str64Ldr16_3(ptr nocapture %P, i64 %v, i64 %n) {
452 ; CHECK-LABEL: Unscaled_Str64Ldr16_3:
453 ; CHECK: // %bb.0: // %entry
454 ; CHECK-NEXT: stur x1, [x0, #-8]
455 ; CHECK-NEXT: lsr x0, x1, #48
458 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 -1
459 store i64 %v, ptr %arrayidx0
460 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 -1
461 %0 = load i16, ptr %arrayidx1
465 define i8 @Unscaled_Str64Ldr8_0(ptr nocapture %P, i64 %v, i64 %n) {
466 ; CHECK-LABEL: Unscaled_Str64Ldr8_0:
467 ; CHECK: // %bb.0: // %entry
468 ; CHECK-NEXT: mov x8, x0
469 ; CHECK-NEXT: mov w0, w1
470 ; CHECK-NEXT: stur x1, [x8, #-8]
473 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 -1
474 store i64 %v, ptr %arrayidx0
475 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 -8
476 %0 = load i8, ptr %arrayidx1
480 define i8 @Unscaled_Str64Ldr8_1(ptr nocapture %P, i64 %v, i64 %n) {
481 ; CHECK-LABEL: Unscaled_Str64Ldr8_1:
482 ; CHECK: // %bb.0: // %entry
483 ; CHECK-NEXT: stur x1, [x0, #-8]
484 ; CHECK-NEXT: ubfx x0, x1, #8, #8
487 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 -1
488 store i64 %v, ptr %arrayidx0
489 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 -7
490 %0 = load i8, ptr %arrayidx1
494 define i8 @Unscaled_Str64Ldr8_2(ptr nocapture %P, i64 %v, i64 %n) {
495 ; CHECK-LABEL: Unscaled_Str64Ldr8_2:
496 ; CHECK: // %bb.0: // %entry
497 ; CHECK-NEXT: stur x1, [x0, #-8]
498 ; CHECK-NEXT: ubfx x0, x1, #16, #8
501 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 -1
502 store i64 %v, ptr %arrayidx0
503 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 -6
504 %0 = load i8, ptr %arrayidx1
508 define i8 @Unscaled_Str64Ldr8_3(ptr nocapture %P, i64 %v, i64 %n) {
509 ; CHECK-LABEL: Unscaled_Str64Ldr8_3:
510 ; CHECK: // %bb.0: // %entry
511 ; CHECK-NEXT: stur x1, [x0, #-8]
512 ; CHECK-NEXT: ubfx x0, x1, #24, #8
515 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 -1
516 store i64 %v, ptr %arrayidx0
517 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 -5
518 %0 = load i8, ptr %arrayidx1
522 define i8 @Unscaled_Str64Ldr8_4(ptr nocapture %P, i64 %v, i64 %n) {
523 ; CHECK-LABEL: Unscaled_Str64Ldr8_4:
524 ; CHECK: // %bb.0: // %entry
525 ; CHECK-NEXT: stur x1, [x0, #-8]
526 ; CHECK-NEXT: ubfx x0, x1, #32, #8
529 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 -1
530 store i64 %v, ptr %arrayidx0
531 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 -4
532 %0 = load i8, ptr %arrayidx1
536 define i8 @Unscaled_Str64Ldr8_5(ptr nocapture %P, i64 %v, i64 %n) {
537 ; CHECK-LABEL: Unscaled_Str64Ldr8_5:
538 ; CHECK: // %bb.0: // %entry
539 ; CHECK-NEXT: stur x1, [x0, #-8]
540 ; CHECK-NEXT: ubfx x0, x1, #40, #8
543 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 -1
544 store i64 %v, ptr %arrayidx0
545 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 -3
546 %0 = load i8, ptr %arrayidx1
550 define i8 @Unscaled_Str64Ldr8_6(ptr nocapture %P, i64 %v, i64 %n) {
551 ; CHECK-LABEL: Unscaled_Str64Ldr8_6:
552 ; CHECK: // %bb.0: // %entry
553 ; CHECK-NEXT: stur x1, [x0, #-8]
554 ; CHECK-NEXT: ubfx x0, x1, #48, #8
557 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 -1
558 store i64 %v, ptr %arrayidx0
559 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 -2
560 %0 = load i8, ptr %arrayidx1
564 define i8 @Unscaled_Str64Ldr8_7(ptr nocapture %P, i64 %v, i64 %n) {
565 ; CHECK-LABEL: Unscaled_Str64Ldr8_7:
566 ; CHECK: // %bb.0: // %entry
567 ; CHECK-NEXT: stur x1, [x0, #-8]
568 ; CHECK-NEXT: lsr x0, x1, #56
571 %arrayidx0 = getelementptr inbounds i64, ptr %P, i64 -1
572 store i64 %v, ptr %arrayidx0
573 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 -1
574 %0 = load i8, ptr %arrayidx1
578 define i32 @Unscaled_Str32Ldr32(ptr nocapture %P, i32 %v, i64 %n) {
579 ; CHECK-LABEL: Unscaled_Str32Ldr32:
580 ; CHECK: // %bb.0: // %entry
581 ; CHECK-NEXT: mov x8, x0
582 ; CHECK-NEXT: mov w0, w1
583 ; CHECK-NEXT: stur w1, [x8, #-4]
586 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 -1
587 store i32 %v, ptr %arrayidx0
588 %arrayidx1 = getelementptr inbounds i32, ptr %P, i64 -1
589 %0 = load i32, ptr %arrayidx1
593 define i16 @Unscaled_Str32Ldr16_0(ptr nocapture %P, i32 %v, i64 %n) {
594 ; CHECK-LABEL: Unscaled_Str32Ldr16_0:
595 ; CHECK: // %bb.0: // %entry
596 ; CHECK-NEXT: mov x8, x0
597 ; CHECK-NEXT: mov w0, w1
598 ; CHECK-NEXT: stur w1, [x8, #-4]
601 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 -1
602 store i32 %v, ptr %arrayidx0
603 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 -2
604 %0 = load i16, ptr %arrayidx1
608 define i16 @Unscaled_Str32Ldr16_1(ptr nocapture %P, i32 %v, i64 %n) {
609 ; CHECK-LABEL: Unscaled_Str32Ldr16_1:
610 ; CHECK: // %bb.0: // %entry
611 ; CHECK-NEXT: stur w1, [x0, #-4]
612 ; CHECK-NEXT: lsr w0, w1, #16
615 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 -1
616 store i32 %v, ptr %arrayidx0
617 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 -1
618 %0 = load i16, ptr %arrayidx1
622 define i8 @Unscaled_Str32Ldr8_0(ptr nocapture %P, i32 %v, i64 %n) {
623 ; CHECK-LABEL: Unscaled_Str32Ldr8_0:
624 ; CHECK: // %bb.0: // %entry
625 ; CHECK-NEXT: mov x8, x0
626 ; CHECK-NEXT: mov w0, w1
627 ; CHECK-NEXT: stur w1, [x8, #-4]
630 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 -1
631 store i32 %v, ptr %arrayidx0
632 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 -4
633 %0 = load i8, ptr %arrayidx1
637 define i8 @Unscaled_Str32Ldr8_1(ptr nocapture %P, i32 %v, i64 %n) {
638 ; CHECK-LABEL: Unscaled_Str32Ldr8_1:
639 ; CHECK: // %bb.0: // %entry
640 ; CHECK-NEXT: stur w1, [x0, #-4]
641 ; CHECK-NEXT: ubfx w0, w1, #8, #8
644 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 -1
645 store i32 %v, ptr %arrayidx0
646 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 -3
647 %0 = load i8, ptr %arrayidx1
651 define i8 @Unscaled_Str32Ldr8_2(ptr nocapture %P, i32 %v, i64 %n) {
652 ; CHECK-LABEL: Unscaled_Str32Ldr8_2:
653 ; CHECK: // %bb.0: // %entry
654 ; CHECK-NEXT: stur w1, [x0, #-4]
655 ; CHECK-NEXT: ubfx w0, w1, #16, #8
658 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 -1
659 store i32 %v, ptr %arrayidx0
660 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 -2
661 %0 = load i8, ptr %arrayidx1
665 define i8 @Unscaled_Str32Ldr8_3(ptr nocapture %P, i32 %v, i64 %n) {
666 ; CHECK-LABEL: Unscaled_Str32Ldr8_3:
667 ; CHECK: // %bb.0: // %entry
668 ; CHECK-NEXT: stur w1, [x0, #-4]
669 ; CHECK-NEXT: lsr w0, w1, #24
672 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 -1
673 store i32 %v, ptr %arrayidx0
674 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 -1
675 %0 = load i8, ptr %arrayidx1
679 define i16 @Unscaled_Str16Ldr16(ptr nocapture %P, i16 %v, i64 %n) {
680 ; CHECK-LABEL: Unscaled_Str16Ldr16:
681 ; CHECK: // %bb.0: // %entry
682 ; CHECK-NEXT: mov x8, x0
683 ; CHECK-NEXT: mov w0, w1
684 ; CHECK-NEXT: sturh w1, [x8, #-2]
687 %arrayidx0 = getelementptr inbounds i16, ptr %P, i64 -1
688 store i16 %v, ptr %arrayidx0
689 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 -1
690 %0 = load i16, ptr %arrayidx1
694 define i8 @Unscaled_Str16Ldr8_0(ptr nocapture %P, i16 %v, i64 %n) {
695 ; CHECK-LABEL: Unscaled_Str16Ldr8_0:
696 ; CHECK: // %bb.0: // %entry
697 ; CHECK-NEXT: mov x8, x0
698 ; CHECK-NEXT: mov w0, w1
699 ; CHECK-NEXT: sturh w1, [x8, #-2]
702 %arrayidx0 = getelementptr inbounds i16, ptr %P, i64 -1
703 store i16 %v, ptr %arrayidx0
704 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 -2
705 %0 = load i8, ptr %arrayidx1
709 define i8 @Unscaled_Str16Ldr8_1(ptr nocapture %P, i16 %v, i64 %n) {
710 ; CHECK-LABEL: Unscaled_Str16Ldr8_1:
711 ; CHECK: // %bb.0: // %entry
712 ; CHECK-NEXT: sturh w1, [x0, #-2]
713 ; CHECK-NEXT: ubfx w0, w1, #8, #8
716 %arrayidx0 = getelementptr inbounds i16, ptr %P, i64 -1
717 store i16 %v, ptr %arrayidx0
718 %arrayidx1 = getelementptr inbounds i8, ptr %P, i64 -1
719 %0 = load i8, ptr %arrayidx1
723 define i16 @StrVolatileLdr(ptr nocapture %P, i32 %v, i64 %n) {
724 ; CHECK-LABEL: StrVolatileLdr:
725 ; CHECK: // %bb.0: // %entry
726 ; CHECK-NEXT: str w1, [x0, #4]
727 ; CHECK-NEXT: ldrh w0, [x0, #4]
730 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 1
731 store i32 %v, ptr %arrayidx0
732 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 2
733 %0 = load volatile i16, ptr %arrayidx1
737 define i16 @StrNotInRangeLdr(ptr nocapture %P, i32 %v, i64 %n) {
738 ; CHECK-LABEL: StrNotInRangeLdr:
739 ; CHECK: // %bb.0: // %entry
740 ; CHECK-NEXT: mov x8, x0
741 ; CHECK-NEXT: ldrh w0, [x0, #2]
742 ; CHECK-NEXT: str w1, [x8, #4]
745 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 1
746 store i32 %v, ptr %arrayidx0
747 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 1
748 %0 = load i16, ptr %arrayidx1
752 define i16 @Unscaled_StrNotInRangeLdr(ptr nocapture %P, i32 %v, i64 %n) {
753 ; CHECK-LABEL: Unscaled_StrNotInRangeLdr:
754 ; CHECK: // %bb.0: // %entry
755 ; CHECK-NEXT: mov x8, x0
756 ; CHECK-NEXT: ldurh w0, [x0, #-6]
757 ; CHECK-NEXT: stur w1, [x8, #-4]
760 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 -1
761 store i32 %v, ptr %arrayidx0
762 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 -3
763 %0 = load i16, ptr %arrayidx1
767 define i16 @StrCallLdr(ptr nocapture %P, i32 %v, i64 %n) {
768 ; CHECK-LABEL: StrCallLdr:
769 ; CHECK: // %bb.0: // %entry
770 ; CHECK-NEXT: stp x30, x19, [sp, #-16]! // 16-byte Folded Spill
771 ; CHECK-NEXT: .cfi_def_cfa_offset 16
772 ; CHECK-NEXT: .cfi_offset w19, -8
773 ; CHECK-NEXT: .cfi_offset w30, -16
774 ; CHECK-NEXT: mov x19, x0
775 ; CHECK-NEXT: str w1, [x0, #4]
776 ; CHECK-NEXT: bl test_dummy
777 ; CHECK-NEXT: ldrh w0, [x19, #2]
778 ; CHECK-NEXT: ldp x30, x19, [sp], #16 // 16-byte Folded Reload
781 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 1
782 store i32 %v, ptr %arrayidx0
783 %c = call i1 @test_dummy()
784 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 1
785 %0 = load i16, ptr %arrayidx1
789 declare i1 @test_dummy()
791 define i16 @StrStrLdr(i32 %v, ptr %P, ptr %P2, i32 %n) {
792 ; CHECK-LABEL: StrStrLdr:
793 ; CHECK: // %bb.0: // %entry
794 ; CHECK-NEXT: str w0, [x1, #4]
795 ; CHECK-NEXT: str w3, [x2]
796 ; CHECK-NEXT: ldrh w0, [x1, #4]
799 %arrayidx0 = getelementptr inbounds i32, ptr %P, i64 1
800 store i32 %v, ptr %arrayidx0
801 store i32 %n, ptr %P2
802 %arrayidx1 = getelementptr inbounds i16, ptr %P, i64 2
803 %0 = load i16, ptr %arrayidx1