1 # RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass branch-relaxation -aarch64-b-offset-bits=64 -aarch64-tbz-offset-bits=9 -aarch64-cbz-offset-bits=9 %s -o - | FileCheck %s
2 # RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass branch-relaxation -aarch64-tbz-offset-bits=9 -aarch64-cbz-offset-bits=9 %s -o - | FileCheck --check-prefix=INDIRECT %s
9 define void @relax_tbz(i1 zeroext %0) {
10 br i1 %0, label %false_block, label %true_block
12 false_block: ; preds = %1
16 end: ; preds = %true_block, %false_block
17 %3 = tail call i32 @qux()
20 true_block: ; preds = %1
25 define void @tbz_hot_to_cold(i1 zeroext %0) {
26 br i1 %0, label %hot_block, label %cold_block
28 hot_block: ; preds = %1
32 end: ; preds = %cold_block, %hot_block
33 %3 = tail call i32 @qux()
36 cold_block: ; preds = %1
41 define void @tbz_no_valid_tramp(i1 zeroext %0) {
42 br i1 %0, label %hot, label %cold
46 call void asm sideeffect ".space 1024", ""()
49 end: ; preds = %cold, %hot
50 %3 = tail call i32 @qux()
58 define void @tbz_cold_to_hot(i1 zeroext %0) {
59 br i1 %0, label %cold_block, label %hot_block
61 cold_block: ; preds = %1
65 end: ; preds = %hot_block, %cold_block
66 %3 = tail call i32 @qux()
69 hot_block: ; preds = %1
74 define void @tbz_tramp_pushed_oob(i1 zeroext %0, i1 zeroext %1) {
76 %x16 = call i64 asm sideeffect "mov x16, 1", "={x16}"()
77 br i1 %0, label %unrelaxable, label %cold
79 unrelaxable: ; preds = %entry
80 br i1 %1, label %end, label %cold
82 end: ; preds = %unrelaxable
83 call void asm sideeffect ".space 996", ""()
84 call void asm sideeffect "# reg use $0", "{x16}"(i64 %x16)
87 cold: ; preds = %entry, %unrelaxable
88 call void asm sideeffect "# reg use $0", "{x16}"(i64 %x16)
93 define void @x16_used_cold_to_hot() {
95 %x16 = call i64 asm sideeffect "mov x16, 1", "={x16}"()
96 %cmp = icmp eq i64 %x16, 0
97 br i1 %cmp, label %hot, label %cold
99 hot: ; preds = %cold, %entry
100 call void asm sideeffect "# reg use $0", "{x16}"(i64 %x16)
103 cold: ; preds = %entry
104 call void asm sideeffect ".space 4", ""()
108 define void @all_used_cold_to_hot() {
110 %x0 = call i64 asm sideeffect "mov x0, 1", "={x0}"()
111 %x1 = call i64 asm sideeffect "mov x1, 1", "={x1}"()
112 %x2 = call i64 asm sideeffect "mov x2, 1", "={x2}"()
113 %x3 = call i64 asm sideeffect "mov x3, 1", "={x3}"()
114 %x4 = call i64 asm sideeffect "mov x4, 1", "={x4}"()
115 %x5 = call i64 asm sideeffect "mov x5, 1", "={x5}"()
116 %x6 = call i64 asm sideeffect "mov x6, 1", "={x6}"()
117 %x7 = call i64 asm sideeffect "mov x7, 1", "={x7}"()
118 %x8 = call i64 asm sideeffect "mov x8, 1", "={x8}"()
119 %x9 = call i64 asm sideeffect "mov x9, 1", "={x9}"()
120 %x10 = call i64 asm sideeffect "mov x10, 1", "={x10}"()
121 %x11 = call i64 asm sideeffect "mov x11, 1", "={x11}"()
122 %x12 = call i64 asm sideeffect "mov x12, 1", "={x12}"()
123 %x13 = call i64 asm sideeffect "mov x13, 1", "={x13}"()
124 %x14 = call i64 asm sideeffect "mov x14, 1", "={x14}"()
125 %x15 = call i64 asm sideeffect "mov x15, 1", "={x15}"()
126 %x17 = call i64 asm sideeffect "mov x17, 1", "={x17}"()
127 %x18 = call i64 asm sideeffect "mov x18, 1", "={x18}"()
128 %x19 = call i64 asm sideeffect "mov x19, 1", "={x19}"()
129 %x20 = call i64 asm sideeffect "mov x20, 1", "={x20}"()
130 %x21 = call i64 asm sideeffect "mov x21, 1", "={x21}"()
131 %x22 = call i64 asm sideeffect "mov x22, 1", "={x22}"()
132 %x23 = call i64 asm sideeffect "mov x23, 1", "={x23}"()
133 %x24 = call i64 asm sideeffect "mov x24, 1", "={x24}"()
134 %x25 = call i64 asm sideeffect "mov x25, 1", "={x25}"()
135 %x26 = call i64 asm sideeffect "mov x26, 1", "={x26}"()
136 %x27 = call i64 asm sideeffect "mov x27, 1", "={x27}"()
137 %x28 = call i64 asm sideeffect "mov x28, 1", "={x28}"()
140 exit: ; preds = %cold
141 call void asm sideeffect "# reg use $0", "{x0}"(i64 %x0)
142 call void asm sideeffect "# reg use $0", "{x1}"(i64 %x1)
143 call void asm sideeffect "# reg use $0", "{x2}"(i64 %x2)
144 call void asm sideeffect "# reg use $0", "{x3}"(i64 %x3)
145 call void asm sideeffect "# reg use $0", "{x4}"(i64 %x4)
146 call void asm sideeffect "# reg use $0", "{x5}"(i64 %x5)
147 call void asm sideeffect "# reg use $0", "{x6}"(i64 %x6)
148 call void asm sideeffect "# reg use $0", "{x7}"(i64 %x7)
149 call void asm sideeffect "# reg use $0", "{x8}"(i64 %x8)
150 call void asm sideeffect "# reg use $0", "{x9}"(i64 %x9)
151 call void asm sideeffect "# reg use $0", "{x10}"(i64 %x10)
152 call void asm sideeffect "# reg use $0", "{x11}"(i64 %x11)
153 call void asm sideeffect "# reg use $0", "{x12}"(i64 %x12)
154 call void asm sideeffect "# reg use $0", "{x13}"(i64 %x13)
155 call void asm sideeffect "# reg use $0", "{x14}"(i64 %x14)
156 call void asm sideeffect "# reg use $0", "{x15}"(i64 %x15)
157 call void asm sideeffect "# reg use $0", "{x16}"(i64 %x16)
158 call void asm sideeffect "# reg use $0", "{x17}"(i64 %x17)
159 call void asm sideeffect "# reg use $0", "{x18}"(i64 %x18)
160 call void asm sideeffect "# reg use $0", "{x19}"(i64 %x19)
161 call void asm sideeffect "# reg use $0", "{x20}"(i64 %x20)
162 call void asm sideeffect "# reg use $0", "{x21}"(i64 %x21)
163 call void asm sideeffect "# reg use $0", "{x22}"(i64 %x22)
164 call void asm sideeffect "# reg use $0", "{x23}"(i64 %x23)
165 call void asm sideeffect "# reg use $0", "{x24}"(i64 %x24)
166 call void asm sideeffect "# reg use $0", "{x25}"(i64 %x25)
167 call void asm sideeffect "# reg use $0", "{x26}"(i64 %x26)
168 call void asm sideeffect "# reg use $0", "{x27}"(i64 %x27)
169 call void asm sideeffect "# reg use $0", "{x28}"(i64 %x28)
172 cold: ; preds = %entry
173 %x16 = call i64 asm sideeffect "mov x16, 1", "={x16}"()
180 tracksRegLiveness: true
182 - { reg: '$w0', virtual-reg: '' }
184 - { id: 0, name: '', type: spill-slot, offset: -16, size: 8, alignment: 16,
185 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
186 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
188 ; CHECK-LABEL: name: relax_tbz
189 ; COM: Check that cross-section conditional branches are
191 ; CHECK: bb.0 (%ir-block.1, bbsections 1):
192 ; CHECK-NEXT: successors: %bb.3
197 ; CHECK-NEXT: bb.3 (%ir-block.1, bbsections 1):
198 ; CHECK-NEXT: successors: %bb.1
200 ; CHECK-NEXT: B %bb.1
202 ; CHECK-NEXT: bb.1.false_block (bbsections 2):
203 ; CHECK: TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp
205 ; CHECK-NEXT: bb.2.true_block (bbsections 3):
206 ; CHECK: TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp
207 bb.0 (%ir-block.1, bbsections 1):
208 successors: %bb.1, %bb.2
211 early-clobber $sp = frame-setup STRXpre killed $lr, $sp, -16 :: (store (s64) into %stack.0)
212 TBZW killed renamable $w0, 0, %bb.2
215 bb.1.false_block (bbsections 2):
216 BL @baz, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0
217 early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)
218 TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp
220 bb.2.true_block (bbsections 3):
221 BL @bar, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0
222 early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)
223 TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp
226 name: tbz_hot_to_cold
227 tracksRegLiveness: true
229 - { reg: '$w0', virtual-reg: '' }
231 - { id: 0, name: '', type: spill-slot, offset: -16, size: 8, alignment: 16,
232 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
233 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
235 ; CHECK-LABEL: name: tbz_hot_to_cold
236 ; COM: Check that branch relaxation relaxes cross-section conditional
237 ; COM: branches by creating trampolines after all other hot basic blocks.
238 ; CHECK: bb.0 (%ir-block.1):
239 ; CHECK-NEXT: successors: %bb.1
240 ; CHECK-SAME: , %bb.3
243 ; CHECK: bb.1.hot_block:
244 ; CHECK: TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp
245 ; CHECK: bb.3 (%ir-block.1):
246 ; CHECK-NEXT: successors: %bb.2
248 ; CHECK-NEXT: B %bb.2
250 ; CHECK-NEXT: bb.2.cold_block (bbsections Cold):
251 ; CHECK: TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp
253 successors: %bb.1, %bb.2
256 early-clobber $sp = frame-setup STRXpre killed $lr, $sp, -16 :: (store (s64) into %stack.0)
257 TBZW killed renamable $w0, 0, %bb.2
260 BL @baz, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0
261 early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)
262 TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp
264 bb.2.cold_block (bbsections Cold):
265 BL @bar, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0
266 early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)
267 TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp
271 name: tbz_no_valid_tramp
272 tracksRegLiveness: true
274 - { reg: '$w0', virtual-reg: '' }
276 - { id: 0, name: '', type: spill-slot, offset: -16, size: 8, alignment: 16,
277 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
278 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
282 ; CHECK-LABEL: name: tbz_no_valid_tramp
283 ; COM: Check that branch relaxation doesn't insert a trampoline if there is no
284 ; COM: viable insertion location.
285 ; CHECK: bb.0 (%ir-block.1):
286 ; CHECK-NEXT: successors: %bb.1
287 ; CHECK-SAME: , %bb.3
294 ; CHECK: bb.2.cold (bbsections Cold):
297 successors: %bb.1, %bb.2
300 early-clobber $sp = frame-setup STRXpre killed $lr, $sp, -16 :: (store (s64) into %stack.0)
301 CBZW killed renamable $w0, %bb.2
304 BL @baz, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0
305 INLINEASM &".space 1024", 1 /* sideeffect attdialect */
306 early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)
307 TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp
309 bb.2.cold (bbsections Cold):
310 BL @bar, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0
311 early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)
312 TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp
316 name: tbz_cold_to_hot
317 tracksRegLiveness: true
319 - { reg: '$w0', virtual-reg: '' }
321 - { id: 0, name: '', type: spill-slot, offset: -16, size: 8, alignment: 16,
322 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
323 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
327 ; CHECK-LABEL: name: tbz_cold_to_hot
328 ; COM: Check that relaxation of conditional branches from the Cold section to
329 ; COM: the Hot section doesn't modify the Hot section.
330 ; CHECK: bb.0 (%ir-block.1, bbsections Cold):
331 ; CHECK-NEXT: successors: %bb.1
332 ; CHECK-SAME: , %bb.2
335 ; CHECK-NEXT: B %bb.2
336 ; CHECK: bb.1.cold_block (bbsections Cold):
338 ; CHECK: bb.2.hot_block:
340 bb.0 (%ir-block.1, bbsections Cold):
341 successors: %bb.1, %bb.2
344 early-clobber $sp = frame-setup STRXpre killed $lr, $sp, -16 :: (store (s64) into %stack.0)
345 CBZW killed renamable $w0, %bb.2
347 bb.1.cold_block (bbsections Cold):
348 BL @baz, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0
349 early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)
350 TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp
353 BL @bar, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0
354 early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)
355 TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp
359 name: tbz_tramp_pushed_oob
360 tracksRegLiveness: true
362 - { reg: '$w0', virtual-reg: '' }
363 - { reg: '$w1', virtual-reg: '' }
365 - { id: 0, name: '', type: spill-slot, offset: -16, size: 8, alignment: 16,
366 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
367 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
371 ; INDIRECT-LABEL: name: tbz_tramp_pushed_oob
372 ; COM: Check that a conditional branch to a trampoline is properly relaxed
373 ; COM: if the trampoline is pushed out of range.
374 ; INDIRECT: bb.0.entry:
375 ; INDIRECT-NEXT: successors: %bb.1
376 ; INDIRECT-SAME: , %[[TRAMP1:bb.[0-9]+]]
378 ; INDIRECT-SAME: %bb.1
379 ; INDIRECT-NEXT: B{{ }}
380 ; INDIRECT-SAME: %[[TRAMP1]]
381 ; INDIRECT: bb.1.unrelaxable:
382 ; INDIRECT-NEXT: successors: %bb.2
383 ; INDIRECT-SAME: , %[[TRAMP2:bb.[0-9]+]]
385 ; INDIRECT-SAME: %bb.2
386 ; INDIRECT: [[TRAMP2]]
387 ; INDIRECT-NEXT: successors: %bb.6
388 ; INDIRECT: bb.2.end:
389 ; INDIRECT: TCRETURNdi
390 ; INDIRECT: [[TRAMP1]].entry:
391 ; INDIRECT-NEXT: successors: %[[TRAMP1_SPILL:bb.[0-9]+]]
392 ; INDIRECT: [[TRAMP1_SPILL]].entry:
393 ; INDIRECT-NEXT: successors: %[[TRAMP1_RESTORE:bb.[0-9]+]]
394 ; INDIRECT: early-clobber $sp = STRXpre $[[SPILL_REGISTER:x[0-9]+]], $sp, -16
395 ; INDIRECT-NEXT: B %[[TRAMP1_RESTORE:bb.[0-9]+]]
396 ; INDIRECT: [[TRAMP1_RESTORE]].cold (bbsections Cold):
397 ; INDIRECT-NEXT: successors: %bb.3
398 ; INDIRECT-NEXT: {{ $}}
399 ; INDIRECT-NEXT: early-clobber $sp, $[[SPILL_REGISTER]] = LDRXpost $sp, 16
400 ; INDIRECT: bb.3.cold (bbsections Cold):
401 ; INDIRECT: TCRETURNdi
403 bb.0.entry (%ir-block.entry):
404 successors: %bb.1, %bb.3
405 liveins: $w0, $w1, $lr
407 early-clobber $sp = frame-setup STRXpre killed $lr, $sp, -16 :: (store (s64) into %stack.0)
408 INLINEASM &"mov x16, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x16
409 TBZW killed renamable $w0, 0, %bb.3
412 successors: %bb.2, %bb.3
415 TBNZW killed renamable $w1, 0, %bb.2
422 INLINEASM &".space 996", 1 /* sideeffect attdialect */
423 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x16
424 early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)
425 TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp
427 bb.3.cold (bbsections Cold):
430 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x16
431 early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)
432 TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp
436 name: x16_used_cold_to_hot
437 tracksRegLiveness: true
442 ; INDIRECT-LABEL: name: x16_used_cold_to_hot
443 ; COM: Check that unconditional branches from the cold section to
444 ; COM: the hot section manually insert indirect branches if x16
445 ; COM: isn't available but there is still a free register.
446 ; INDIRECT: bb.0.entry:
447 ; INDIRECT-NEXT: successors: %bb.1
448 ; INDIRECT-SAME: , %bb.3
449 ; INDIRECT: TBZW killed renamable $w8, 0, %bb.1
450 ; INDIRECT-NEXT: {{ $}}
451 ; INDIRECT-NEXT: bb.3.entry:
452 ; INDIRECT-NEXT: successors: %bb.4
453 ; INDIRECT-NEXT: liveins: $x16
454 ; INDIRECT-NEXT: {{ $}}
455 ; INDIRECT-NEXT: early-clobber $sp = STRXpre $[[SPILL_REGISTER]], $sp, -16
456 ; INDIRECT-NEXT: B %bb.4
457 ; INDIRECT: bb.1.hot:
458 ; INDIRECT-NEXT: liveins: $x16
459 ; INDIRECT: killed $x16
460 ; INDIRECT: RET undef $lr
461 ; INDIRECT: bb.4.cold (bbsections Cold):
462 ; INDIRECT-NEXT: successors: %bb.2
463 ; INDIRECT-NEXT: {{ $}}
464 ; INDIRECT-NEXT: early-clobber $sp, $[[SPILL_REGISTER]] = LDRXpost $sp, 16
465 ; INDIRECT-NEXT: {{ $}}
466 ; INDIRECT-NEXT: bb.2.cold (bbsections Cold):
467 ; INDIRECT-NEXT: successors: %bb.5
468 ; INDIRECT-NEXT: liveins: $x16
469 ; INDIRECT-NEXT: {{ $}}
470 ; INDIRECT-NEXT: INLINEASM &".space 4", 1 /* sideeffect attdialect */
471 ; INDIRECT-NEXT: {{ $}}
472 ; INDIRECT-NEXT: bb.5.cold (bbsections Cold):
473 ; INDIRECT-NEXT: successors: %bb.1
474 ; INDIRECT-NEXT: liveins: $x16
475 ; INDIRECT-NEXT: {{ $}}
476 ; INDIRECT-NEXT: $[[SCAVENGED_REGISTER:x[0-9]+]] = ADRP target-flags(aarch64-page) <mcsymbol .LBB5_1>
477 ; INDIRECT-NEXT: $[[SCAVENGED_REGISTER]] = ADDXri $[[SCAVENGED_REGISTER]], target-flags(aarch64-pageoff, aarch64-nc) <mcsymbol .LBB5_1>, 0
478 ; INDIRECT-NEXT: BR $[[SCAVENGED_REGISTER]]
481 successors: %bb.1, %bb.2
483 $sp = frame-setup SUBXri $sp, 16, 0
484 INLINEASM &"mov x16, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x16
485 dead renamable $x8 = SUBSXri $x16, 0, 0, implicit-def $nzcv
486 renamable $w8 = CSINCWr $wzr, $wzr, 1, implicit killed $nzcv
487 TBZW killed renamable $w8, 0, %bb.1
494 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x16
495 $sp = frame-destroy ADDXri $sp, 16, 0
498 bb.2.cold (bbsections Cold):
502 INLINEASM &".space 4", 1 /* sideeffect attdialect */
506 name: all_used_cold_to_hot
507 tracksRegLiveness: true
509 - { id: 0, name: '', type: spill-slot, offset: -8, size: 8, alignment: 8,
510 stack-id: default, callee-saved-register: '$x19', callee-saved-restored: true,
511 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
512 - { id: 1, name: '', type: spill-slot, offset: -16, size: 8, alignment: 8,
513 stack-id: default, callee-saved-register: '$x20', callee-saved-restored: true,
514 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
515 - { id: 2, name: '', type: spill-slot, offset: -24, size: 8, alignment: 8,
516 stack-id: default, callee-saved-register: '$x21', callee-saved-restored: true,
517 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
518 - { id: 3, name: '', type: spill-slot, offset: -32, size: 8, alignment: 8,
519 stack-id: default, callee-saved-register: '$x22', callee-saved-restored: true,
520 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
521 - { id: 4, name: '', type: spill-slot, offset: -40, size: 8, alignment: 8,
522 stack-id: default, callee-saved-register: '$x23', callee-saved-restored: true,
523 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
524 - { id: 5, name: '', type: spill-slot, offset: -48, size: 8, alignment: 8,
525 stack-id: default, callee-saved-register: '$x24', callee-saved-restored: true,
526 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
527 - { id: 6, name: '', type: spill-slot, offset: -56, size: 8, alignment: 8,
528 stack-id: default, callee-saved-register: '$x25', callee-saved-restored: true,
529 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
530 - { id: 7, name: '', type: spill-slot, offset: -64, size: 8, alignment: 8,
531 stack-id: default, callee-saved-register: '$x26', callee-saved-restored: true,
532 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
533 - { id: 8, name: '', type: spill-slot, offset: -72, size: 8, alignment: 8,
534 stack-id: default, callee-saved-register: '$x27', callee-saved-restored: true,
535 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
536 - { id: 9, name: '', type: spill-slot, offset: -80, size: 8, alignment: 8,
537 stack-id: default, callee-saved-register: '$x28', callee-saved-restored: true,
538 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
539 - { id: 10, name: '', type: spill-slot, offset: -96, size: 8, alignment: 16,
540 stack-id: default, callee-saved-register: '$fp', callee-saved-restored: true,
541 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
545 ; INDIRECT-LABEL: name: all_used_cold_to_hot
546 ; COM: Check that unconditional branches from the cold section to
547 ; COM: the hot section spill x16 and defer indirect branch
548 ; COM: insertion to the linker if there are no free general-purpose
550 ; INDIRECT: bb.0.entry:
551 ; INDIRECT-NEXT: successors: %bb.3
552 ; INDIRECT-NEXT: liveins: $fp, $x27, $x28, $x25, $x26, $x23, $x24, $x21, $x22, $x19, $x20
553 ; INDIRECT-COUNT-29: INLINEASM &"mov
554 ; INDIRECT-NEXT: {{ $}}
555 ; INDIRECT: bb.3.entry:
556 ; INDIRECT-NEXT: successors: %bb.2
557 ; INDIRECT-NEXT: liveins: $fp, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8,
558 ; INDIRECT-SAME: $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x17, $x18, $x19,
559 ; INDIRECT-SAME: $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28
560 ; INDIRECT-NEXT: {{ $}}
561 ; INDIRECT-NEXT: B %bb.2
562 ; INDIRECT-NEXT: {{ $}}
563 ; INDIRECT-NEXT: bb.1.exit:
564 ; INDIRECT-NEXT: liveins: $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9,
565 ; INDIRECT-SAME: $x10, $x11, $x12, $x13, $x14, $x15, $x16, $x17, $x18, $x19,
566 ; INDIRECT-SAME: $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp
567 ; INDIRECT-NEXT: {{ $}}
568 ; INDIRECT-COUNT-30: INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed
569 ; INDIRECT: RET undef $lr
570 ; INDIRECT-NEXT: {{ $}}
571 ; INDIRECT-NEXT: bb.6.exit:
572 ; INDIRECT-NEXT: successors: %bb.7(0x80000000)
573 ; INDIRECT-NEXT: {{ $}}
574 ; INDIRECT-NEXT: early-clobber $sp, $[[SPILL_REGISTER]] = LDRXpost $sp, 16
575 ; INDIRECT-NEXT: {{ $}}
576 ; INDIRECT-NEXT: bb.7.exit:
577 ; INDIRECT-NEXT: successors: %bb.1(0x80000000)
578 ; INDIRECT-NEXT: {{ $}}
579 ; INDIRECT-NEXT: B %bb.1
580 ; INDIRECT-NEXT: {{ $}}
581 ; INDIRECT-NEXT: bb.2.cold (bbsections Cold):
582 ; INDIRECT-NEXT: successors: %bb.5
583 ; INDIRECT-NEXT: liveins: $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9,
584 ; INDIRECT-SAME: $x10, $x11, $x12, $x13, $x14, $x15, $x17, $x18, $x19, $x20,
585 ; INDIRECT-SAME: $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp
586 ; INDIRECT-NEXT: {{ $}}
587 ; INDIRECT-NEXT: INLINEASM &"mov x16, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x16
588 ; INDIRECT-NEXT: {{ $}}
589 ; INDIRECT-NEXT: bb.5.cold (bbsections Cold):
590 ; INDIRECT-NEXT: successors: %bb.6
591 ; INDIRECT-NEXT: liveins: $fp, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8,
592 ; INDIRECT-SAME: $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x16, $x17, $x18,
593 ; INDIRECT-SAME: $x19, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28
594 ; INDIRECT-NEXT: {{ $}}
595 ; INDIRECT-NEXT: early-clobber $sp = STRXpre $[[SPILL_REGISTER]], $sp, -16
596 ; INDIRECT-NEXT: B %bb.6
600 liveins: $fp, $x27, $x28, $x25, $x26, $x23, $x24, $x21, $x22, $x19, $x20
602 $sp = frame-setup SUBXri $sp, 112, 0
603 frame-setup STRXui killed $fp, $sp, 2 :: (store (s64) into %stack.10)
604 frame-setup STPXi killed $x28, killed $x27, $sp, 4 :: (store (s64) into %stack.9), (store (s64) into %stack.8)
605 frame-setup STPXi killed $x26, killed $x25, $sp, 6 :: (store (s64) into %stack.7), (store (s64) into %stack.6)
606 frame-setup STPXi killed $x24, killed $x23, $sp, 8 :: (store (s64) into %stack.5), (store (s64) into %stack.4)
607 frame-setup STPXi killed $x22, killed $x21, $sp, 10 :: (store (s64) into %stack.3), (store (s64) into %stack.2)
608 frame-setup STPXi killed $x20, killed $x19, $sp, 12 :: (store (s64) into %stack.1), (store (s64) into %stack.0)
609 INLINEASM &"mov x0, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x0
610 INLINEASM &"mov x1, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x1
611 INLINEASM &"mov x2, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x2
612 INLINEASM &"mov x3, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x3
613 INLINEASM &"mov x4, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x4
614 INLINEASM &"mov x5, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x5
615 INLINEASM &"mov x6, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x6
616 INLINEASM &"mov x7, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x7
617 INLINEASM &"mov x8, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x8
618 INLINEASM &"mov x9, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x9
619 INLINEASM &"mov x10, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x10
620 INLINEASM &"mov x11, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x11
621 INLINEASM &"mov x12, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x12
622 INLINEASM &"mov x13, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x13
623 INLINEASM &"mov x14, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x14
624 INLINEASM &"mov x15, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x15
625 INLINEASM &"mov x17, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x17
626 INLINEASM &"mov x18, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x18
627 INLINEASM &"mov x19, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x19
628 INLINEASM &"mov x20, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x20
629 INLINEASM &"mov x21, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x21
630 INLINEASM &"mov x22, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x22
631 INLINEASM &"mov x23, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x23
632 INLINEASM &"mov x24, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x24
633 INLINEASM &"mov x25, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x25
634 INLINEASM &"mov x26, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x26
635 INLINEASM &"mov x27, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x27
636 INLINEASM &"mov x28, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x28
637 INLINEASM &"mov fp, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $fp
642 liveins: $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x16, $x17, $x18, $x19, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp
644 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x0
645 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x1
646 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x2
647 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x3
648 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x4
649 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x5
650 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x6
651 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x7
652 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x8
653 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x9
654 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x10
655 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x11
656 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x12
657 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x13
658 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x14
659 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x15
660 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x16
661 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x17
662 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x18
663 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x19
664 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x20
665 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x21
666 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x22
667 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x23
668 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x24
669 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x25
670 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x26
671 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x27
672 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x28
673 INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $fp
674 $x20, $x19 = frame-destroy LDPXi $sp, 12 :: (load (s64) from %stack.1), (load (s64) from %stack.0)
675 $x22, $x21 = frame-destroy LDPXi $sp, 10 :: (load (s64) from %stack.3), (load (s64) from %stack.2)
676 $x24, $x23 = frame-destroy LDPXi $sp, 8 :: (load (s64) from %stack.5), (load (s64) from %stack.4)
677 $x26, $x25 = frame-destroy LDPXi $sp, 6 :: (load (s64) from %stack.7), (load (s64) from %stack.6)
678 $x28, $x27 = frame-destroy LDPXi $sp, 4 :: (load (s64) from %stack.9), (load (s64) from %stack.8)
679 $fp = frame-destroy LDRXui $sp, 2 :: (load (s64) from %stack.10)
680 $sp = frame-destroy ADDXri $sp, 112, 0
683 bb.2.cold (bbsections Cold):
685 liveins: $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x17, $x18, $x19, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp
687 INLINEASM &"mov x16, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x16