1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s | FileCheck %s
3 target triple = "thumbv6m-unknown-unknown-eabi"
5 define void @vla_emergency_spill(i32 %n) {
6 ; CHECK-LABEL: vla_emergency_spill:
7 ; CHECK: @ %bb.0: @ %entry
8 ; CHECK-NEXT: .save {r4, r5, r6, r7, lr}
9 ; CHECK-NEXT: push {r4, r5, r6, r7, lr}
10 ; CHECK-NEXT: .setfp r7, sp, #12
11 ; CHECK-NEXT: add r7, sp, #12
12 ; CHECK-NEXT: .pad #4100
13 ; CHECK-NEXT: ldr r6, .LCPI0_0
14 ; CHECK-NEXT: add sp, r6
15 ; CHECK-NEXT: mov r6, sp
16 ; CHECK-NEXT: adds r0, r0, #7
17 ; CHECK-NEXT: movs r1, #7
18 ; CHECK-NEXT: bics r0, r1
19 ; CHECK-NEXT: mov r1, sp
20 ; CHECK-NEXT: subs r0, r1, r0
21 ; CHECK-NEXT: mov sp, r0
22 ; CHECK-NEXT: adds r1, r6, #4
25 ; CHECK-NEXT: str r0, [r6]
26 ; CHECK-NEXT: ldr r0, .LCPI0_1
27 ; CHECK-NEXT: str r5, [r0, r6]
28 ; CHECK-NEXT: ldr r0, [r6]
31 ; CHECK-NEXT: subs r4, r7, #7
32 ; CHECK-NEXT: subs r4, #5
33 ; CHECK-NEXT: mov sp, r4
34 ; CHECK-NEXT: pop {r4, r5, r6, r7, pc}
35 ; CHECK-NEXT: .p2align 2
36 ; CHECK-NEXT: @ %bb.1:
37 ; CHECK-NEXT: .LCPI0_0:
38 ; CHECK-NEXT: .long 4294963196 @ 0xffffeffc
39 ; CHECK-NEXT: .LCPI0_1:
40 ; CHECK-NEXT: .long 1024 @ 0x400
42 %x = alloca [1024 x i32], align 4
43 %vla = alloca i8, i32 %n, align 1
44 %asm1 = call { i32, i32, i32, i32, i32, i32 } asm "", "={r0},={r1},={r2},={r3},={r4},={r5},0,1,2,3,4,5"(i8* %vla, [1024 x i32]* %x, i32 undef, i32 undef, i32 undef, i32 undef)
45 %asmresult = extractvalue { i32, i32, i32, i32, i32, i32 } %asm1, 0
46 %asmresult1 = extractvalue { i32, i32, i32, i32, i32, i32 } %asm1, 1
47 %asmresult2 = extractvalue { i32, i32, i32, i32, i32, i32 } %asm1, 2
48 %asmresult3 = extractvalue { i32, i32, i32, i32, i32, i32 } %asm1, 3
49 %asmresult4 = extractvalue { i32, i32, i32, i32, i32, i32 } %asm1, 4
50 %asmresult5 = extractvalue { i32, i32, i32, i32, i32, i32 } %asm1, 5
51 %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* %x, i32 0, i32 255
52 store i32 %asmresult5, i32* %arrayidx, align 4
53 call void asm sideeffect "", "{r0},{r1},{r2},{r3},{r4},{r5}"(i32 %asmresult, i32 %asmresult1, i32 %asmresult2, i32 %asmresult3, i32 %asmresult4, i32 %asmresult5) #2
57 define void @simple_emergency_spill(i32 %n) {
58 ; CHECK-LABEL: simple_emergency_spill:
59 ; CHECK: @ %bb.0: @ %entry
60 ; CHECK-NEXT: .save {r4, r5, r6, r7, lr}
61 ; CHECK-NEXT: push {r4, r5, r6, r7, lr}
62 ; CHECK-NEXT: .pad #8196
63 ; CHECK-NEXT: ldr r7, .LCPI1_0
64 ; CHECK-NEXT: add sp, r7
65 ; CHECK-NEXT: add r0, sp, #4
66 ; CHECK-NEXT: ldr r1, .LCPI1_2
67 ; CHECK-NEXT: add r1, sp
70 ; CHECK-NEXT: str r0, [sp]
71 ; CHECK-NEXT: ldr r0, .LCPI1_3
72 ; CHECK-NEXT: add r0, sp
73 ; CHECK-NEXT: str r5, [r0]
74 ; CHECK-NEXT: ldr r0, [sp]
77 ; CHECK-NEXT: ldr r7, .LCPI1_1
78 ; CHECK-NEXT: add sp, r7
79 ; CHECK-NEXT: pop {r4, r5, r6, r7, pc}
80 ; CHECK-NEXT: .p2align 2
81 ; CHECK-NEXT: @ %bb.1:
82 ; CHECK-NEXT: .LCPI1_0:
83 ; CHECK-NEXT: .long 4294959100 @ 0xffffdffc
84 ; CHECK-NEXT: .LCPI1_1:
85 ; CHECK-NEXT: .long 8196 @ 0x2004
86 ; CHECK-NEXT: .LCPI1_2:
87 ; CHECK-NEXT: .long 4100 @ 0x1004
88 ; CHECK-NEXT: .LCPI1_3:
89 ; CHECK-NEXT: .long 5120 @ 0x1400
91 %x = alloca [1024 x i32], align 4
92 %y = alloca [1024 x i32], align 4
93 %asm1 = call { i32, i32, i32, i32, i32, i32, i32, i32 } asm "", "={r0},={r1},={r2},={r3},={r4},={r5},={r6},={r7},0,1,2,3,4,5,6,7"([1024 x i32]* %y, [1024 x i32]* %x, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef)
94 %asmresult = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 0
95 %asmresult2 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 1
96 %asmresult3 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 2
97 %asmresult4 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 3
98 %asmresult5 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 4
99 %asmresult6 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 5
100 %asmresult7 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 6
101 %asmresult8 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 7
102 %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* %x, i32 0, i32 255
103 store i32 %asmresult6, i32* %arrayidx, align 4
104 call void asm sideeffect "", "{r0},{r1},{r2},{r3},{r4},{r5},{r6},{r7}"(i32 %asmresult, i32 %asmresult2, i32 %asmresult3, i32 %asmresult4, i32 %asmresult5, i32 %asmresult6, i32 %asmresult7, i32 %asmresult8)
108 ; We have some logic to try to spill registers instead of allocating an
109 ; emergency spill slot, but for targets where the stack alignment is 8,
110 ; it only triggers when there are two available registers. (This is
111 ; maybe worth looking into, to improve the generated code quality.)
113 ; The scavenger itself only cares whether a register is allocatable, not
114 ; whether it was actually spilled in the prologue, and r7 is first on
115 ; the priority list, so we use it anyway. This is likely to confuse
116 ; debuggers, so maybe worth changing at some point.
117 define void @simple_emergency_spill_nor7(i32 %n) {
118 ; CHECK-LABEL: simple_emergency_spill_nor7:
119 ; CHECK: @ %bb.0: @ %entry
120 ; CHECK-NEXT: .save {r4, r5, r6, lr}
121 ; CHECK-NEXT: push {r4, r5, r6, lr}
122 ; CHECK-NEXT: .pad #8196
123 ; CHECK-NEXT: ldr r6, .LCPI2_0
124 ; CHECK-NEXT: add sp, r6
125 ; CHECK-NEXT: add r0, sp, #4
126 ; CHECK-NEXT: ldr r1, .LCPI2_2
127 ; CHECK-NEXT: add r1, sp
129 ; CHECK-NEXT: @NO_APP
130 ; CHECK-NEXT: str r7, [sp]
131 ; CHECK-NEXT: ldr r7, .LCPI2_3
132 ; CHECK-NEXT: add r7, sp
133 ; CHECK-NEXT: str r5, [r7]
134 ; CHECK-NEXT: ldr r7, [sp]
136 ; CHECK-NEXT: @NO_APP
137 ; CHECK-NEXT: ldr r6, .LCPI2_1
138 ; CHECK-NEXT: add sp, r6
139 ; CHECK-NEXT: pop {r4, r5, r6, pc}
140 ; CHECK-NEXT: .p2align 2
141 ; CHECK-NEXT: @ %bb.1:
142 ; CHECK-NEXT: .LCPI2_0:
143 ; CHECK-NEXT: .long 4294959100 @ 0xffffdffc
144 ; CHECK-NEXT: .LCPI2_1:
145 ; CHECK-NEXT: .long 8196 @ 0x2004
146 ; CHECK-NEXT: .LCPI2_2:
147 ; CHECK-NEXT: .long 4100 @ 0x1004
148 ; CHECK-NEXT: .LCPI2_3:
149 ; CHECK-NEXT: .long 5120 @ 0x1400
151 %x = alloca [1024 x i32], align 4
152 %y = alloca [1024 x i32], align 4
153 %asm1 = call { i32, i32, i32, i32, i32, i32, i32 } asm "", "={r0},={r1},={r2},={r3},={r4},={r5},={r6},0,1,2,3,4,5,6"([1024 x i32]* %y, [1024 x i32]* %x, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef)
154 %asmresult = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 0
155 %asmresult2 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 1
156 %asmresult3 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 2
157 %asmresult4 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 3
158 %asmresult5 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 4
159 %asmresult6 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 5
160 %asmresult7 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 6
161 %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* %x, i32 0, i32 255
162 store i32 %asmresult6, i32* %arrayidx, align 4
163 call void asm sideeffect "", "{r0},{r1},{r2},{r3},{r4},{r5},{r6}"(i32 %asmresult, i32 %asmresult2, i32 %asmresult3, i32 %asmresult4, i32 %asmresult5, i32 %asmresult6, i32 %asmresult7)
167 define void @arg_emergency_spill(i32 %n, i32 %n2, i32 %n3, i32 %n4, [252 x i32]* byval %p) {
168 ; CHECK-LABEL: arg_emergency_spill:
169 ; CHECK: @ %bb.0: @ %entry
170 ; CHECK-NEXT: .save {r4, r5, r6, r7, lr}
171 ; CHECK-NEXT: push {r4, r5, r6, r7, lr}
172 ; CHECK-NEXT: .pad #4
173 ; CHECK-NEXT: sub sp, #4
174 ; CHECK-NEXT: add r0, sp, #24
176 ; CHECK-NEXT: @NO_APP
177 ; CHECK-NEXT: str r0, [sp]
178 ; CHECK-NEXT: ldr r0, .LCPI3_0
179 ; CHECK-NEXT: add r0, sp
180 ; CHECK-NEXT: str r5, [r0]
181 ; CHECK-NEXT: ldr r0, [sp]
183 ; CHECK-NEXT: @NO_APP
184 ; CHECK-NEXT: add sp, #4
185 ; CHECK-NEXT: pop {r4, r5, r6, r7, pc}
186 ; CHECK-NEXT: .p2align 2
187 ; CHECK-NEXT: @ %bb.1:
188 ; CHECK-NEXT: .LCPI3_0:
189 ; CHECK-NEXT: .long 1028 @ 0x404
191 %pp = getelementptr inbounds [252 x i32], [252 x i32]* %p, i32 0, i32 0
192 %asm1 = call { i32, i32, i32, i32, i32, i32, i32, i32 } asm "", "={r0},={r1},={r2},={r3},={r4},={r5},={r6},={r7},0,1,2,3,4,5,6,7"(i32* %pp, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef)
193 %asmresult = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 0
194 %asmresult2 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 1
195 %asmresult3 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 2
196 %asmresult4 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 3
197 %asmresult5 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 4
198 %asmresult6 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 5
199 %asmresult7 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 6
200 %asmresult8 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 7
201 %arrayidx = getelementptr inbounds i32, i32* %pp, i32 251
202 store i32 %asmresult6, i32* %arrayidx, align 4
203 call void asm sideeffect "", "{r0},{r1},{r2},{r3},{r4},{r5},{r6},{r7}"(i32 %asmresult, i32 %asmresult2, i32 %asmresult3, i32 %asmresult4, i32 %asmresult5, i32 %asmresult6, i32 %asmresult7, i32 %asmresult8)
207 ; We currently overestimate the amount of required stack space by 16 bytes,
208 ; so this is the largest stack that doesn't require an emergency spill slot.
209 define void @arg_no_emergency_spill(i32 %n, i32 %n2, i32 %n3, i32 %n4, [248 x i32]* byval %p) {
210 ; CHECK-LABEL: arg_no_emergency_spill:
211 ; CHECK: @ %bb.0: @ %entry
212 ; CHECK-NEXT: .save {r4, r5, r6, r7, lr}
213 ; CHECK-NEXT: push {r4, r5, r6, r7, lr}
214 ; CHECK-NEXT: add r0, sp, #20
216 ; CHECK-NEXT: @NO_APP
217 ; CHECK-NEXT: str r5, [sp, #1008]
219 ; CHECK-NEXT: @NO_APP
220 ; CHECK-NEXT: pop {r4, r5, r6, r7, pc}
222 %pp = getelementptr inbounds [248 x i32], [248 x i32]* %p, i32 0, i32 0
223 %asm1 = call { i32, i32, i32, i32, i32, i32, i32, i32 } asm "", "={r0},={r1},={r2},={r3},={r4},={r5},={r6},={r7},0,1,2,3,4,5,6,7"(i32* %pp, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef)
224 %asmresult = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 0
225 %asmresult2 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 1
226 %asmresult3 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 2
227 %asmresult4 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 3
228 %asmresult5 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 4
229 %asmresult6 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 5
230 %asmresult7 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 6
231 %asmresult8 = extractvalue { i32, i32, i32, i32, i32, i32, i32, i32 } %asm1, 7
232 %arrayidx = getelementptr inbounds i32, i32* %pp, i32 247
233 store i32 %asmresult6, i32* %arrayidx, align 4
234 call void asm sideeffect "", "{r0},{r1},{r2},{r3},{r4},{r5},{r6},{r7}"(i32 %asmresult, i32 %asmresult2, i32 %asmresult3, i32 %asmresult4, i32 %asmresult5, i32 %asmresult6, i32 %asmresult7, i32 %asmresult8)
238 define void @aligned_emergency_spill(i32 %n, i32 %n2, i32 %n3, i32 %n4, [31 x i32]* byval %p) {
239 ; CHECK-LABEL: aligned_emergency_spill:
240 ; CHECK: @ %bb.0: @ %entry
241 ; CHECK-NEXT: .save {r4, r5, r6, r7, lr}
242 ; CHECK-NEXT: push {r4, r5, r6, r7, lr}
243 ; CHECK-NEXT: .setfp r7, sp, #12
244 ; CHECK-NEXT: add r7, sp, #12
245 ; CHECK-NEXT: .pad #44
246 ; CHECK-NEXT: sub sp, #44
247 ; CHECK-NEXT: mov r4, sp
248 ; CHECK-NEXT: lsrs r4, r4, #4
249 ; CHECK-NEXT: lsls r4, r4, #4
250 ; CHECK-NEXT: mov sp, r4
251 ; CHECK-NEXT: add r0, sp, #16
252 ; CHECK-NEXT: adds r1, r7, #7
253 ; CHECK-NEXT: adds r1, #1
255 ; CHECK-NEXT: @NO_APP
256 ; CHECK-NEXT: str r0, [sp, #12]
257 ; CHECK-NEXT: ldr r0, .LCPI5_0
258 ; CHECK-NEXT: str r5, [r0, r7]
259 ; CHECK-NEXT: ldr r0, [sp, #12]
261 ; CHECK-NEXT: @NO_APP
262 ; CHECK-NEXT: subs r4, r7, #7
263 ; CHECK-NEXT: subs r4, #5
264 ; CHECK-NEXT: mov sp, r4
265 ; CHECK-NEXT: pop {r4, r5, r6, r7, pc}
266 ; CHECK-NEXT: .p2align 2
267 ; CHECK-NEXT: @ %bb.1:
268 ; CHECK-NEXT: .LCPI5_0:
269 ; CHECK-NEXT: .long 128 @ 0x80
271 %y = alloca [4 x i32], align 16
272 %pp = getelementptr inbounds [31 x i32], [31 x i32]* %p, i32 0, i32 0
273 %asm1 = call { i32, i32, i32, i32, i32, i32, i32 } asm "", "={r0},={r1},={r2},={r3},={r4},={r5},={r6},0,1,2,3,4,5,6"([4 x i32]* %y, i32* %pp, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef) #3
274 %asmresult = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 0
275 %asmresult2 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 1
276 %asmresult3 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 2
277 %asmresult4 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 3
278 %asmresult5 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 4
279 %asmresult6 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 5
280 %asmresult7 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 6
281 %arrayidx = getelementptr inbounds i32, i32* %pp, i32 30
282 store i32 %asmresult6, i32* %arrayidx, align 4
283 call void asm sideeffect "", "{r0},{r1},{r2},{r3},{r4},{r5},{r6}"(i32 %asmresult, i32 %asmresult2, i32 %asmresult3, i32 %asmresult4, i32 %asmresult5, i32 %asmresult6, i32 %asmresult7)
287 ; This function should have no emergency spill slot, so its stack should be
288 ; smaller than @aligned_emergency_spill.
289 define void @aligned_no_emergency_spill(i32 %n, i32 %n2, i32 %n3, i32 %n4, [30 x i32]* byval %p) {
290 ; CHECK-LABEL: aligned_no_emergency_spill:
291 ; CHECK: @ %bb.0: @ %entry
292 ; CHECK-NEXT: .save {r4, r5, r6, r7, lr}
293 ; CHECK-NEXT: push {r4, r5, r6, r7, lr}
294 ; CHECK-NEXT: .setfp r7, sp, #12
295 ; CHECK-NEXT: add r7, sp, #12
296 ; CHECK-NEXT: .pad #28
297 ; CHECK-NEXT: sub sp, #28
298 ; CHECK-NEXT: mov r4, sp
299 ; CHECK-NEXT: lsrs r4, r4, #4
300 ; CHECK-NEXT: lsls r4, r4, #4
301 ; CHECK-NEXT: mov sp, r4
302 ; CHECK-NEXT: mov r0, sp
303 ; CHECK-NEXT: adds r1, r7, #7
304 ; CHECK-NEXT: adds r1, #1
306 ; CHECK-NEXT: @NO_APP
307 ; CHECK-NEXT: str r5, [r7, #124]
309 ; CHECK-NEXT: @NO_APP
310 ; CHECK-NEXT: subs r4, r7, #7
311 ; CHECK-NEXT: subs r4, #5
312 ; CHECK-NEXT: mov sp, r4
313 ; CHECK-NEXT: pop {r4, r5, r6, r7, pc}
315 %y = alloca [4 x i32], align 16
316 %pp = getelementptr inbounds [30 x i32], [30 x i32]* %p, i32 0, i32 0
317 %asm1 = call { i32, i32, i32, i32, i32, i32, i32 } asm "", "={r0},={r1},={r2},={r3},={r4},={r5},={r6},0,1,2,3,4,5,6"([4 x i32]* %y, i32* %pp, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef) #3
318 %asmresult = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 0
319 %asmresult2 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 1
320 %asmresult3 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 2
321 %asmresult4 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 3
322 %asmresult5 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 4
323 %asmresult6 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 5
324 %asmresult7 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 6
325 %arrayidx = getelementptr inbounds i32, i32* %pp, i32 29
326 store i32 %asmresult6, i32* %arrayidx, align 4
327 call void asm sideeffect "", "{r0},{r1},{r2},{r3},{r4},{r5},{r6}"(i32 %asmresult, i32 %asmresult2, i32 %asmresult3, i32 %asmresult4, i32 %asmresult5, i32 %asmresult6, i32 %asmresult7)
331 ; This function shouldn't fail to compile. (It's UB, so it doesn't really
332 ; matter what it compiles to, exactly, but we need to check at some point
333 ; so we don't generate code that requires an emergency spill slot we never
334 ; allocated. If the store gets eliminated, this testcase probably needs
336 define void @aligned_out_of_range_access(i32 %n, i32 %n2, i32 %n3, i32 %n4, [30 x i32]* byval %p) {
337 ; CHECK-LABEL: aligned_out_of_range_access:
338 ; CHECK: @ %bb.0: @ %entry
339 ; CHECK-NEXT: .save {r4, r5, r6, r7, lr}
340 ; CHECK-NEXT: push {r4, r5, r6, r7, lr}
341 ; CHECK-NEXT: .setfp r7, sp, #12
342 ; CHECK-NEXT: add r7, sp, #12
343 ; CHECK-NEXT: .pad #44
344 ; CHECK-NEXT: sub sp, #44
345 ; CHECK-NEXT: mov r4, sp
346 ; CHECK-NEXT: lsrs r4, r4, #4
347 ; CHECK-NEXT: lsls r4, r4, #4
348 ; CHECK-NEXT: mov sp, r4
349 ; CHECK-NEXT: add r0, sp, #16
350 ; CHECK-NEXT: adds r1, r7, #7
351 ; CHECK-NEXT: adds r1, #1
352 ; CHECK-NEXT: str r1, [sp, #12] @ 4-byte Spill
354 ; CHECK-NEXT: @NO_APP
355 ; CHECK-NEXT: str r0, [sp, #8] @ 4-byte Spill
356 ; CHECK-NEXT: ldr r0, [sp, #12] @ 4-byte Reload
357 ; CHECK-NEXT: str r5, [r0, #120]
358 ; CHECK-NEXT: ldr r0, [sp, #8] @ 4-byte Reload
360 ; CHECK-NEXT: @NO_APP
361 ; CHECK-NEXT: subs r4, r7, #7
362 ; CHECK-NEXT: subs r4, #5
363 ; CHECK-NEXT: mov sp, r4
364 ; CHECK-NEXT: pop {r4, r5, r6, r7, pc}
366 %y = alloca [4 x i32], align 16
367 %pp = getelementptr inbounds [30 x i32], [30 x i32]* %p, i32 0, i32 0
368 %asm1 = call { i32, i32, i32, i32, i32, i32, i32 } asm "", "={r0},={r1},={r2},={r3},={r4},={r5},={r6},0,1,2,3,4,5,6"([4 x i32]* %y, i32* %pp, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef) #3
369 %asmresult = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 0
370 %asmresult2 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 1
371 %asmresult3 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 2
372 %asmresult4 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 3
373 %asmresult5 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 4
374 %asmresult6 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 5
375 %asmresult7 = extractvalue { i32, i32, i32, i32, i32, i32, i32 } %asm1, 6
376 %arrayidx = getelementptr inbounds i32, i32* %pp, i32 30
377 store i32 %asmresult6, i32* %arrayidx, align 4
378 call void asm sideeffect "", "{r0},{r1},{r2},{r3},{r4},{r5},{r6}"(i32 %asmresult, i32 %asmresult2, i32 %asmresult3, i32 %asmresult4, i32 %asmresult5, i32 %asmresult6, i32 %asmresult7)