1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=ve | FileCheck %s
3 ; RUN: llc < %s -mtriple=ve -relocation-model=pic \
4 ; RUN: | FileCheck %s --check-prefix=PIC
6 ;;; Check stack frame allocation of a function which calls other functions
7 ;;; under following conditions and combinations of them:
8 ;;; - access variable or not
9 ;;; - no stack object, a stack object using BP, or a stack object not using BP
10 ;;; - isPositionIndependent or not
12 @data = external global i8, align 1
14 ; Function Attrs: nounwind
15 define ptr @test_frame0(ptr %0, ptr %1) {
16 ; CHECK-LABEL: test_frame0:
18 ; CHECK-NEXT: st %s9, (, %s11)
19 ; CHECK-NEXT: st %s10, 8(, %s11)
20 ; CHECK-NEXT: or %s9, 0, %s11
21 ; CHECK-NEXT: lea %s11, -240(, %s11)
22 ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB0_2
23 ; CHECK-NEXT: # %bb.1:
24 ; CHECK-NEXT: ld %s61, 24(, %s14)
25 ; CHECK-NEXT: or %s62, 0, %s0
26 ; CHECK-NEXT: lea %s63, 315
27 ; CHECK-NEXT: shm.l %s63, (%s61)
28 ; CHECK-NEXT: shm.l %s8, 8(%s61)
29 ; CHECK-NEXT: shm.l %s11, 16(%s61)
31 ; CHECK-NEXT: or %s0, 0, %s62
32 ; CHECK-NEXT: .LBB0_2:
33 ; CHECK-NEXT: lea %s2, fun@lo
34 ; CHECK-NEXT: and %s2, %s2, (32)0
35 ; CHECK-NEXT: lea.sl %s12, fun@hi(, %s2)
36 ; CHECK-NEXT: bsic %s10, (, %s12)
37 ; CHECK-NEXT: or %s11, 0, %s9
38 ; CHECK-NEXT: ld %s10, 8(, %s11)
39 ; CHECK-NEXT: ld %s9, (, %s11)
40 ; CHECK-NEXT: b.l.t (, %s10)
42 ; PIC-LABEL: test_frame0:
44 ; PIC-NEXT: st %s9, (, %s11)
45 ; PIC-NEXT: st %s10, 8(, %s11)
46 ; PIC-NEXT: st %s15, 24(, %s11)
47 ; PIC-NEXT: st %s16, 32(, %s11)
48 ; PIC-NEXT: or %s9, 0, %s11
49 ; PIC-NEXT: lea %s11, -240(, %s11)
50 ; PIC-NEXT: brge.l.t %s11, %s8, .LBB0_2
52 ; PIC-NEXT: ld %s61, 24(, %s14)
53 ; PIC-NEXT: or %s62, 0, %s0
54 ; PIC-NEXT: lea %s63, 315
55 ; PIC-NEXT: shm.l %s63, (%s61)
56 ; PIC-NEXT: shm.l %s8, 8(%s61)
57 ; PIC-NEXT: shm.l %s11, 16(%s61)
59 ; PIC-NEXT: or %s0, 0, %s62
61 ; PIC-NEXT: lea %s15, _GLOBAL_OFFSET_TABLE_@pc_lo(-24)
62 ; PIC-NEXT: and %s15, %s15, (32)0
64 ; PIC-NEXT: lea.sl %s15, _GLOBAL_OFFSET_TABLE_@pc_hi(%s16, %s15)
65 ; PIC-NEXT: lea %s12, fun@plt_lo(-24)
66 ; PIC-NEXT: and %s12, %s12, (32)0
68 ; PIC-NEXT: lea.sl %s12, fun@plt_hi(%s16, %s12)
69 ; PIC-NEXT: bsic %s10, (, %s12)
70 ; PIC-NEXT: or %s11, 0, %s9
71 ; PIC-NEXT: ld %s16, 32(, %s11)
72 ; PIC-NEXT: ld %s15, 24(, %s11)
73 ; PIC-NEXT: ld %s10, 8(, %s11)
74 ; PIC-NEXT: ld %s9, (, %s11)
75 ; PIC-NEXT: b.l.t (, %s10)
76 %3 = tail call ptr @fun(ptr %0, ptr %1)
80 declare ptr @fun(ptr, ptr)
82 ; Function Attrs: nounwind
83 define ptr @test_frame32(ptr %0) {
84 ; CHECK-LABEL: test_frame32:
86 ; CHECK-NEXT: st %s9, (, %s11)
87 ; CHECK-NEXT: st %s10, 8(, %s11)
88 ; CHECK-NEXT: or %s9, 0, %s11
89 ; CHECK-NEXT: lea %s11, -272(, %s11)
90 ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB1_2
91 ; CHECK-NEXT: # %bb.1:
92 ; CHECK-NEXT: ld %s61, 24(, %s14)
93 ; CHECK-NEXT: or %s62, 0, %s0
94 ; CHECK-NEXT: lea %s63, 315
95 ; CHECK-NEXT: shm.l %s63, (%s61)
96 ; CHECK-NEXT: shm.l %s8, 8(%s61)
97 ; CHECK-NEXT: shm.l %s11, 16(%s61)
99 ; CHECK-NEXT: or %s0, 0, %s62
100 ; CHECK-NEXT: .LBB1_2:
101 ; CHECK-NEXT: or %s1, 0, %s0
102 ; CHECK-NEXT: lea %s0, fun@lo
103 ; CHECK-NEXT: and %s0, %s0, (32)0
104 ; CHECK-NEXT: lea.sl %s12, fun@hi(, %s0)
105 ; CHECK-NEXT: lea %s0, 240(, %s11)
106 ; CHECK-NEXT: bsic %s10, (, %s12)
107 ; CHECK-NEXT: or %s11, 0, %s9
108 ; CHECK-NEXT: ld %s10, 8(, %s11)
109 ; CHECK-NEXT: ld %s9, (, %s11)
110 ; CHECK-NEXT: b.l.t (, %s10)
112 ; PIC-LABEL: test_frame32:
114 ; PIC-NEXT: st %s9, (, %s11)
115 ; PIC-NEXT: st %s10, 8(, %s11)
116 ; PIC-NEXT: st %s15, 24(, %s11)
117 ; PIC-NEXT: st %s16, 32(, %s11)
118 ; PIC-NEXT: or %s9, 0, %s11
119 ; PIC-NEXT: lea %s11, -272(, %s11)
120 ; PIC-NEXT: brge.l.t %s11, %s8, .LBB1_2
122 ; PIC-NEXT: ld %s61, 24(, %s14)
123 ; PIC-NEXT: or %s62, 0, %s0
124 ; PIC-NEXT: lea %s63, 315
125 ; PIC-NEXT: shm.l %s63, (%s61)
126 ; PIC-NEXT: shm.l %s8, 8(%s61)
127 ; PIC-NEXT: shm.l %s11, 16(%s61)
129 ; PIC-NEXT: or %s0, 0, %s62
131 ; PIC-NEXT: or %s1, 0, %s0
132 ; PIC-NEXT: lea %s15, _GLOBAL_OFFSET_TABLE_@pc_lo(-24)
133 ; PIC-NEXT: and %s15, %s15, (32)0
135 ; PIC-NEXT: lea.sl %s15, _GLOBAL_OFFSET_TABLE_@pc_hi(%s16, %s15)
136 ; PIC-NEXT: lea %s12, fun@plt_lo(-24)
137 ; PIC-NEXT: and %s12, %s12, (32)0
139 ; PIC-NEXT: lea.sl %s12, fun@plt_hi(%s16, %s12)
140 ; PIC-NEXT: lea %s0, 240(, %s11)
141 ; PIC-NEXT: bsic %s10, (, %s12)
142 ; PIC-NEXT: or %s11, 0, %s9
143 ; PIC-NEXT: ld %s16, 32(, %s11)
144 ; PIC-NEXT: ld %s15, 24(, %s11)
145 ; PIC-NEXT: ld %s10, 8(, %s11)
146 ; PIC-NEXT: ld %s9, (, %s11)
147 ; PIC-NEXT: b.l.t (, %s10)
148 %2 = alloca [32 x i8], align 1
149 call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2)
150 %3 = call ptr @fun(ptr nonnull %2, ptr %0)
151 call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2)
155 ; Function Attrs: argmemonly nofree nosync nounwind willreturn
156 declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture)
158 ; Function Attrs: argmemonly nofree nosync nounwind willreturn
159 declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
161 ; Function Attrs: nounwind
162 define ptr @test_align32(i32 signext %0, ptr nocapture readnone %1) {
163 ; CHECK-LABEL: test_align32:
165 ; CHECK-NEXT: st %s9, (, %s11)
166 ; CHECK-NEXT: st %s10, 8(, %s11)
167 ; CHECK-NEXT: st %s17, 40(, %s11)
168 ; CHECK-NEXT: or %s9, 0, %s11
169 ; CHECK-NEXT: lea %s11, -288(, %s11)
170 ; CHECK-NEXT: and %s11, %s11, (59)1
171 ; CHECK-NEXT: or %s17, 0, %s11
172 ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB2_2
173 ; CHECK-NEXT: # %bb.1:
174 ; CHECK-NEXT: ld %s61, 24(, %s14)
175 ; CHECK-NEXT: or %s62, 0, %s0
176 ; CHECK-NEXT: lea %s63, 315
177 ; CHECK-NEXT: shm.l %s63, (%s61)
178 ; CHECK-NEXT: shm.l %s8, 8(%s61)
179 ; CHECK-NEXT: shm.l %s11, 16(%s61)
181 ; CHECK-NEXT: or %s0, 0, %s62
182 ; CHECK-NEXT: .LBB2_2:
183 ; CHECK-NEXT: lea %s0, 15(, %s0)
184 ; CHECK-NEXT: and %s0, -16, %s0
185 ; CHECK-NEXT: lea %s1, __ve_grow_stack_align@lo
186 ; CHECK-NEXT: and %s1, %s1, (32)0
187 ; CHECK-NEXT: lea.sl %s12, __ve_grow_stack_align@hi(, %s1)
188 ; CHECK-NEXT: or %s1, -32, (0)1
189 ; CHECK-NEXT: bsic %s10, (, %s12)
190 ; CHECK-NEXT: lea %s0, 240(, %s11)
191 ; CHECK-NEXT: lea %s0, 31(, %s0)
192 ; CHECK-NEXT: and %s1, -32, %s0
193 ; CHECK-NEXT: lea %s0, fun@lo
194 ; CHECK-NEXT: and %s0, %s0, (32)0
195 ; CHECK-NEXT: lea.sl %s12, fun@hi(, %s0)
196 ; CHECK-NEXT: lea %s0, 256(, %s17)
197 ; CHECK-NEXT: bsic %s10, (, %s12)
198 ; CHECK-NEXT: or %s11, 0, %s9
199 ; CHECK-NEXT: ld %s17, 40(, %s11)
200 ; CHECK-NEXT: ld %s10, 8(, %s11)
201 ; CHECK-NEXT: ld %s9, (, %s11)
202 ; CHECK-NEXT: b.l.t (, %s10)
204 ; PIC-LABEL: test_align32:
206 ; PIC-NEXT: st %s9, (, %s11)
207 ; PIC-NEXT: st %s10, 8(, %s11)
208 ; PIC-NEXT: st %s15, 24(, %s11)
209 ; PIC-NEXT: st %s16, 32(, %s11)
210 ; PIC-NEXT: st %s17, 40(, %s11)
211 ; PIC-NEXT: or %s9, 0, %s11
212 ; PIC-NEXT: lea %s11, -288(, %s11)
213 ; PIC-NEXT: and %s11, %s11, (59)1
214 ; PIC-NEXT: or %s17, 0, %s11
215 ; PIC-NEXT: brge.l.t %s11, %s8, .LBB2_2
217 ; PIC-NEXT: ld %s61, 24(, %s14)
218 ; PIC-NEXT: or %s62, 0, %s0
219 ; PIC-NEXT: lea %s63, 315
220 ; PIC-NEXT: shm.l %s63, (%s61)
221 ; PIC-NEXT: shm.l %s8, 8(%s61)
222 ; PIC-NEXT: shm.l %s11, 16(%s61)
224 ; PIC-NEXT: or %s0, 0, %s62
226 ; PIC-NEXT: lea %s15, _GLOBAL_OFFSET_TABLE_@pc_lo(-24)
227 ; PIC-NEXT: and %s15, %s15, (32)0
229 ; PIC-NEXT: lea.sl %s15, _GLOBAL_OFFSET_TABLE_@pc_hi(%s16, %s15)
230 ; PIC-NEXT: lea %s0, 15(, %s0)
231 ; PIC-NEXT: and %s0, -16, %s0
232 ; PIC-NEXT: lea %s12, __ve_grow_stack_align@plt_lo(-24)
233 ; PIC-NEXT: and %s12, %s12, (32)0
235 ; PIC-NEXT: lea.sl %s12, __ve_grow_stack_align@plt_hi(%s16, %s12)
236 ; PIC-NEXT: or %s1, -32, (0)1
237 ; PIC-NEXT: bsic %s10, (, %s12)
238 ; PIC-NEXT: lea %s0, 240(, %s11)
239 ; PIC-NEXT: lea %s0, 31(, %s0)
240 ; PIC-NEXT: and %s1, -32, %s0
241 ; PIC-NEXT: lea %s12, fun@plt_lo(-24)
242 ; PIC-NEXT: and %s12, %s12, (32)0
244 ; PIC-NEXT: lea.sl %s12, fun@plt_hi(%s16, %s12)
245 ; PIC-NEXT: lea %s0, 256(, %s17)
246 ; PIC-NEXT: bsic %s10, (, %s12)
247 ; PIC-NEXT: or %s11, 0, %s9
248 ; PIC-NEXT: ld %s17, 40(, %s11)
249 ; PIC-NEXT: ld %s16, 32(, %s11)
250 ; PIC-NEXT: ld %s15, 24(, %s11)
251 ; PIC-NEXT: ld %s10, 8(, %s11)
252 ; PIC-NEXT: ld %s9, (, %s11)
253 ; PIC-NEXT: b.l.t (, %s10)
254 %3 = alloca [32 x i8], align 32
255 call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3)
256 %4 = sext i32 %0 to i64
257 %5 = alloca i8, i64 %4, align 32
258 %6 = call ptr @fun(ptr nonnull %3, ptr nonnull %5)
259 call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3)
263 ; Function Attrs: nounwind
264 define ptr @test_frame0_var(ptr %0, ptr %1) {
265 ; CHECK-LABEL: test_frame0_var:
267 ; CHECK-NEXT: st %s9, (, %s11)
268 ; CHECK-NEXT: st %s10, 8(, %s11)
269 ; CHECK-NEXT: or %s9, 0, %s11
270 ; CHECK-NEXT: lea %s11, -240(, %s11)
271 ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB3_2
272 ; CHECK-NEXT: # %bb.1:
273 ; CHECK-NEXT: ld %s61, 24(, %s14)
274 ; CHECK-NEXT: or %s62, 0, %s0
275 ; CHECK-NEXT: lea %s63, 315
276 ; CHECK-NEXT: shm.l %s63, (%s61)
277 ; CHECK-NEXT: shm.l %s8, 8(%s61)
278 ; CHECK-NEXT: shm.l %s11, 16(%s61)
280 ; CHECK-NEXT: or %s0, 0, %s62
281 ; CHECK-NEXT: .LBB3_2:
282 ; CHECK-NEXT: lea %s2, data@lo
283 ; CHECK-NEXT: and %s2, %s2, (32)0
284 ; CHECK-NEXT: lea.sl %s2, data@hi(, %s2)
285 ; CHECK-NEXT: ld1b.zx %s2, (, %s2)
286 ; CHECK-NEXT: st1b %s2, (, %s0)
287 ; CHECK-NEXT: lea %s2, fun@lo
288 ; CHECK-NEXT: and %s2, %s2, (32)0
289 ; CHECK-NEXT: lea.sl %s12, fun@hi(, %s2)
290 ; CHECK-NEXT: bsic %s10, (, %s12)
291 ; CHECK-NEXT: or %s11, 0, %s9
292 ; CHECK-NEXT: ld %s10, 8(, %s11)
293 ; CHECK-NEXT: ld %s9, (, %s11)
294 ; CHECK-NEXT: b.l.t (, %s10)
296 ; PIC-LABEL: test_frame0_var:
298 ; PIC-NEXT: st %s9, (, %s11)
299 ; PIC-NEXT: st %s10, 8(, %s11)
300 ; PIC-NEXT: st %s15, 24(, %s11)
301 ; PIC-NEXT: st %s16, 32(, %s11)
302 ; PIC-NEXT: or %s9, 0, %s11
303 ; PIC-NEXT: lea %s11, -240(, %s11)
304 ; PIC-NEXT: brge.l.t %s11, %s8, .LBB3_2
306 ; PIC-NEXT: ld %s61, 24(, %s14)
307 ; PIC-NEXT: or %s62, 0, %s0
308 ; PIC-NEXT: lea %s63, 315
309 ; PIC-NEXT: shm.l %s63, (%s61)
310 ; PIC-NEXT: shm.l %s8, 8(%s61)
311 ; PIC-NEXT: shm.l %s11, 16(%s61)
313 ; PIC-NEXT: or %s0, 0, %s62
315 ; PIC-NEXT: lea %s15, _GLOBAL_OFFSET_TABLE_@pc_lo(-24)
316 ; PIC-NEXT: and %s15, %s15, (32)0
318 ; PIC-NEXT: lea.sl %s15, _GLOBAL_OFFSET_TABLE_@pc_hi(%s16, %s15)
319 ; PIC-NEXT: lea %s2, data@got_lo
320 ; PIC-NEXT: and %s2, %s2, (32)0
321 ; PIC-NEXT: lea.sl %s2, data@got_hi(, %s2)
322 ; PIC-NEXT: ld %s2, (%s2, %s15)
323 ; PIC-NEXT: ld1b.zx %s2, (, %s2)
324 ; PIC-NEXT: st1b %s2, (, %s0)
325 ; PIC-NEXT: lea %s12, fun@plt_lo(-24)
326 ; PIC-NEXT: and %s12, %s12, (32)0
328 ; PIC-NEXT: lea.sl %s12, fun@plt_hi(%s16, %s12)
329 ; PIC-NEXT: bsic %s10, (, %s12)
330 ; PIC-NEXT: or %s11, 0, %s9
331 ; PIC-NEXT: ld %s16, 32(, %s11)
332 ; PIC-NEXT: ld %s15, 24(, %s11)
333 ; PIC-NEXT: ld %s10, 8(, %s11)
334 ; PIC-NEXT: ld %s9, (, %s11)
335 ; PIC-NEXT: b.l.t (, %s10)
336 %3 = load i8, ptr @data, align 1
337 store i8 %3, ptr %0, align 1
338 %4 = tail call ptr @fun(ptr nonnull %0, ptr %1)
342 ; Function Attrs: nounwind
343 define ptr @test_frame32_var(ptr %0) {
344 ; CHECK-LABEL: test_frame32_var:
346 ; CHECK-NEXT: st %s9, (, %s11)
347 ; CHECK-NEXT: st %s10, 8(, %s11)
348 ; CHECK-NEXT: or %s9, 0, %s11
349 ; CHECK-NEXT: lea %s11, -272(, %s11)
350 ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB4_2
351 ; CHECK-NEXT: # %bb.1:
352 ; CHECK-NEXT: ld %s61, 24(, %s14)
353 ; CHECK-NEXT: or %s62, 0, %s0
354 ; CHECK-NEXT: lea %s63, 315
355 ; CHECK-NEXT: shm.l %s63, (%s61)
356 ; CHECK-NEXT: shm.l %s8, 8(%s61)
357 ; CHECK-NEXT: shm.l %s11, 16(%s61)
359 ; CHECK-NEXT: or %s0, 0, %s62
360 ; CHECK-NEXT: .LBB4_2:
361 ; CHECK-NEXT: lea %s1, data@lo
362 ; CHECK-NEXT: and %s1, %s1, (32)0
363 ; CHECK-NEXT: lea.sl %s1, data@hi(, %s1)
364 ; CHECK-NEXT: ld1b.zx %s2, (, %s1)
365 ; CHECK-NEXT: or %s1, 0, %s0
366 ; CHECK-NEXT: st1b %s2, 240(, %s11)
367 ; CHECK-NEXT: lea %s0, fun@lo
368 ; CHECK-NEXT: and %s0, %s0, (32)0
369 ; CHECK-NEXT: lea.sl %s12, fun@hi(, %s0)
370 ; CHECK-NEXT: lea %s0, 240(, %s11)
371 ; CHECK-NEXT: bsic %s10, (, %s12)
372 ; CHECK-NEXT: or %s11, 0, %s9
373 ; CHECK-NEXT: ld %s10, 8(, %s11)
374 ; CHECK-NEXT: ld %s9, (, %s11)
375 ; CHECK-NEXT: b.l.t (, %s10)
377 ; PIC-LABEL: test_frame32_var:
379 ; PIC-NEXT: st %s9, (, %s11)
380 ; PIC-NEXT: st %s10, 8(, %s11)
381 ; PIC-NEXT: st %s15, 24(, %s11)
382 ; PIC-NEXT: st %s16, 32(, %s11)
383 ; PIC-NEXT: or %s9, 0, %s11
384 ; PIC-NEXT: lea %s11, -272(, %s11)
385 ; PIC-NEXT: brge.l.t %s11, %s8, .LBB4_2
387 ; PIC-NEXT: ld %s61, 24(, %s14)
388 ; PIC-NEXT: or %s62, 0, %s0
389 ; PIC-NEXT: lea %s63, 315
390 ; PIC-NEXT: shm.l %s63, (%s61)
391 ; PIC-NEXT: shm.l %s8, 8(%s61)
392 ; PIC-NEXT: shm.l %s11, 16(%s61)
394 ; PIC-NEXT: or %s0, 0, %s62
396 ; PIC-NEXT: lea %s15, _GLOBAL_OFFSET_TABLE_@pc_lo(-24)
397 ; PIC-NEXT: and %s15, %s15, (32)0
399 ; PIC-NEXT: lea.sl %s15, _GLOBAL_OFFSET_TABLE_@pc_hi(%s16, %s15)
400 ; PIC-NEXT: lea %s1, data@got_lo
401 ; PIC-NEXT: and %s1, %s1, (32)0
402 ; PIC-NEXT: lea.sl %s1, data@got_hi(, %s1)
403 ; PIC-NEXT: ld %s1, (%s1, %s15)
404 ; PIC-NEXT: ld1b.zx %s2, (, %s1)
405 ; PIC-NEXT: or %s1, 0, %s0
406 ; PIC-NEXT: st1b %s2, 240(, %s11)
407 ; PIC-NEXT: lea %s12, fun@plt_lo(-24)
408 ; PIC-NEXT: and %s12, %s12, (32)0
410 ; PIC-NEXT: lea.sl %s12, fun@plt_hi(%s16, %s12)
411 ; PIC-NEXT: lea %s0, 240(, %s11)
412 ; PIC-NEXT: bsic %s10, (, %s12)
413 ; PIC-NEXT: or %s11, 0, %s9
414 ; PIC-NEXT: ld %s16, 32(, %s11)
415 ; PIC-NEXT: ld %s15, 24(, %s11)
416 ; PIC-NEXT: ld %s10, 8(, %s11)
417 ; PIC-NEXT: ld %s9, (, %s11)
418 ; PIC-NEXT: b.l.t (, %s10)
419 %2 = alloca [32 x i8], align 1
420 call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2)
421 %3 = load i8, ptr @data, align 1
422 store i8 %3, ptr %2, align 1
423 %4 = call ptr @fun(ptr nonnull %2, ptr %0)
424 call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2)
428 ; Function Attrs: nounwind
429 define ptr @test_align32_var(i32 signext %0, ptr nocapture readnone %1) {
430 ; CHECK-LABEL: test_align32_var:
432 ; CHECK-NEXT: st %s9, (, %s11)
433 ; CHECK-NEXT: st %s10, 8(, %s11)
434 ; CHECK-NEXT: st %s17, 40(, %s11)
435 ; CHECK-NEXT: or %s9, 0, %s11
436 ; CHECK-NEXT: lea %s11, -288(, %s11)
437 ; CHECK-NEXT: and %s11, %s11, (59)1
438 ; CHECK-NEXT: or %s17, 0, %s11
439 ; CHECK-NEXT: brge.l.t %s11, %s8, .LBB5_2
440 ; CHECK-NEXT: # %bb.1:
441 ; CHECK-NEXT: ld %s61, 24(, %s14)
442 ; CHECK-NEXT: or %s62, 0, %s0
443 ; CHECK-NEXT: lea %s63, 315
444 ; CHECK-NEXT: shm.l %s63, (%s61)
445 ; CHECK-NEXT: shm.l %s8, 8(%s61)
446 ; CHECK-NEXT: shm.l %s11, 16(%s61)
448 ; CHECK-NEXT: or %s0, 0, %s62
449 ; CHECK-NEXT: .LBB5_2:
450 ; CHECK-NEXT: lea %s0, 15(, %s0)
451 ; CHECK-NEXT: and %s0, -16, %s0
452 ; CHECK-NEXT: lea %s1, __ve_grow_stack_align@lo
453 ; CHECK-NEXT: and %s1, %s1, (32)0
454 ; CHECK-NEXT: lea.sl %s12, __ve_grow_stack_align@hi(, %s1)
455 ; CHECK-NEXT: or %s1, -32, (0)1
456 ; CHECK-NEXT: bsic %s10, (, %s12)
457 ; CHECK-NEXT: lea %s0, 240(, %s11)
458 ; CHECK-NEXT: lea %s1, data@lo
459 ; CHECK-NEXT: and %s1, %s1, (32)0
460 ; CHECK-NEXT: lea.sl %s1, data@hi(, %s1)
461 ; CHECK-NEXT: ld1b.zx %s2, (, %s1)
462 ; CHECK-NEXT: lea %s0, 31(, %s0)
463 ; CHECK-NEXT: and %s1, -32, %s0
464 ; CHECK-NEXT: st1b %s2, (, %s1)
465 ; CHECK-NEXT: lea %s0, fun@lo
466 ; CHECK-NEXT: and %s0, %s0, (32)0
467 ; CHECK-NEXT: lea.sl %s12, fun@hi(, %s0)
468 ; CHECK-NEXT: lea %s0, 256(, %s17)
469 ; CHECK-NEXT: bsic %s10, (, %s12)
470 ; CHECK-NEXT: or %s11, 0, %s9
471 ; CHECK-NEXT: ld %s17, 40(, %s11)
472 ; CHECK-NEXT: ld %s10, 8(, %s11)
473 ; CHECK-NEXT: ld %s9, (, %s11)
474 ; CHECK-NEXT: b.l.t (, %s10)
476 ; PIC-LABEL: test_align32_var:
478 ; PIC-NEXT: st %s9, (, %s11)
479 ; PIC-NEXT: st %s10, 8(, %s11)
480 ; PIC-NEXT: st %s15, 24(, %s11)
481 ; PIC-NEXT: st %s16, 32(, %s11)
482 ; PIC-NEXT: st %s17, 40(, %s11)
483 ; PIC-NEXT: or %s9, 0, %s11
484 ; PIC-NEXT: lea %s11, -288(, %s11)
485 ; PIC-NEXT: and %s11, %s11, (59)1
486 ; PIC-NEXT: or %s17, 0, %s11
487 ; PIC-NEXT: brge.l.t %s11, %s8, .LBB5_2
489 ; PIC-NEXT: ld %s61, 24(, %s14)
490 ; PIC-NEXT: or %s62, 0, %s0
491 ; PIC-NEXT: lea %s63, 315
492 ; PIC-NEXT: shm.l %s63, (%s61)
493 ; PIC-NEXT: shm.l %s8, 8(%s61)
494 ; PIC-NEXT: shm.l %s11, 16(%s61)
496 ; PIC-NEXT: or %s0, 0, %s62
498 ; PIC-NEXT: lea %s15, _GLOBAL_OFFSET_TABLE_@pc_lo(-24)
499 ; PIC-NEXT: and %s15, %s15, (32)0
501 ; PIC-NEXT: lea.sl %s15, _GLOBAL_OFFSET_TABLE_@pc_hi(%s16, %s15)
502 ; PIC-NEXT: lea %s0, 15(, %s0)
503 ; PIC-NEXT: and %s0, -16, %s0
504 ; PIC-NEXT: lea %s12, __ve_grow_stack_align@plt_lo(-24)
505 ; PIC-NEXT: and %s12, %s12, (32)0
507 ; PIC-NEXT: lea.sl %s12, __ve_grow_stack_align@plt_hi(%s16, %s12)
508 ; PIC-NEXT: or %s1, -32, (0)1
509 ; PIC-NEXT: bsic %s10, (, %s12)
510 ; PIC-NEXT: lea %s0, data@got_lo
511 ; PIC-NEXT: and %s0, %s0, (32)0
512 ; PIC-NEXT: lea.sl %s0, data@got_hi(, %s0)
513 ; PIC-NEXT: ld %s0, (%s0, %s15)
514 ; PIC-NEXT: lea %s1, 240(, %s11)
515 ; PIC-NEXT: ld1b.zx %s0, (, %s0)
516 ; PIC-NEXT: lea %s1, 31(, %s1)
517 ; PIC-NEXT: and %s1, -32, %s1
518 ; PIC-NEXT: st1b %s0, (, %s1)
519 ; PIC-NEXT: lea %s12, fun@plt_lo(-24)
520 ; PIC-NEXT: and %s12, %s12, (32)0
522 ; PIC-NEXT: lea.sl %s12, fun@plt_hi(%s16, %s12)
523 ; PIC-NEXT: lea %s0, 256(, %s17)
524 ; PIC-NEXT: bsic %s10, (, %s12)
525 ; PIC-NEXT: or %s11, 0, %s9
526 ; PIC-NEXT: ld %s17, 40(, %s11)
527 ; PIC-NEXT: ld %s16, 32(, %s11)
528 ; PIC-NEXT: ld %s15, 24(, %s11)
529 ; PIC-NEXT: ld %s10, 8(, %s11)
530 ; PIC-NEXT: ld %s9, (, %s11)
531 ; PIC-NEXT: b.l.t (, %s10)
532 %3 = alloca [32 x i8], align 32
533 call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3)
534 %4 = sext i32 %0 to i64
535 %5 = alloca i8, i64 %4, align 32
536 %6 = load i8, ptr @data, align 1
537 store i8 %6, ptr %5, align 32
538 %7 = call ptr @fun(ptr nonnull %3, ptr nonnull %5)
539 call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3)