1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-linux-gnu -mattr=+addr-lsl-slow-14 | FileCheck %s --check-prefixes=CHECK,CHECK0,CHECK0-SDAG
3 ; RUN: llc < %s -mtriple=aarch64-linux-gnu -mattr=+addr-lsl-slow-14 -global-isel=1 -global-isel-abort=1 | FileCheck %s --check-prefixes=CHECK,CHECK0,CHECK0-GISEL
4 ; RUN: llc < %s -mtriple=aarch64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK3,CHECK3-SDAG
5 ; RUN: llc < %s -mtriple=aarch64-linux-gnu -global-isel=1 -global-isel-abort=1 | FileCheck %s --check-prefixes=CHECK,CHECK3,CHECK3-GISEL
7 %struct.a = type [256 x i16]
8 %struct.b = type [256 x i32]
9 %struct.c = type [256 x i64]
12 define i16 @halfword(ptr %ctx, i32 %xor72) nounwind {
13 ; CHECK0-SDAG-LABEL: halfword:
14 ; CHECK0-SDAG: // %bb.0:
15 ; CHECK0-SDAG-NEXT: stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
16 ; CHECK0-SDAG-NEXT: // kill: def $w1 killed $w1 def $x1
17 ; CHECK0-SDAG-NEXT: ubfx x8, x1, #9, #8
18 ; CHECK0-SDAG-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
19 ; CHECK0-SDAG-NEXT: mov x19, x0
20 ; CHECK0-SDAG-NEXT: lsl x21, x8, #1
21 ; CHECK0-SDAG-NEXT: ldrh w20, [x0, x21]
22 ; CHECK0-SDAG-NEXT: bl foo
23 ; CHECK0-SDAG-NEXT: mov w0, w20
24 ; CHECK0-SDAG-NEXT: strh w20, [x19, x21]
25 ; CHECK0-SDAG-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
26 ; CHECK0-SDAG-NEXT: ldp x30, x21, [sp], #32 // 16-byte Folded Reload
27 ; CHECK0-SDAG-NEXT: ret
29 ; CHECK0-GISEL-LABEL: halfword:
30 ; CHECK0-GISEL: // %bb.0:
31 ; CHECK0-GISEL-NEXT: str x30, [sp, #-32]! // 8-byte Folded Spill
32 ; CHECK0-GISEL-NEXT: lsr w8, w1, #9
33 ; CHECK0-GISEL-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
34 ; CHECK0-GISEL-NEXT: add x20, x0, w8, uxtb #1
35 ; CHECK0-GISEL-NEXT: ldrh w19, [x20]
36 ; CHECK0-GISEL-NEXT: bl foo
37 ; CHECK0-GISEL-NEXT: mov w0, w19
38 ; CHECK0-GISEL-NEXT: strh w19, [x20]
39 ; CHECK0-GISEL-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
40 ; CHECK0-GISEL-NEXT: ldr x30, [sp], #32 // 8-byte Folded Reload
41 ; CHECK0-GISEL-NEXT: ret
43 ; CHECK3-SDAG-LABEL: halfword:
44 ; CHECK3-SDAG: // %bb.0:
45 ; CHECK3-SDAG-NEXT: stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
46 ; CHECK3-SDAG-NEXT: // kill: def $w1 killed $w1 def $x1
47 ; CHECK3-SDAG-NEXT: ubfx x21, x1, #9, #8
48 ; CHECK3-SDAG-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
49 ; CHECK3-SDAG-NEXT: mov x19, x0
50 ; CHECK3-SDAG-NEXT: ldrh w20, [x0, x21, lsl #1]
51 ; CHECK3-SDAG-NEXT: bl foo
52 ; CHECK3-SDAG-NEXT: mov w0, w20
53 ; CHECK3-SDAG-NEXT: strh w20, [x19, x21, lsl #1]
54 ; CHECK3-SDAG-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
55 ; CHECK3-SDAG-NEXT: ldp x30, x21, [sp], #32 // 16-byte Folded Reload
56 ; CHECK3-SDAG-NEXT: ret
58 ; CHECK3-GISEL-LABEL: halfword:
59 ; CHECK3-GISEL: // %bb.0:
60 ; CHECK3-GISEL-NEXT: stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
61 ; CHECK3-GISEL-NEXT: lsr w8, w1, #9
62 ; CHECK3-GISEL-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
63 ; CHECK3-GISEL-NEXT: mov x19, x0
64 ; CHECK3-GISEL-NEXT: and x21, x8, #0xff
65 ; CHECK3-GISEL-NEXT: ldrh w20, [x0, x21, lsl #1]
66 ; CHECK3-GISEL-NEXT: bl foo
67 ; CHECK3-GISEL-NEXT: mov w0, w20
68 ; CHECK3-GISEL-NEXT: strh w20, [x19, x21, lsl #1]
69 ; CHECK3-GISEL-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
70 ; CHECK3-GISEL-NEXT: ldp x30, x21, [sp], #32 // 16-byte Folded Reload
71 ; CHECK3-GISEL-NEXT: ret
72 %shr81 = lshr i32 %xor72, 9
73 %conv82 = zext i32 %shr81 to i64
74 %idxprom83 = and i64 %conv82, 255
75 %arrayidx86 = getelementptr inbounds %struct.a, ptr %ctx, i64 0, i64 %idxprom83
76 %result = load i16, ptr %arrayidx86, align 2
78 store i16 %result, ptr %arrayidx86, align 2
82 define i32 @word(ptr %ctx, i32 %xor72) nounwind {
83 ; CHECK0-SDAG-LABEL: word:
84 ; CHECK0-SDAG: // %bb.0:
85 ; CHECK0-SDAG-NEXT: stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
86 ; CHECK0-SDAG-NEXT: // kill: def $w1 killed $w1 def $x1
87 ; CHECK0-SDAG-NEXT: ubfx x21, x1, #9, #8
88 ; CHECK0-SDAG-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
89 ; CHECK0-SDAG-NEXT: mov x19, x0
90 ; CHECK0-SDAG-NEXT: ldr w20, [x0, x21, lsl #2]
91 ; CHECK0-SDAG-NEXT: bl foo
92 ; CHECK0-SDAG-NEXT: mov w0, w20
93 ; CHECK0-SDAG-NEXT: str w20, [x19, x21, lsl #2]
94 ; CHECK0-SDAG-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
95 ; CHECK0-SDAG-NEXT: ldp x30, x21, [sp], #32 // 16-byte Folded Reload
96 ; CHECK0-SDAG-NEXT: ret
98 ; CHECK0-GISEL-LABEL: word:
99 ; CHECK0-GISEL: // %bb.0:
100 ; CHECK0-GISEL-NEXT: stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
101 ; CHECK0-GISEL-NEXT: lsr w8, w1, #9
102 ; CHECK0-GISEL-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
103 ; CHECK0-GISEL-NEXT: mov x19, x0
104 ; CHECK0-GISEL-NEXT: and x21, x8, #0xff
105 ; CHECK0-GISEL-NEXT: ldr w20, [x0, x21, lsl #2]
106 ; CHECK0-GISEL-NEXT: bl foo
107 ; CHECK0-GISEL-NEXT: mov w0, w20
108 ; CHECK0-GISEL-NEXT: str w20, [x19, x21, lsl #2]
109 ; CHECK0-GISEL-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
110 ; CHECK0-GISEL-NEXT: ldp x30, x21, [sp], #32 // 16-byte Folded Reload
111 ; CHECK0-GISEL-NEXT: ret
113 ; CHECK3-SDAG-LABEL: word:
114 ; CHECK3-SDAG: // %bb.0:
115 ; CHECK3-SDAG-NEXT: stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
116 ; CHECK3-SDAG-NEXT: // kill: def $w1 killed $w1 def $x1
117 ; CHECK3-SDAG-NEXT: ubfx x21, x1, #9, #8
118 ; CHECK3-SDAG-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
119 ; CHECK3-SDAG-NEXT: mov x19, x0
120 ; CHECK3-SDAG-NEXT: ldr w20, [x0, x21, lsl #2]
121 ; CHECK3-SDAG-NEXT: bl foo
122 ; CHECK3-SDAG-NEXT: mov w0, w20
123 ; CHECK3-SDAG-NEXT: str w20, [x19, x21, lsl #2]
124 ; CHECK3-SDAG-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
125 ; CHECK3-SDAG-NEXT: ldp x30, x21, [sp], #32 // 16-byte Folded Reload
126 ; CHECK3-SDAG-NEXT: ret
128 ; CHECK3-GISEL-LABEL: word:
129 ; CHECK3-GISEL: // %bb.0:
130 ; CHECK3-GISEL-NEXT: stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
131 ; CHECK3-GISEL-NEXT: lsr w8, w1, #9
132 ; CHECK3-GISEL-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
133 ; CHECK3-GISEL-NEXT: mov x19, x0
134 ; CHECK3-GISEL-NEXT: and x21, x8, #0xff
135 ; CHECK3-GISEL-NEXT: ldr w20, [x0, x21, lsl #2]
136 ; CHECK3-GISEL-NEXT: bl foo
137 ; CHECK3-GISEL-NEXT: mov w0, w20
138 ; CHECK3-GISEL-NEXT: str w20, [x19, x21, lsl #2]
139 ; CHECK3-GISEL-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
140 ; CHECK3-GISEL-NEXT: ldp x30, x21, [sp], #32 // 16-byte Folded Reload
141 ; CHECK3-GISEL-NEXT: ret
142 %shr81 = lshr i32 %xor72, 9
143 %conv82 = zext i32 %shr81 to i64
144 %idxprom83 = and i64 %conv82, 255
145 %arrayidx86 = getelementptr inbounds %struct.b, ptr %ctx, i64 0, i64 %idxprom83
146 %result = load i32, ptr %arrayidx86, align 4
148 store i32 %result, ptr %arrayidx86, align 4
152 define i64 @doubleword(ptr %ctx, i32 %xor72) nounwind {
153 ; CHECK0-SDAG-LABEL: doubleword:
154 ; CHECK0-SDAG: // %bb.0:
155 ; CHECK0-SDAG-NEXT: stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
156 ; CHECK0-SDAG-NEXT: // kill: def $w1 killed $w1 def $x1
157 ; CHECK0-SDAG-NEXT: ubfx x21, x1, #9, #8
158 ; CHECK0-SDAG-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
159 ; CHECK0-SDAG-NEXT: mov x19, x0
160 ; CHECK0-SDAG-NEXT: ldr x20, [x0, x21, lsl #3]
161 ; CHECK0-SDAG-NEXT: bl foo
162 ; CHECK0-SDAG-NEXT: mov x0, x20
163 ; CHECK0-SDAG-NEXT: str x20, [x19, x21, lsl #3]
164 ; CHECK0-SDAG-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
165 ; CHECK0-SDAG-NEXT: ldp x30, x21, [sp], #32 // 16-byte Folded Reload
166 ; CHECK0-SDAG-NEXT: ret
168 ; CHECK0-GISEL-LABEL: doubleword:
169 ; CHECK0-GISEL: // %bb.0:
170 ; CHECK0-GISEL-NEXT: stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
171 ; CHECK0-GISEL-NEXT: lsr w8, w1, #9
172 ; CHECK0-GISEL-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
173 ; CHECK0-GISEL-NEXT: mov x19, x0
174 ; CHECK0-GISEL-NEXT: and x21, x8, #0xff
175 ; CHECK0-GISEL-NEXT: ldr x20, [x0, x21, lsl #3]
176 ; CHECK0-GISEL-NEXT: bl foo
177 ; CHECK0-GISEL-NEXT: mov x0, x20
178 ; CHECK0-GISEL-NEXT: str x20, [x19, x21, lsl #3]
179 ; CHECK0-GISEL-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
180 ; CHECK0-GISEL-NEXT: ldp x30, x21, [sp], #32 // 16-byte Folded Reload
181 ; CHECK0-GISEL-NEXT: ret
183 ; CHECK3-SDAG-LABEL: doubleword:
184 ; CHECK3-SDAG: // %bb.0:
185 ; CHECK3-SDAG-NEXT: stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
186 ; CHECK3-SDAG-NEXT: // kill: def $w1 killed $w1 def $x1
187 ; CHECK3-SDAG-NEXT: ubfx x21, x1, #9, #8
188 ; CHECK3-SDAG-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
189 ; CHECK3-SDAG-NEXT: mov x19, x0
190 ; CHECK3-SDAG-NEXT: ldr x20, [x0, x21, lsl #3]
191 ; CHECK3-SDAG-NEXT: bl foo
192 ; CHECK3-SDAG-NEXT: mov x0, x20
193 ; CHECK3-SDAG-NEXT: str x20, [x19, x21, lsl #3]
194 ; CHECK3-SDAG-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
195 ; CHECK3-SDAG-NEXT: ldp x30, x21, [sp], #32 // 16-byte Folded Reload
196 ; CHECK3-SDAG-NEXT: ret
198 ; CHECK3-GISEL-LABEL: doubleword:
199 ; CHECK3-GISEL: // %bb.0:
200 ; CHECK3-GISEL-NEXT: stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
201 ; CHECK3-GISEL-NEXT: lsr w8, w1, #9
202 ; CHECK3-GISEL-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
203 ; CHECK3-GISEL-NEXT: mov x19, x0
204 ; CHECK3-GISEL-NEXT: and x21, x8, #0xff
205 ; CHECK3-GISEL-NEXT: ldr x20, [x0, x21, lsl #3]
206 ; CHECK3-GISEL-NEXT: bl foo
207 ; CHECK3-GISEL-NEXT: mov x0, x20
208 ; CHECK3-GISEL-NEXT: str x20, [x19, x21, lsl #3]
209 ; CHECK3-GISEL-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
210 ; CHECK3-GISEL-NEXT: ldp x30, x21, [sp], #32 // 16-byte Folded Reload
211 ; CHECK3-GISEL-NEXT: ret
212 %shr81 = lshr i32 %xor72, 9
213 %conv82 = zext i32 %shr81 to i64
214 %idxprom83 = and i64 %conv82, 255
215 %arrayidx86 = getelementptr inbounds %struct.c, ptr %ctx, i64 0, i64 %idxprom83
216 %result = load i64, ptr %arrayidx86, align 8
218 store i64 %result, ptr %arrayidx86, align 8
222 define i16 @multi_use_half_word(ptr %ctx, i32 %xor72) {
223 ; CHECK0-SDAG-LABEL: multi_use_half_word:
224 ; CHECK0-SDAG: // %bb.0: // %entry
225 ; CHECK0-SDAG-NEXT: str x30, [sp, #-48]! // 8-byte Folded Spill
226 ; CHECK0-SDAG-NEXT: stp x22, x21, [sp, #16] // 16-byte Folded Spill
227 ; CHECK0-SDAG-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
228 ; CHECK0-SDAG-NEXT: .cfi_def_cfa_offset 48
229 ; CHECK0-SDAG-NEXT: .cfi_offset w19, -8
230 ; CHECK0-SDAG-NEXT: .cfi_offset w20, -16
231 ; CHECK0-SDAG-NEXT: .cfi_offset w21, -24
232 ; CHECK0-SDAG-NEXT: .cfi_offset w22, -32
233 ; CHECK0-SDAG-NEXT: .cfi_offset w30, -48
234 ; CHECK0-SDAG-NEXT: // kill: def $w1 killed $w1 def $x1
235 ; CHECK0-SDAG-NEXT: ubfx x8, x1, #9, #8
236 ; CHECK0-SDAG-NEXT: mov x19, x0
237 ; CHECK0-SDAG-NEXT: lsl x21, x8, #1
238 ; CHECK0-SDAG-NEXT: ldrh w20, [x0, x21]
239 ; CHECK0-SDAG-NEXT: add w22, w20, #1
240 ; CHECK0-SDAG-NEXT: bl foo
241 ; CHECK0-SDAG-NEXT: mov w0, w20
242 ; CHECK0-SDAG-NEXT: strh w22, [x19, x21]
243 ; CHECK0-SDAG-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
244 ; CHECK0-SDAG-NEXT: ldp x22, x21, [sp, #16] // 16-byte Folded Reload
245 ; CHECK0-SDAG-NEXT: ldr x30, [sp], #48 // 8-byte Folded Reload
246 ; CHECK0-SDAG-NEXT: ret
248 ; CHECK0-GISEL-LABEL: multi_use_half_word:
249 ; CHECK0-GISEL: // %bb.0: // %entry
250 ; CHECK0-GISEL-NEXT: stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
251 ; CHECK0-GISEL-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
252 ; CHECK0-GISEL-NEXT: .cfi_def_cfa_offset 32
253 ; CHECK0-GISEL-NEXT: .cfi_offset w19, -8
254 ; CHECK0-GISEL-NEXT: .cfi_offset w20, -16
255 ; CHECK0-GISEL-NEXT: .cfi_offset w21, -24
256 ; CHECK0-GISEL-NEXT: .cfi_offset w30, -32
257 ; CHECK0-GISEL-NEXT: lsr w8, w1, #9
258 ; CHECK0-GISEL-NEXT: add x20, x0, w8, uxtb #1
259 ; CHECK0-GISEL-NEXT: ldrh w19, [x20]
260 ; CHECK0-GISEL-NEXT: add w21, w19, #1
261 ; CHECK0-GISEL-NEXT: bl foo
262 ; CHECK0-GISEL-NEXT: strh w19, [x20]
263 ; CHECK0-GISEL-NEXT: mov w0, w19
264 ; CHECK0-GISEL-NEXT: strh w21, [x20]
265 ; CHECK0-GISEL-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
266 ; CHECK0-GISEL-NEXT: ldp x30, x21, [sp], #32 // 16-byte Folded Reload
267 ; CHECK0-GISEL-NEXT: ret
269 ; CHECK3-SDAG-LABEL: multi_use_half_word:
270 ; CHECK3-SDAG: // %bb.0: // %entry
271 ; CHECK3-SDAG-NEXT: str x30, [sp, #-48]! // 8-byte Folded Spill
272 ; CHECK3-SDAG-NEXT: stp x22, x21, [sp, #16] // 16-byte Folded Spill
273 ; CHECK3-SDAG-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
274 ; CHECK3-SDAG-NEXT: .cfi_def_cfa_offset 48
275 ; CHECK3-SDAG-NEXT: .cfi_offset w19, -8
276 ; CHECK3-SDAG-NEXT: .cfi_offset w20, -16
277 ; CHECK3-SDAG-NEXT: .cfi_offset w21, -24
278 ; CHECK3-SDAG-NEXT: .cfi_offset w22, -32
279 ; CHECK3-SDAG-NEXT: .cfi_offset w30, -48
280 ; CHECK3-SDAG-NEXT: // kill: def $w1 killed $w1 def $x1
281 ; CHECK3-SDAG-NEXT: ubfx x21, x1, #9, #8
282 ; CHECK3-SDAG-NEXT: mov x19, x0
283 ; CHECK3-SDAG-NEXT: ldrh w20, [x0, x21, lsl #1]
284 ; CHECK3-SDAG-NEXT: add w22, w20, #1
285 ; CHECK3-SDAG-NEXT: bl foo
286 ; CHECK3-SDAG-NEXT: mov w0, w20
287 ; CHECK3-SDAG-NEXT: strh w22, [x19, x21, lsl #1]
288 ; CHECK3-SDAG-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
289 ; CHECK3-SDAG-NEXT: ldp x22, x21, [sp, #16] // 16-byte Folded Reload
290 ; CHECK3-SDAG-NEXT: ldr x30, [sp], #48 // 8-byte Folded Reload
291 ; CHECK3-SDAG-NEXT: ret
293 ; CHECK3-GISEL-LABEL: multi_use_half_word:
294 ; CHECK3-GISEL: // %bb.0: // %entry
295 ; CHECK3-GISEL-NEXT: str x30, [sp, #-48]! // 8-byte Folded Spill
296 ; CHECK3-GISEL-NEXT: stp x22, x21, [sp, #16] // 16-byte Folded Spill
297 ; CHECK3-GISEL-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
298 ; CHECK3-GISEL-NEXT: .cfi_def_cfa_offset 48
299 ; CHECK3-GISEL-NEXT: .cfi_offset w19, -8
300 ; CHECK3-GISEL-NEXT: .cfi_offset w20, -16
301 ; CHECK3-GISEL-NEXT: .cfi_offset w21, -24
302 ; CHECK3-GISEL-NEXT: .cfi_offset w22, -32
303 ; CHECK3-GISEL-NEXT: .cfi_offset w30, -48
304 ; CHECK3-GISEL-NEXT: lsr w8, w1, #9
305 ; CHECK3-GISEL-NEXT: mov x19, x0
306 ; CHECK3-GISEL-NEXT: and x21, x8, #0xff
307 ; CHECK3-GISEL-NEXT: ldrh w20, [x0, x21, lsl #1]
308 ; CHECK3-GISEL-NEXT: add w22, w20, #1
309 ; CHECK3-GISEL-NEXT: bl foo
310 ; CHECK3-GISEL-NEXT: strh w20, [x19, x21, lsl #1]
311 ; CHECK3-GISEL-NEXT: mov w0, w20
312 ; CHECK3-GISEL-NEXT: strh w22, [x19, x21, lsl #1]
313 ; CHECK3-GISEL-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
314 ; CHECK3-GISEL-NEXT: ldp x22, x21, [sp, #16] // 16-byte Folded Reload
315 ; CHECK3-GISEL-NEXT: ldr x30, [sp], #48 // 8-byte Folded Reload
316 ; CHECK3-GISEL-NEXT: ret
318 %shr81 = lshr i32 %xor72, 9
319 %conv82 = zext i32 %shr81 to i64
320 %idxprom83 = and i64 %conv82, 255
321 %arrayidx86 = getelementptr inbounds %struct.a, ptr %ctx, i64 0, i64 %idxprom83
322 %result = load i16, ptr %arrayidx86, align 2
323 %result2 = add i16 %result, 1
325 store i16 %result, ptr %arrayidx86, align 2
326 store i16 %result2, ptr %arrayidx86, align 2
330 define i64 @multi_use_non_memory_call(i64 %a, i64 %b) {
331 ; CHECK-LABEL: multi_use_non_memory_call:
332 ; CHECK: // %bb.0: // %entry
333 ; CHECK-NEXT: lsl x8, x0, #3
334 ; CHECK-NEXT: lsl x9, x1, #3
335 ; CHECK-NEXT: cmp x8, x9
336 ; CHECK-NEXT: b.lt .LBB4_2
337 ; CHECK-NEXT: // %bb.1: // %falsebb
338 ; CHECK-NEXT: csel x0, x8, x9, gt
340 ; CHECK-NEXT: .LBB4_2: // %truebb
341 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
342 ; CHECK-NEXT: .cfi_def_cfa_offset 16
343 ; CHECK-NEXT: .cfi_offset w30, -16
346 %mul1 = shl i64 %a, 3
347 %mul2 = shl i64 %b, 3
348 %cmp = icmp slt i64 %mul1, %mul2
349 br i1 %cmp, label %truebb, label %falsebb
351 tail call void @foo()
354 %cmp2 = icmp sgt i64 %mul1, %mul2
355 br i1 %cmp2, label %exitbb, label %endbb
362 define i64 @gep3(ptr %p, i64 %b) {
365 ; CHECK-NEXT: mov x8, x0
366 ; CHECK-NEXT: ldr x0, [x0, x1, lsl #3]
367 ; CHECK-NEXT: str x1, [x8, x1, lsl #3]
369 %g = getelementptr inbounds i64, ptr %p, i64 %b
370 %l = load i64, ptr %g
375 define i128 @gep4(ptr %p, i128 %a, i64 %b) {
376 ; CHECK0-SDAG-LABEL: gep4:
377 ; CHECK0-SDAG: // %bb.0:
378 ; CHECK0-SDAG-NEXT: add x8, x0, x4, lsl #4
379 ; CHECK0-SDAG-NEXT: ldp x0, x1, [x8]
380 ; CHECK0-SDAG-NEXT: stp x2, x3, [x8]
381 ; CHECK0-SDAG-NEXT: ret
383 ; CHECK0-GISEL-LABEL: gep4:
384 ; CHECK0-GISEL: // %bb.0:
385 ; CHECK0-GISEL-NEXT: add x8, x0, x4, lsl #4
386 ; CHECK0-GISEL-NEXT: mov v0.d[0], x2
387 ; CHECK0-GISEL-NEXT: ldr q1, [x8]
388 ; CHECK0-GISEL-NEXT: mov d2, v1.d[1]
389 ; CHECK0-GISEL-NEXT: mov v0.d[1], x3
390 ; CHECK0-GISEL-NEXT: fmov x0, d1
391 ; CHECK0-GISEL-NEXT: fmov x1, d2
392 ; CHECK0-GISEL-NEXT: str q0, [x8]
393 ; CHECK0-GISEL-NEXT: ret
395 ; CHECK3-SDAG-LABEL: gep4:
396 ; CHECK3-SDAG: // %bb.0:
397 ; CHECK3-SDAG-NEXT: add x8, x0, x4, lsl #4
398 ; CHECK3-SDAG-NEXT: ldp x0, x1, [x8]
399 ; CHECK3-SDAG-NEXT: stp x2, x3, [x8]
400 ; CHECK3-SDAG-NEXT: ret
402 ; CHECK3-GISEL-LABEL: gep4:
403 ; CHECK3-GISEL: // %bb.0:
404 ; CHECK3-GISEL-NEXT: ldr q1, [x0, x4, lsl #4]
405 ; CHECK3-GISEL-NEXT: mov v0.d[0], x2
406 ; CHECK3-GISEL-NEXT: mov x8, x0
407 ; CHECK3-GISEL-NEXT: mov d2, v1.d[1]
408 ; CHECK3-GISEL-NEXT: fmov x0, d1
409 ; CHECK3-GISEL-NEXT: mov v0.d[1], x3
410 ; CHECK3-GISEL-NEXT: fmov x1, d2
411 ; CHECK3-GISEL-NEXT: str q0, [x8, x4, lsl #4]
412 ; CHECK3-GISEL-NEXT: ret
413 %g = getelementptr inbounds i128, ptr %p, i64 %b
414 %l = load i128, ptr %g
415 store i128 %a, ptr %g
419 define i64 @addlsl3(i64 %a, i64 %b) {
420 ; CHECK-LABEL: addlsl3:
422 ; CHECK-NEXT: lsl x8, x0, #3
423 ; CHECK-NEXT: add x9, x1, x8
424 ; CHECK-NEXT: sub x8, x1, x8
425 ; CHECK-NEXT: eor x0, x9, x8
434 define i64 @addlsl4(i64 %a, i64 %b) {
435 ; CHECK-LABEL: addlsl4:
437 ; CHECK-NEXT: lsl x8, x0, #4
438 ; CHECK-NEXT: add x9, x1, x8
439 ; CHECK-NEXT: sub x8, x1, x8
440 ; CHECK-NEXT: eor x0, x9, x8
448 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: