1 ; RUN: llc < %s -mtriple aarch64--none-eabi -verify-machineinstrs | FileCheck %s
3 ; CHECK-LABEL: Str64Ldr64
5 define i64 @Str64Ldr64(i64* nocapture %P, i64 %v, i64 %n) {
7 %0 = bitcast i64* %P to i64*
8 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 1
9 store i64 %v, i64* %arrayidx0
10 %arrayidx1 = getelementptr inbounds i64, i64* %0, i64 1
11 %1 = load i64, i64* %arrayidx1
15 ; CHECK-LABEL: Str64Ldr32_0
17 define i32 @Str64Ldr32_0(i64* nocapture %P, i64 %v, i64 %n) {
19 %0 = bitcast i64* %P to i32*
20 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 1
21 store i64 %v, i64* %arrayidx0
22 %arrayidx1 = getelementptr inbounds i32, i32* %0, i64 2
23 %1 = load i32, i32* %arrayidx1
27 ; CHECK-LABEL: Str64Ldr32_1
28 ; CHECK: lsr x0, x1, #32
29 define i32 @Str64Ldr32_1(i64* nocapture %P, i64 %v, i64 %n) {
31 %0 = bitcast i64* %P to i32*
32 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 1
33 store i64 %v, i64* %arrayidx0
34 %arrayidx1 = getelementptr inbounds i32, i32* %0, i64 3
35 %1 = load i32, i32* %arrayidx1
39 ; CHECK-LABEL: Str64Ldr16_0
41 define i16 @Str64Ldr16_0(i64* nocapture %P, i64 %v, i64 %n) {
43 %0 = bitcast i64* %P to i16*
44 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 1
45 store i64 %v, i64* %arrayidx0
46 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 4
47 %1 = load i16, i16* %arrayidx1
51 ; CHECK-LABEL: Str64Ldr16_1
52 ; CHECK: ubfx x0, x1, #16, #16
53 define i16 @Str64Ldr16_1(i64* nocapture %P, i64 %v, i64 %n) {
55 %0 = bitcast i64* %P to i16*
56 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 1
57 store i64 %v, i64* %arrayidx0
58 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 5
59 %1 = load i16, i16* %arrayidx1
63 ; CHECK-LABEL: Str64Ldr16_2
64 ; CHECK: ubfx x0, x1, #32, #16
65 define i16 @Str64Ldr16_2(i64* nocapture %P, i64 %v, i64 %n) {
67 %0 = bitcast i64* %P to i16*
68 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 1
69 store i64 %v, i64* %arrayidx0
70 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 6
71 %1 = load i16, i16* %arrayidx1
75 ; CHECK-LABEL: Str64Ldr16_3
76 ; CHECK: lsr x0, x1, #48
77 define i16 @Str64Ldr16_3(i64* nocapture %P, i64 %v, i64 %n) {
79 %0 = bitcast i64* %P to i16*
80 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 1
81 store i64 %v, i64* %arrayidx0
82 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 7
83 %1 = load i16, i16* %arrayidx1
87 ; CHECK-LABEL: Str64Ldr8_0
89 define i8 @Str64Ldr8_0(i64* nocapture %P, i64 %v, i64 %n) {
91 %0 = bitcast i64* %P to i8*
92 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 1
93 store i64 %v, i64* %arrayidx0
94 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 8
95 %1 = load i8, i8* %arrayidx1
99 ; CHECK-LABEL: Str64Ldr8_1
100 ; CHECK: ubfx x0, x1, #8, #8
101 define i8 @Str64Ldr8_1(i64* nocapture %P, i64 %v, i64 %n) {
103 %0 = bitcast i64* %P to i8*
104 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 1
105 store i64 %v, i64* %arrayidx0
106 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 9
107 %1 = load i8, i8* %arrayidx1
111 ; CHECK-LABEL: Str64Ldr8_2
112 ; CHECK: ubfx x0, x1, #16, #8
113 define i8 @Str64Ldr8_2(i64* nocapture %P, i64 %v, i64 %n) {
115 %0 = bitcast i64* %P to i8*
116 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 1
117 store i64 %v, i64* %arrayidx0
118 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 10
119 %1 = load i8, i8* %arrayidx1
123 ; CHECK-LABEL: Str64Ldr8_3
124 ; CHECK: ubfx x0, x1, #24, #8
125 define i8 @Str64Ldr8_3(i64* nocapture %P, i64 %v, i64 %n) {
127 %0 = bitcast i64* %P to i8*
128 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 1
129 store i64 %v, i64* %arrayidx0
130 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 11
131 %1 = load i8, i8* %arrayidx1
135 ; CHECK-LABEL: Str64Ldr8_4
136 ; CHECK: ubfx x0, x1, #32, #8
137 define i8 @Str64Ldr8_4(i64* nocapture %P, i64 %v, i64 %n) {
139 %0 = bitcast i64* %P to i8*
140 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 1
141 store i64 %v, i64* %arrayidx0
142 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 12
143 %1 = load i8, i8* %arrayidx1
147 ; CHECK-LABEL: Str64Ldr8_5
148 ; CHECK: ubfx x0, x1, #40, #8
149 define i8 @Str64Ldr8_5(i64* nocapture %P, i64 %v, i64 %n) {
151 %0 = bitcast i64* %P to i8*
152 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 1
153 store i64 %v, i64* %arrayidx0
154 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 13
155 %1 = load i8, i8* %arrayidx1
159 ; CHECK-LABEL: Str64Ldr8_6
160 ; CHECK: ubfx x0, x1, #48, #8
161 define i8 @Str64Ldr8_6(i64* nocapture %P, i64 %v, i64 %n) {
163 %0 = bitcast i64* %P to i8*
164 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 1
165 store i64 %v, i64* %arrayidx0
166 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 14
167 %1 = load i8, i8* %arrayidx1
171 ; CHECK-LABEL: Str64Ldr8_7
172 ; CHECK: lsr x0, x1, #56
173 define i8 @Str64Ldr8_7(i64* nocapture %P, i64 %v, i64 %n) {
175 %0 = bitcast i64* %P to i8*
176 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 1
177 store i64 %v, i64* %arrayidx0
178 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 15
179 %1 = load i8, i8* %arrayidx1
183 ; CHECK-LABEL: Str32Ldr32
185 define i32 @Str32Ldr32(i32* nocapture %P, i32 %v, i64 %n) {
187 %0 = bitcast i32* %P to i32*
188 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 1
189 store i32 %v, i32* %arrayidx0
190 %arrayidx1 = getelementptr inbounds i32, i32* %0, i64 1
191 %1 = load i32, i32* %arrayidx1
195 ; CHECK-LABEL: Str32Ldr16_0
197 define i16 @Str32Ldr16_0(i32* nocapture %P, i32 %v, i64 %n) {
199 %0 = bitcast i32* %P to i16*
200 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 1
201 store i32 %v, i32* %arrayidx0
202 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 2
203 %1 = load i16, i16* %arrayidx1
207 ; CHECK-LABEL: Str32Ldr16_1
208 ; CHECK: lsr w0, w1, #16
209 define i16 @Str32Ldr16_1(i32* nocapture %P, i32 %v, i64 %n) {
211 %0 = bitcast i32* %P to i16*
212 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 1
213 store i32 %v, i32* %arrayidx0
214 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 3
215 %1 = load i16, i16* %arrayidx1
219 ; CHECK-LABEL: Str32Ldr8_0
221 define i8 @Str32Ldr8_0(i32* nocapture %P, i32 %v, i64 %n) {
223 %0 = bitcast i32* %P to i8*
224 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 1
225 store i32 %v, i32* %arrayidx0
226 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 4
227 %1 = load i8, i8* %arrayidx1
231 ; CHECK-LABEL: Str32Ldr8_1
232 ; CHECK: ubfx w0, w1, #8, #8
233 define i8 @Str32Ldr8_1(i32* nocapture %P, i32 %v, i64 %n) {
235 %0 = bitcast i32* %P to i8*
236 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 1
237 store i32 %v, i32* %arrayidx0
238 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 5
239 %1 = load i8, i8* %arrayidx1
243 ; CHECK-LABEL: Str32Ldr8_2
244 ; CHECK: ubfx w0, w1, #16, #8
245 define i8 @Str32Ldr8_2(i32* nocapture %P, i32 %v, i64 %n) {
247 %0 = bitcast i32* %P to i8*
248 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 1
249 store i32 %v, i32* %arrayidx0
250 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 6
251 %1 = load i8, i8* %arrayidx1
255 ; CHECK-LABEL: Str32Ldr8_3
256 ; CHECK: lsr w0, w1, #24
257 define i8 @Str32Ldr8_3(i32* nocapture %P, i32 %v, i64 %n) {
259 %0 = bitcast i32* %P to i8*
260 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 1
261 store i32 %v, i32* %arrayidx0
262 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 7
263 %1 = load i8, i8* %arrayidx1
267 ; CHECK-LABEL: Str16Ldr16
269 define i16 @Str16Ldr16(i16* nocapture %P, i16 %v, i64 %n) {
271 %0 = bitcast i16* %P to i16*
272 %arrayidx0 = getelementptr inbounds i16, i16* %P, i64 1
273 store i16 %v, i16* %arrayidx0
274 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 1
275 %1 = load i16, i16* %arrayidx1
279 ; CHECK-LABEL: Str16Ldr8_0
281 define i8 @Str16Ldr8_0(i16* nocapture %P, i16 %v, i64 %n) {
283 %0 = bitcast i16* %P to i8*
284 %arrayidx0 = getelementptr inbounds i16, i16* %P, i64 1
285 store i16 %v, i16* %arrayidx0
286 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 2
287 %1 = load i8, i8* %arrayidx1
291 ; CHECK-LABEL: Str16Ldr8_1
292 ; CHECK: ubfx w0, w1, #8, #8
293 define i8 @Str16Ldr8_1(i16* nocapture %P, i16 %v, i64 %n) {
295 %0 = bitcast i16* %P to i8*
296 %arrayidx0 = getelementptr inbounds i16, i16* %P, i64 1
297 store i16 %v, i16* %arrayidx0
298 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 3
299 %1 = load i8, i8* %arrayidx1
304 ; CHECK-LABEL: Unscaled_Str64Ldr64
306 define i64 @Unscaled_Str64Ldr64(i64* nocapture %P, i64 %v, i64 %n) {
308 %0 = bitcast i64* %P to i64*
309 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 -1
310 store i64 %v, i64* %arrayidx0
311 %arrayidx1 = getelementptr inbounds i64, i64* %0, i64 -1
312 %1 = load i64, i64* %arrayidx1
316 ; CHECK-LABEL: Unscaled_Str64Ldr32_0
318 define i32 @Unscaled_Str64Ldr32_0(i64* nocapture %P, i64 %v, i64 %n) {
320 %0 = bitcast i64* %P to i32*
321 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 -1
322 store i64 %v, i64* %arrayidx0
323 %arrayidx1 = getelementptr inbounds i32, i32* %0, i64 -2
324 %1 = load i32, i32* %arrayidx1
328 ; CHECK-LABEL: Unscaled_Str64Ldr32_1
329 ; CHECK: lsr x0, x1, #32
330 define i32 @Unscaled_Str64Ldr32_1(i64* nocapture %P, i64 %v, i64 %n) {
332 %0 = bitcast i64* %P to i32*
333 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 -1
334 store i64 %v, i64* %arrayidx0
335 %arrayidx1 = getelementptr inbounds i32, i32* %0, i64 -1
336 %1 = load i32, i32* %arrayidx1
340 ; CHECK-LABEL: Unscaled_Str64Ldr16_0
342 define i16 @Unscaled_Str64Ldr16_0(i64* nocapture %P, i64 %v, i64 %n) {
344 %0 = bitcast i64* %P to i16*
345 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 -1
346 store i64 %v, i64* %arrayidx0
347 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 -4
348 %1 = load i16, i16* %arrayidx1
352 ; CHECK-LABEL: Unscaled_Str64Ldr16_1
353 ; CHECK: ubfx x0, x1, #16, #16
354 define i16 @Unscaled_Str64Ldr16_1(i64* nocapture %P, i64 %v, i64 %n) {
356 %0 = bitcast i64* %P to i16*
357 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 -1
358 store i64 %v, i64* %arrayidx0
359 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 -3
360 %1 = load i16, i16* %arrayidx1
364 ; CHECK-LABEL: Unscaled_Str64Ldr16_2
365 ; CHECK: ubfx x0, x1, #32, #16
366 define i16 @Unscaled_Str64Ldr16_2(i64* nocapture %P, i64 %v, i64 %n) {
368 %0 = bitcast i64* %P to i16*
369 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 -1
370 store i64 %v, i64* %arrayidx0
371 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 -2
372 %1 = load i16, i16* %arrayidx1
376 ; CHECK-LABEL: Unscaled_Str64Ldr16_3
377 ; CHECK: lsr x0, x1, #48
378 define i16 @Unscaled_Str64Ldr16_3(i64* nocapture %P, i64 %v, i64 %n) {
380 %0 = bitcast i64* %P to i16*
381 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 -1
382 store i64 %v, i64* %arrayidx0
383 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 -1
384 %1 = load i16, i16* %arrayidx1
388 ; CHECK-LABEL: Unscaled_Str64Ldr8_0
390 define i8 @Unscaled_Str64Ldr8_0(i64* nocapture %P, i64 %v, i64 %n) {
392 %0 = bitcast i64* %P to i8*
393 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 -1
394 store i64 %v, i64* %arrayidx0
395 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 -8
396 %1 = load i8, i8* %arrayidx1
400 ; CHECK-LABEL: Unscaled_Str64Ldr8_1
401 ; CHECK: ubfx x0, x1, #8, #8
402 define i8 @Unscaled_Str64Ldr8_1(i64* nocapture %P, i64 %v, i64 %n) {
404 %0 = bitcast i64* %P to i8*
405 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 -1
406 store i64 %v, i64* %arrayidx0
407 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 -7
408 %1 = load i8, i8* %arrayidx1
412 ; CHECK-LABEL: Unscaled_Str64Ldr8_2
413 ; CHECK: ubfx x0, x1, #16, #8
414 define i8 @Unscaled_Str64Ldr8_2(i64* nocapture %P, i64 %v, i64 %n) {
416 %0 = bitcast i64* %P to i8*
417 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 -1
418 store i64 %v, i64* %arrayidx0
419 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 -6
420 %1 = load i8, i8* %arrayidx1
424 ; CHECK-LABEL: Unscaled_Str64Ldr8_3
425 ; CHECK: ubfx x0, x1, #24, #8
426 define i8 @Unscaled_Str64Ldr8_3(i64* nocapture %P, i64 %v, i64 %n) {
428 %0 = bitcast i64* %P to i8*
429 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 -1
430 store i64 %v, i64* %arrayidx0
431 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 -5
432 %1 = load i8, i8* %arrayidx1
436 ; CHECK-LABEL: Unscaled_Str64Ldr8_4
437 ; CHECK: ubfx x0, x1, #32, #8
438 define i8 @Unscaled_Str64Ldr8_4(i64* nocapture %P, i64 %v, i64 %n) {
440 %0 = bitcast i64* %P to i8*
441 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 -1
442 store i64 %v, i64* %arrayidx0
443 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 -4
444 %1 = load i8, i8* %arrayidx1
448 ; CHECK-LABEL: Unscaled_Str64Ldr8_5
449 ; CHECK: ubfx x0, x1, #40, #8
450 define i8 @Unscaled_Str64Ldr8_5(i64* nocapture %P, i64 %v, i64 %n) {
452 %0 = bitcast i64* %P to i8*
453 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 -1
454 store i64 %v, i64* %arrayidx0
455 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 -3
456 %1 = load i8, i8* %arrayidx1
460 ; CHECK-LABEL: Unscaled_Str64Ldr8_6
461 ; CHECK: ubfx x0, x1, #48, #8
462 define i8 @Unscaled_Str64Ldr8_6(i64* nocapture %P, i64 %v, i64 %n) {
464 %0 = bitcast i64* %P to i8*
465 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 -1
466 store i64 %v, i64* %arrayidx0
467 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 -2
468 %1 = load i8, i8* %arrayidx1
472 ; CHECK-LABEL: Unscaled_Str64Ldr8_7
473 ; CHECK: lsr x0, x1, #56
474 define i8 @Unscaled_Str64Ldr8_7(i64* nocapture %P, i64 %v, i64 %n) {
476 %0 = bitcast i64* %P to i8*
477 %arrayidx0 = getelementptr inbounds i64, i64* %P, i64 -1
478 store i64 %v, i64* %arrayidx0
479 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 -1
480 %1 = load i8, i8* %arrayidx1
484 ; CHECK-LABEL: Unscaled_Str32Ldr32
486 define i32 @Unscaled_Str32Ldr32(i32* nocapture %P, i32 %v, i64 %n) {
488 %0 = bitcast i32* %P to i32*
489 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 -1
490 store i32 %v, i32* %arrayidx0
491 %arrayidx1 = getelementptr inbounds i32, i32* %0, i64 -1
492 %1 = load i32, i32* %arrayidx1
496 ; CHECK-LABEL: Unscaled_Str32Ldr16_0
498 define i16 @Unscaled_Str32Ldr16_0(i32* nocapture %P, i32 %v, i64 %n) {
500 %0 = bitcast i32* %P to i16*
501 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 -1
502 store i32 %v, i32* %arrayidx0
503 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 -2
504 %1 = load i16, i16* %arrayidx1
508 ; CHECK-LABEL: Unscaled_Str32Ldr16_1
509 ; CHECK: lsr w0, w1, #16
510 define i16 @Unscaled_Str32Ldr16_1(i32* nocapture %P, i32 %v, i64 %n) {
512 %0 = bitcast i32* %P to i16*
513 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 -1
514 store i32 %v, i32* %arrayidx0
515 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 -1
516 %1 = load i16, i16* %arrayidx1
520 ; CHECK-LABEL: Unscaled_Str32Ldr8_0
522 define i8 @Unscaled_Str32Ldr8_0(i32* nocapture %P, i32 %v, i64 %n) {
524 %0 = bitcast i32* %P to i8*
525 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 -1
526 store i32 %v, i32* %arrayidx0
527 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 -4
528 %1 = load i8, i8* %arrayidx1
532 ; CHECK-LABEL: Unscaled_Str32Ldr8_1
533 ; CHECK: ubfx w0, w1, #8, #8
534 define i8 @Unscaled_Str32Ldr8_1(i32* nocapture %P, i32 %v, i64 %n) {
536 %0 = bitcast i32* %P to i8*
537 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 -1
538 store i32 %v, i32* %arrayidx0
539 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 -3
540 %1 = load i8, i8* %arrayidx1
544 ; CHECK-LABEL: Unscaled_Str32Ldr8_2
545 ; CHECK: ubfx w0, w1, #16, #8
546 define i8 @Unscaled_Str32Ldr8_2(i32* nocapture %P, i32 %v, i64 %n) {
548 %0 = bitcast i32* %P to i8*
549 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 -1
550 store i32 %v, i32* %arrayidx0
551 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 -2
552 %1 = load i8, i8* %arrayidx1
556 ; CHECK-LABEL: Unscaled_Str32Ldr8_3
557 ; CHECK: lsr w0, w1, #24
558 define i8 @Unscaled_Str32Ldr8_3(i32* nocapture %P, i32 %v, i64 %n) {
560 %0 = bitcast i32* %P to i8*
561 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 -1
562 store i32 %v, i32* %arrayidx0
563 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 -1
564 %1 = load i8, i8* %arrayidx1
568 ; CHECK-LABEL: Unscaled_Str16Ldr16
570 define i16 @Unscaled_Str16Ldr16(i16* nocapture %P, i16 %v, i64 %n) {
572 %0 = bitcast i16* %P to i16*
573 %arrayidx0 = getelementptr inbounds i16, i16* %P, i64 -1
574 store i16 %v, i16* %arrayidx0
575 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 -1
576 %1 = load i16, i16* %arrayidx1
580 ; CHECK-LABEL: Unscaled_Str16Ldr8_0
582 define i8 @Unscaled_Str16Ldr8_0(i16* nocapture %P, i16 %v, i64 %n) {
584 %0 = bitcast i16* %P to i8*
585 %arrayidx0 = getelementptr inbounds i16, i16* %P, i64 -1
586 store i16 %v, i16* %arrayidx0
587 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 -2
588 %1 = load i8, i8* %arrayidx1
592 ; CHECK-LABEL: Unscaled_Str16Ldr8_1
593 ; CHECK: ubfx w0, w1, #8, #8
594 define i8 @Unscaled_Str16Ldr8_1(i16* nocapture %P, i16 %v, i64 %n) {
596 %0 = bitcast i16* %P to i8*
597 %arrayidx0 = getelementptr inbounds i16, i16* %P, i64 -1
598 store i16 %v, i16* %arrayidx0
599 %arrayidx1 = getelementptr inbounds i8, i8* %0, i64 -1
600 %1 = load i8, i8* %arrayidx1
604 ; CHECK-LABEL: StrVolatileLdr
606 define i16 @StrVolatileLdr(i32* nocapture %P, i32 %v, i64 %n) {
608 %0 = bitcast i32* %P to i16*
609 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 1
610 store i32 %v, i32* %arrayidx0
611 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 2
612 %1 = load volatile i16, i16* %arrayidx1
616 ; CHECK-LABEL: StrNotInRangeLdr
618 define i16 @StrNotInRangeLdr(i32* nocapture %P, i32 %v, i64 %n) {
620 %0 = bitcast i32* %P to i16*
621 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 1
622 store i32 %v, i32* %arrayidx0
623 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 1
624 %1 = load i16, i16* %arrayidx1
628 ; CHECK-LABEL: Unscaled_StrNotInRangeLdr
630 define i16 @Unscaled_StrNotInRangeLdr(i32* nocapture %P, i32 %v, i64 %n) {
632 %0 = bitcast i32* %P to i16*
633 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 -1
634 store i32 %v, i32* %arrayidx0
635 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 -3
636 %1 = load i16, i16* %arrayidx1
640 ; CHECK-LABEL: StrCallLdr
642 define i16 @StrCallLdr(i32* nocapture %P, i32 %v, i64 %n) {
644 %0 = bitcast i32* %P to i16*
645 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 1
646 store i32 %v, i32* %arrayidx0
647 %c = call i1 @test_dummy()
648 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 1
649 %1 = load i16, i16* %arrayidx1
653 declare i1 @test_dummy()
655 ; CHECK-LABEL: StrStrLdr
657 define i16 @StrStrLdr(i32 %v, i32* %P, i32* %P2, i32 %n) {
659 %0 = bitcast i32* %P to i16*
660 %arrayidx0 = getelementptr inbounds i32, i32* %P, i64 1
661 store i32 %v, i32* %arrayidx0
662 store i32 %n, i32* %P2
663 %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 2
664 %1 = load i16, i16* %arrayidx1