1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc --mtriple=loongarch64 --filetype=obj --verify-machineinstrs < %s \
3 ; RUN: -o /dev/null 2>&1
4 ; RUN: llc --mtriple=loongarch64 --verify-machineinstrs < %s | FileCheck %s
6 define void @relax_b28_spill() {
7 ; CHECK-LABEL: relax_b28_spill:
9 ; CHECK-NEXT: addi.d $sp, $sp, -96
10 ; CHECK-NEXT: .cfi_def_cfa_offset 96
11 ; CHECK-NEXT: st.d $ra, $sp, 88 # 8-byte Folded Spill
12 ; CHECK-NEXT: st.d $fp, $sp, 80 # 8-byte Folded Spill
13 ; CHECK-NEXT: st.d $s0, $sp, 72 # 8-byte Folded Spill
14 ; CHECK-NEXT: st.d $s1, $sp, 64 # 8-byte Folded Spill
15 ; CHECK-NEXT: st.d $s2, $sp, 56 # 8-byte Folded Spill
16 ; CHECK-NEXT: st.d $s3, $sp, 48 # 8-byte Folded Spill
17 ; CHECK-NEXT: st.d $s4, $sp, 40 # 8-byte Folded Spill
18 ; CHECK-NEXT: st.d $s5, $sp, 32 # 8-byte Folded Spill
19 ; CHECK-NEXT: st.d $s6, $sp, 24 # 8-byte Folded Spill
20 ; CHECK-NEXT: st.d $s7, $sp, 16 # 8-byte Folded Spill
21 ; CHECK-NEXT: st.d $s8, $sp, 8 # 8-byte Folded Spill
22 ; CHECK-NEXT: .cfi_offset 1, -8
23 ; CHECK-NEXT: .cfi_offset 22, -16
24 ; CHECK-NEXT: .cfi_offset 23, -24
25 ; CHECK-NEXT: .cfi_offset 24, -32
26 ; CHECK-NEXT: .cfi_offset 25, -40
27 ; CHECK-NEXT: .cfi_offset 26, -48
28 ; CHECK-NEXT: .cfi_offset 27, -56
29 ; CHECK-NEXT: .cfi_offset 28, -64
30 ; CHECK-NEXT: .cfi_offset 29, -72
31 ; CHECK-NEXT: .cfi_offset 30, -80
32 ; CHECK-NEXT: .cfi_offset 31, -88
34 ; CHECK-NEXT: addi.d $zero, $zero, 1
37 ; CHECK-NEXT: addi.d $ra, $zero, 1
40 ; CHECK-NEXT: addi.d $tp, $zero, 1
43 ; CHECK-NEXT: addi.d $a0, $zero, 1
46 ; CHECK-NEXT: addi.d $a1, $zero, 1
49 ; CHECK-NEXT: addi.d $a2, $zero, 1
52 ; CHECK-NEXT: addi.d $a3, $zero, 1
55 ; CHECK-NEXT: addi.d $a4, $zero, 1
58 ; CHECK-NEXT: addi.d $a5, $zero, 1
61 ; CHECK-NEXT: addi.d $a6, $zero, 1
64 ; CHECK-NEXT: addi.d $a7, $zero, 1
67 ; CHECK-NEXT: addi.d $t0, $zero, 1
70 ; CHECK-NEXT: addi.d $t1, $zero, 1
73 ; CHECK-NEXT: addi.d $t2, $zero, 1
76 ; CHECK-NEXT: addi.d $t3, $zero, 1
79 ; CHECK-NEXT: addi.d $t4, $zero, 1
82 ; CHECK-NEXT: addi.d $t5, $zero, 1
85 ; CHECK-NEXT: addi.d $t6, $zero, 1
88 ; CHECK-NEXT: addi.d $t7, $zero, 1
91 ; CHECK-NEXT: addi.d $t8, $zero, 1
94 ; CHECK-NEXT: addi.d $fp, $zero, 1
97 ; CHECK-NEXT: addi.d $s0, $zero, 1
100 ; CHECK-NEXT: addi.d $s1, $zero, 1
101 ; CHECK-NEXT: #NO_APP
103 ; CHECK-NEXT: addi.d $s2, $zero, 1
104 ; CHECK-NEXT: #NO_APP
106 ; CHECK-NEXT: addi.d $s3, $zero, 1
107 ; CHECK-NEXT: #NO_APP
109 ; CHECK-NEXT: addi.d $s4, $zero, 1
110 ; CHECK-NEXT: #NO_APP
112 ; CHECK-NEXT: addi.d $s5, $zero, 1
113 ; CHECK-NEXT: #NO_APP
115 ; CHECK-NEXT: addi.d $s6, $zero, 1
116 ; CHECK-NEXT: #NO_APP
118 ; CHECK-NEXT: addi.d $s7, $zero, 1
119 ; CHECK-NEXT: #NO_APP
121 ; CHECK-NEXT: addi.d $s8, $zero, 1
122 ; CHECK-NEXT: #NO_APP
123 ; CHECK-NEXT: beq $s7, $s8, .LBB0_1
124 ; CHECK-NEXT: # %bb.4:
125 ; CHECK-NEXT: st.d $t8, $sp, 0
126 ; CHECK-NEXT: pcalau12i $t8, %pc_hi20(.LBB0_5)
127 ; CHECK-NEXT: addi.d $t8, $t8, %pc_lo12(.LBB0_5)
129 ; CHECK-NEXT: .LBB0_1: # %iftrue
131 ; CHECK-NEXT: .space 536870912
132 ; CHECK-NEXT: #NO_APP
133 ; CHECK-NEXT: b .LBB0_3
134 ; CHECK-NEXT: .LBB0_5: # %iffalse
135 ; CHECK-NEXT: ld.d $t8, $sp, 0
136 ; CHECK-NEXT: # %bb.2: # %iffalse
138 ; CHECK-NEXT: # reg use $zero
139 ; CHECK-NEXT: #NO_APP
141 ; CHECK-NEXT: # reg use $ra
142 ; CHECK-NEXT: #NO_APP
144 ; CHECK-NEXT: # reg use $tp
145 ; CHECK-NEXT: #NO_APP
147 ; CHECK-NEXT: # reg use $a0
148 ; CHECK-NEXT: #NO_APP
150 ; CHECK-NEXT: # reg use $a1
151 ; CHECK-NEXT: #NO_APP
153 ; CHECK-NEXT: # reg use $a2
154 ; CHECK-NEXT: #NO_APP
156 ; CHECK-NEXT: # reg use $a3
157 ; CHECK-NEXT: #NO_APP
159 ; CHECK-NEXT: # reg use $a4
160 ; CHECK-NEXT: #NO_APP
162 ; CHECK-NEXT: # reg use $a5
163 ; CHECK-NEXT: #NO_APP
165 ; CHECK-NEXT: # reg use $a6
166 ; CHECK-NEXT: #NO_APP
168 ; CHECK-NEXT: # reg use $a7
169 ; CHECK-NEXT: #NO_APP
171 ; CHECK-NEXT: # reg use $t0
172 ; CHECK-NEXT: #NO_APP
174 ; CHECK-NEXT: # reg use $t1
175 ; CHECK-NEXT: #NO_APP
177 ; CHECK-NEXT: # reg use $t2
178 ; CHECK-NEXT: #NO_APP
180 ; CHECK-NEXT: # reg use $t3
181 ; CHECK-NEXT: #NO_APP
183 ; CHECK-NEXT: # reg use $t4
184 ; CHECK-NEXT: #NO_APP
186 ; CHECK-NEXT: # reg use $t5
187 ; CHECK-NEXT: #NO_APP
189 ; CHECK-NEXT: # reg use $t6
190 ; CHECK-NEXT: #NO_APP
192 ; CHECK-NEXT: # reg use $t7
193 ; CHECK-NEXT: #NO_APP
195 ; CHECK-NEXT: # reg use $t8
196 ; CHECK-NEXT: #NO_APP
198 ; CHECK-NEXT: # reg use $fp
199 ; CHECK-NEXT: #NO_APP
201 ; CHECK-NEXT: # reg use $s0
202 ; CHECK-NEXT: #NO_APP
204 ; CHECK-NEXT: # reg use $s1
205 ; CHECK-NEXT: #NO_APP
207 ; CHECK-NEXT: # reg use $s2
208 ; CHECK-NEXT: #NO_APP
210 ; CHECK-NEXT: # reg use $s3
211 ; CHECK-NEXT: #NO_APP
213 ; CHECK-NEXT: # reg use $s4
214 ; CHECK-NEXT: #NO_APP
216 ; CHECK-NEXT: # reg use $s5
217 ; CHECK-NEXT: #NO_APP
219 ; CHECK-NEXT: # reg use $s6
220 ; CHECK-NEXT: #NO_APP
222 ; CHECK-NEXT: # reg use $s7
223 ; CHECK-NEXT: #NO_APP
225 ; CHECK-NEXT: # reg use $s8
226 ; CHECK-NEXT: #NO_APP
227 ; CHECK-NEXT: .LBB0_3: # %iftrue
228 ; CHECK-NEXT: ld.d $s8, $sp, 8 # 8-byte Folded Reload
229 ; CHECK-NEXT: ld.d $s7, $sp, 16 # 8-byte Folded Reload
230 ; CHECK-NEXT: ld.d $s6, $sp, 24 # 8-byte Folded Reload
231 ; CHECK-NEXT: ld.d $s5, $sp, 32 # 8-byte Folded Reload
232 ; CHECK-NEXT: ld.d $s4, $sp, 40 # 8-byte Folded Reload
233 ; CHECK-NEXT: ld.d $s3, $sp, 48 # 8-byte Folded Reload
234 ; CHECK-NEXT: ld.d $s2, $sp, 56 # 8-byte Folded Reload
235 ; CHECK-NEXT: ld.d $s1, $sp, 64 # 8-byte Folded Reload
236 ; CHECK-NEXT: ld.d $s0, $sp, 72 # 8-byte Folded Reload
237 ; CHECK-NEXT: ld.d $fp, $sp, 80 # 8-byte Folded Reload
238 ; CHECK-NEXT: ld.d $ra, $sp, 88 # 8-byte Folded Reload
239 ; CHECK-NEXT: addi.d $sp, $sp, 96
241 %zero = call i64 asm sideeffect "addi.d $$zero, $$zero, 1", "={r0}"()
242 %ra = call i64 asm sideeffect "addi.d $$ra, $$zero, 1", "={r1}"()
243 %tp = call i64 asm sideeffect "addi.d $$tp, $$zero, 1", "={r2}"()
244 %a0 = call i64 asm sideeffect "addi.d $$a0, $$zero, 1", "={r4}"()
245 %a1 = call i64 asm sideeffect "addi.d $$a1, $$zero, 1", "={r5}"()
246 %a2 = call i64 asm sideeffect "addi.d $$a2, $$zero, 1", "={r6}"()
247 %a3 = call i64 asm sideeffect "addi.d $$a3, $$zero, 1", "={r7}"()
248 %a4 = call i64 asm sideeffect "addi.d $$a4, $$zero, 1", "={r8}"()
249 %a5 = call i64 asm sideeffect "addi.d $$a5, $$zero, 1", "={r9}"()
250 %a6 = call i64 asm sideeffect "addi.d $$a6, $$zero, 1", "={r10}"()
251 %a7 = call i64 asm sideeffect "addi.d $$a7, $$zero, 1", "={r11}"()
252 %t0 = call i64 asm sideeffect "addi.d $$t0, $$zero, 1", "={r12}"()
253 %t1 = call i64 asm sideeffect "addi.d $$t1, $$zero, 1", "={r13}"()
254 %t2 = call i64 asm sideeffect "addi.d $$t2, $$zero, 1", "={r14}"()
255 %t3 = call i64 asm sideeffect "addi.d $$t3, $$zero, 1", "={r15}"()
256 %t4 = call i64 asm sideeffect "addi.d $$t4, $$zero, 1", "={r16}"()
257 %t5 = call i64 asm sideeffect "addi.d $$t5, $$zero, 1", "={r17}"()
258 %t6 = call i64 asm sideeffect "addi.d $$t6, $$zero, 1", "={r18}"()
259 %t7 = call i64 asm sideeffect "addi.d $$t7, $$zero, 1", "={r19}"()
260 %t8 = call i64 asm sideeffect "addi.d $$t8, $$zero, 1", "={r20}"()
261 ;; r21 Reserved (Non-allocatable)
262 %s9 = call i64 asm sideeffect "addi.d $$s9, $$zero, 1", "={r22}"()
263 %s0 = call i64 asm sideeffect "addi.d $$s0, $$zero, 1", "={r23}"()
264 %s1 = call i64 asm sideeffect "addi.d $$s1, $$zero, 1", "={r24}"()
265 %s2 = call i64 asm sideeffect "addi.d $$s2, $$zero, 1", "={r25}"()
266 %s3 = call i64 asm sideeffect "addi.d $$s3, $$zero, 1", "={r26}"()
267 %s4 = call i64 asm sideeffect "addi.d $$s4, $$zero, 1", "={r27}"()
268 %s5 = call i64 asm sideeffect "addi.d $$s5, $$zero, 1", "={r28}"()
269 %s6 = call i64 asm sideeffect "addi.d $$s6, $$zero, 1", "={r29}"()
270 %s7 = call i64 asm sideeffect "addi.d $$s7, $$zero, 1", "={r30}"()
271 %s8 = call i64 asm sideeffect "addi.d $$s8, $$zero, 1", "={r31}"()
273 %cmp = icmp eq i64 %s7, %s8
274 br i1 %cmp, label %iftrue, label %iffalse
277 call void asm sideeffect ".space 536870912", ""()
281 call void asm sideeffect "# reg use $0", "{r0}"(i64 %zero)
282 call void asm sideeffect "# reg use $0", "{r1}"(i64 %ra)
283 call void asm sideeffect "# reg use $0", "{r2}"(i64 %tp)
284 call void asm sideeffect "# reg use $0", "{r4}"(i64 %a0)
285 call void asm sideeffect "# reg use $0", "{r5}"(i64 %a1)
286 call void asm sideeffect "# reg use $0", "{r6}"(i64 %a2)
287 call void asm sideeffect "# reg use $0", "{r7}"(i64 %a3)
288 call void asm sideeffect "# reg use $0", "{r8}"(i64 %a4)
289 call void asm sideeffect "# reg use $0", "{r9}"(i64 %a5)
290 call void asm sideeffect "# reg use $0", "{r10}"(i64 %a6)
291 call void asm sideeffect "# reg use $0", "{r11}"(i64 %a7)
292 call void asm sideeffect "# reg use $0", "{r12}"(i64 %t0)
293 call void asm sideeffect "# reg use $0", "{r13}"(i64 %t1)
294 call void asm sideeffect "# reg use $0", "{r14}"(i64 %t2)
295 call void asm sideeffect "# reg use $0", "{r15}"(i64 %t3)
296 call void asm sideeffect "# reg use $0", "{r16}"(i64 %t4)
297 call void asm sideeffect "# reg use $0", "{r17}"(i64 %t5)
298 call void asm sideeffect "# reg use $0", "{r18}"(i64 %t6)
299 call void asm sideeffect "# reg use $0", "{r19}"(i64 %t7)
300 call void asm sideeffect "# reg use $0", "{r20}"(i64 %t8)
301 ;; r21 Reserved (Non-allocatable)
302 call void asm sideeffect "# reg use $0", "{r22}"(i64 %s9)
303 call void asm sideeffect "# reg use $0", "{r23}"(i64 %s0)
304 call void asm sideeffect "# reg use $0", "{r24}"(i64 %s1)
305 call void asm sideeffect "# reg use $0", "{r25}"(i64 %s2)
306 call void asm sideeffect "# reg use $0", "{r26}"(i64 %s3)
307 call void asm sideeffect "# reg use $0", "{r27}"(i64 %s4)
308 call void asm sideeffect "# reg use $0", "{r28}"(i64 %s5)
309 call void asm sideeffect "# reg use $0", "{r29}"(i64 %s6)
310 call void asm sideeffect "# reg use $0", "{r30}"(i64 %s7)
311 call void asm sideeffect "# reg use $0", "{r31}"(i64 %s8)