brintos

brintos / llvm-project-archived public Read only

0
0
Text · 32.5 KiB · 000246a Raw
693 lines · plain
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 %s2# 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 %s3 4# RUN: llc -mtriple=aarch64-none-linux-gnu -passes branch-relaxation -aarch64-tbz-offset-bits=9 -aarch64-cbz-offset-bits=9 %s -o - | FileCheck --check-prefix=INDIRECT %s5 6--- |7  declare i32 @bar()8  declare i32 @baz()9  declare i32 @qux()10  11  define void @relax_tbz(i1 zeroext %0) {12    br i1 %0, label %false_block, label %true_block13  14  false_block:                                      ; preds = %115    %2 = call i32 @baz()16    br label %end17  18  end:                                              ; preds = %true_block, %false_block19    %3 = tail call i32 @qux()20    ret void21  22  true_block:                                       ; preds = %123    %4 = call i32 @bar()24    br label %end25  }26 27  define void @tbz_hot_to_cold(i1 zeroext %0) {28    br i1 %0, label %hot_block, label %cold_block29  30  hot_block:                                        ; preds = %131    %2 = call i32 @baz()32    br label %end33  34  end:                                              ; preds = %cold_block, %hot_block35    %3 = tail call i32 @qux()36    ret void37  38  cold_block:                                       ; preds = %139    %4 = call i32 @bar()40    br label %end41  }42 43  define void @tbz_no_valid_tramp(i1 zeroext %0) {44    br i1 %0, label %hot, label %cold45  46  hot:                                              ; preds = %147    %2 = call i32 @baz()48    call void asm sideeffect ".space 1024", ""()49    br label %end50  51  end:                                              ; preds = %cold, %hot52    %3 = tail call i32 @qux()53    ret void54  55  cold:                                             ; preds = %156    %4 = call i32 @bar()57    br label %end58  }59 60  define void @tbz_cold_to_hot(i1 zeroext %0) {61    br i1 %0, label %cold_block, label %hot_block62  63  cold_block:                                       ; preds = %164    %2 = call i32 @baz()65    br label %end66  67  end:                                              ; preds = %hot_block, %cold_block68    %3 = tail call i32 @qux()69    ret void70  71  hot_block:                                        ; preds = %172    %4 = call i32 @bar()73    br label %end74  }75 76  define void @tbz_tramp_pushed_oob(i1 zeroext %0, i1 zeroext %1) {77  entry:78    %x16 = call i64 asm sideeffect "mov x16, 1", "={x16}"()79    br i1 %0, label %unrelaxable, label %cold80 81  unrelaxable:                                      ; preds = %entry82    br i1 %1, label %end, label %cold83 84  end:                                              ; preds = %unrelaxable85    call void asm sideeffect ".space 996", ""()86    call void asm sideeffect "# reg use $0", "{x16}"(i64 %x16)87    ret void88 89  cold:                                            ; preds = %entry, %unrelaxable90    call void asm sideeffect "# reg use $0", "{x16}"(i64 %x16)91    ret void92  }93 94 95  define void @x16_used_cold_to_hot() {96  entry:97    %x16 = call i64 asm sideeffect "mov x16, 1", "={x16}"()98    %cmp = icmp eq i64 %x16, 099    br i1 %cmp, label %hot, label %cold100 101  hot:                                            ; preds = %cold, %entry102    call void asm sideeffect "# reg use $0", "{x16}"(i64 %x16)103    ret void104 105  cold:                                           ; preds = %entry106    call void asm sideeffect ".space 4", ""()107    br label %hot108  }109 110  define void @all_used_cold_to_hot() {111  entry:112    %x0 = call i64 asm sideeffect "mov x0, 1", "={x0}"()113    %x1 = call i64 asm sideeffect "mov x1, 1", "={x1}"()114    %x2 = call i64 asm sideeffect "mov x2, 1", "={x2}"()115    %x3 = call i64 asm sideeffect "mov x3, 1", "={x3}"()116    %x4 = call i64 asm sideeffect "mov x4, 1", "={x4}"()117    %x5 = call i64 asm sideeffect "mov x5, 1", "={x5}"()118    %x6 = call i64 asm sideeffect "mov x6, 1", "={x6}"()119    %x7 = call i64 asm sideeffect "mov x7, 1", "={x7}"()120    %x8 = call i64 asm sideeffect "mov x8, 1", "={x8}"()121    %x9 = call i64 asm sideeffect "mov x9, 1", "={x9}"()122    %x10 = call i64 asm sideeffect "mov x10, 1", "={x10}"()123    %x11 = call i64 asm sideeffect "mov x11, 1", "={x11}"()124    %x12 = call i64 asm sideeffect "mov x12, 1", "={x12}"()125    %x13 = call i64 asm sideeffect "mov x13, 1", "={x13}"()126    %x14 = call i64 asm sideeffect "mov x14, 1", "={x14}"()127    %x15 = call i64 asm sideeffect "mov x15, 1", "={x15}"()128    %x17 = call i64 asm sideeffect "mov x17, 1", "={x17}"()129    %x18 = call i64 asm sideeffect "mov x18, 1", "={x18}"()130    %x19 = call i64 asm sideeffect "mov x19, 1", "={x19}"()131    %x20 = call i64 asm sideeffect "mov x20, 1", "={x20}"()132    %x21 = call i64 asm sideeffect "mov x21, 1", "={x21}"()133    %x22 = call i64 asm sideeffect "mov x22, 1", "={x22}"()134    %x23 = call i64 asm sideeffect "mov x23, 1", "={x23}"()135    %x24 = call i64 asm sideeffect "mov x24, 1", "={x24}"()136    %x25 = call i64 asm sideeffect "mov x25, 1", "={x25}"()137    %x26 = call i64 asm sideeffect "mov x26, 1", "={x26}"()138    %x27 = call i64 asm sideeffect "mov x27, 1", "={x27}"()139    %x28 = call i64 asm sideeffect "mov x28, 1", "={x28}"()140    br label %cold141 142  exit:                                             ; preds = %cold143    call void asm sideeffect "# reg use $0", "{x0}"(i64 %x0)144    call void asm sideeffect "# reg use $0", "{x1}"(i64 %x1)145    call void asm sideeffect "# reg use $0", "{x2}"(i64 %x2)146    call void asm sideeffect "# reg use $0", "{x3}"(i64 %x3)147    call void asm sideeffect "# reg use $0", "{x4}"(i64 %x4)148    call void asm sideeffect "# reg use $0", "{x5}"(i64 %x5)149    call void asm sideeffect "# reg use $0", "{x6}"(i64 %x6)150    call void asm sideeffect "# reg use $0", "{x7}"(i64 %x7)151    call void asm sideeffect "# reg use $0", "{x8}"(i64 %x8)152    call void asm sideeffect "# reg use $0", "{x9}"(i64 %x9)153    call void asm sideeffect "# reg use $0", "{x10}"(i64 %x10)154    call void asm sideeffect "# reg use $0", "{x11}"(i64 %x11)155    call void asm sideeffect "# reg use $0", "{x12}"(i64 %x12)156    call void asm sideeffect "# reg use $0", "{x13}"(i64 %x13)157    call void asm sideeffect "# reg use $0", "{x14}"(i64 %x14)158    call void asm sideeffect "# reg use $0", "{x15}"(i64 %x15)159    call void asm sideeffect "# reg use $0", "{x16}"(i64 %x16)160    call void asm sideeffect "# reg use $0", "{x17}"(i64 %x17)161    call void asm sideeffect "# reg use $0", "{x18}"(i64 %x18)162    call void asm sideeffect "# reg use $0", "{x19}"(i64 %x19)163    call void asm sideeffect "# reg use $0", "{x20}"(i64 %x20)164    call void asm sideeffect "# reg use $0", "{x21}"(i64 %x21)165    call void asm sideeffect "# reg use $0", "{x22}"(i64 %x22)166    call void asm sideeffect "# reg use $0", "{x23}"(i64 %x23)167    call void asm sideeffect "# reg use $0", "{x24}"(i64 %x24)168    call void asm sideeffect "# reg use $0", "{x25}"(i64 %x25)169    call void asm sideeffect "# reg use $0", "{x26}"(i64 %x26)170    call void asm sideeffect "# reg use $0", "{x27}"(i64 %x27)171    call void asm sideeffect "# reg use $0", "{x28}"(i64 %x28)172    ret void173 174  cold:                                             ; preds = %entry175    %x16 = call i64 asm sideeffect "mov x16, 1", "={x16}"()176    br label %exit177  }178 179...180---181name:            relax_tbz182tracksRegLiveness: true183liveins:184  - { reg: '$w0', virtual-reg: '' }185stack:186  - { id: 0, name: '', type: spill-slot, offset: -16, size: 8, alignment: 16,187      stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,188      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }189body:             |190  ; CHECK-LABEL: name: relax_tbz191  ; COM: Check that cross-section conditional branches are192  ; COM:   relaxed.193  ; CHECK: bb.0 (%ir-block.1, bbsections 1):194  ; CHECK-NEXT: successors: %bb.3195  ; CHECK:  TBNZW196  ; CHECK-SAME:   %bb.3197  ; CHECK:      B %bb.2198  ; CHECK-NEXT: {{  $}}199  ; CHECK-NEXT: bb.3 (%ir-block.1, bbsections 1):200  ; CHECK-NEXT: successors: %bb.1201  ; CHECK-NEXT: {{  $}}202  ; CHECK-NEXT:    B %bb.1203  ; CHECK-NEXT: {{  $}}204  ; CHECK-NEXT:  bb.1.false_block (bbsections 2):205  ; CHECK:    TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp206  ; CHECK-NEXT: {{  $}}207  ; CHECK-NEXT:  bb.2.true_block (bbsections 3):208  ; CHECK:    TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp209  bb.0 (%ir-block.1, bbsections 1):210    successors: %bb.1, %bb.2211    liveins: $w0, $lr212 213    early-clobber $sp = frame-setup STRXpre killed $lr, $sp, -16 :: (store (s64) into %stack.0)214    TBZW killed renamable $w0, 0, %bb.2215    B %bb.1216 217  bb.1.false_block (bbsections 2):218    BL @baz, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0219    early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)220    TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp221 222  bb.2.true_block (bbsections 3):223    BL @bar, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0224    early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)225    TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp226...227---228name:            tbz_hot_to_cold229tracksRegLiveness: true230liveins:231  - { reg: '$w0', virtual-reg: '' }232stack:233  - { id: 0, name: '', type: spill-slot, offset: -16, size: 8, alignment: 16,234      stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,235      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }236body:             |237  ; CHECK-LABEL: name: tbz_hot_to_cold238  ; COM: Check that branch relaxation relaxes cross-section conditional239  ; COM:   branches by creating trampolines after all other hot basic blocks.240  ; CHECK: bb.0 (%ir-block.1):241  ; CHECK-NEXT: successors: %bb.1242  ; CHECK-SAME:                  , %bb.3243  ; CHECK:  TBZW244  ; CHECK-SAME: %bb.3245  ; CHECK:  bb.1.hot_block:246  ; CHECK:    TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp247  ; CHECK:  bb.3 (%ir-block.1):248  ; CHECK-NEXT:    successors: %bb.2249  ; CHECK-NEXT: {{  $}}250  ; CHECK-NEXT:    B %bb.2251  ; CHECK-NEXT: {{  $}}252  ; CHECK-NEXT:  bb.2.cold_block (bbsections Cold):253  ; CHECK:    TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp254  bb.0 (%ir-block.1):255    successors: %bb.1, %bb.2256    liveins: $w0, $lr257 258    early-clobber $sp = frame-setup STRXpre killed $lr, $sp, -16 :: (store (s64) into %stack.0)259    TBZW killed renamable $w0, 0, %bb.2260 261  bb.1.hot_block:262    BL @baz, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0263    early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)264    TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp265 266  bb.2.cold_block (bbsections Cold):267    BL @bar, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0268    early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)269    TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp270 271...272---273name:            tbz_no_valid_tramp274tracksRegLiveness: true275liveins:276  - { reg: '$w0', virtual-reg: '' }277stack:278  - { id: 0, name: '', type: spill-slot, offset: -16, size: 8, alignment: 16, 279      stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true, 280      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }281machineFunctionInfo:282  hasRedZone:      false283body:             |284  ; CHECK-LABEL: name: tbz_no_valid_tramp285  ; COM: Check that branch relaxation doesn't insert a trampoline if there is no286  ; COM:   viable insertion location.287  ; CHECK:    bb.0 (%ir-block.1):288  ; CHECK-NEXT:    successors: %bb.1289  ; CHECK-SAME:                     , %bb.3290  ; CHECK:    CBNZW291  ; CHECK-SAME:    %bb.1292  ; CHECK-NEXT: B293  ; CHECK-SAME:   %bb.3294  ; CHECK:  bb.1.hot:295  ; CHECK:    TCRETURNdi296  ; CHECK:  bb.2.cold (bbsections Cold):297  ; CHECK:    TCRETURNdi298  bb.0 (%ir-block.1):299    successors: %bb.1, %bb.2300    liveins: $w0, $lr301  302    early-clobber $sp = frame-setup STRXpre killed $lr, $sp, -16 :: (store (s64) into %stack.0)303    CBZW killed renamable $w0, %bb.2304  305  bb.1.hot:306    BL @baz, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0307    INLINEASM &".space 1024", 1 /* sideeffect attdialect */308    early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)309    TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp310  311  bb.2.cold (bbsections Cold):312    BL @bar, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0313    early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)314    TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp315 316...317---318name:            tbz_cold_to_hot319tracksRegLiveness: true320liveins:321  - { reg: '$w0', virtual-reg: '' }322stack:323  - { id: 0, name: '', type: spill-slot, offset: -16, size: 8, alignment: 16, 324      stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true, 325      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }326machineFunctionInfo:327  hasRedZone:      false328body:             |329  ; CHECK-LABEL: name: tbz_cold_to_hot330  ; COM: Check that relaxation of conditional branches from the Cold section to331  ; COM:   the Hot section doesn't modify the Hot section.332  ; CHECK:  bb.0 (%ir-block.1, bbsections Cold):333  ; CHECK-NEXT:    successors: %bb.1334  ; CHECK-SAME:                     , %bb.2335  ; CHECK:    CBNZW336  ; CHECK-SAME:     %bb.1337  ; CHECK-NEXT:    B %bb.2338  ; CHECK:  bb.1.cold_block (bbsections Cold):339  ; CHECK:    TCRETURNdi340  ; CHECK:  bb.2.hot_block:341  ; CHECK:    TCRETURNdi342  bb.0 (%ir-block.1, bbsections Cold):343    successors: %bb.1, %bb.2344    liveins: $w0, $lr345  346    early-clobber $sp = frame-setup STRXpre killed $lr, $sp, -16 :: (store (s64) into %stack.0)347    CBZW killed renamable $w0, %bb.2348  349  bb.1.cold_block (bbsections Cold):350    BL @baz, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0351    early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)352    TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp353  354  bb.2.hot_block:355    BL @bar, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $w0356    early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)357    TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp358 359...360---361name:            tbz_tramp_pushed_oob362tracksRegLiveness: true363liveins:364  - { reg: '$w0', virtual-reg: '' }365  - { reg: '$w1', virtual-reg: '' }366stack:367  - { id: 0, name: '', type: spill-slot, offset: -16, size: 8, alignment: 16,368      stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,369      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }370machineFunctionInfo:371  hasRedZone:      false372body:             |373  ; INDIRECT-LABEL: name: tbz_tramp_pushed_oob374  ; COM: Check that a conditional branch to a trampoline is properly relaxed375  ; COM:   if the trampoline is pushed out of range.376  ; INDIRECT:      bb.0.entry:377  ; INDIRECT-NEXT:   successors: %bb.1378  ; INDIRECT-SAME:                    , %[[TRAMP1:bb.[0-9]+]]379  ; INDIRECT:        TBNZW380  ; INDIRECT-SAME:         %bb.1381  ; INDIRECT-NEXT:    B{{ }}382  ; INDIRECT-SAME:           %[[TRAMP1]]383  ; INDIRECT:      bb.1.unrelaxable:384  ; INDIRECT-NEXT:   successors: %bb.2385  ; INDIRECT-SAME:                    , %[[TRAMP2:bb.[0-9]+]]386  ; INDIRECT:        TBNZW387  ; INDIRECT-SAME:         %bb.2388  ; INDIRECT:      [[TRAMP2]]389  ; INDIRECT-NEXT:   successors: %bb.6390  ; INDIRECT:      bb.2.end:391  ; INDIRECT:        TCRETURNdi392  ; INDIRECT:      [[TRAMP1]].entry:393  ; INDIRECT-NEXT:   successors: %[[TRAMP1_SPILL:bb.[0-9]+]]394  ; INDIRECT:      [[TRAMP1_SPILL]].entry:395  ; INDIRECT-NEXT:   successors: %[[TRAMP1_RESTORE:bb.[0-9]+]]396  ; INDIRECT:        early-clobber $sp = STRXpre $[[SPILL_REGISTER:x[0-9]+]], $sp, -16397  ; INDIRECT-NEXT:   B %[[TRAMP1_RESTORE:bb.[0-9]+]]398  ; INDIRECT:      [[TRAMP1_RESTORE]].cold (bbsections Cold):399  ; INDIRECT-NEXT:   successors: %bb.3400  ; INDIRECT-NEXT:   {{ $}}401  ; INDIRECT-NEXT:   early-clobber $sp, $[[SPILL_REGISTER]] = LDRXpost $sp, 16402  ; INDIRECT:      bb.3.cold (bbsections Cold):403  ; INDIRECT:        TCRETURNdi404 405  bb.0.entry (%ir-block.entry):406    successors: %bb.1, %bb.3407    liveins: $w0, $w1, $lr408 409    early-clobber $sp = frame-setup STRXpre killed $lr, $sp, -16 :: (store (s64) into %stack.0)410    INLINEASM &"mov x16, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x16411    TBZW killed renamable $w0, 0, %bb.3412 413  bb.1.unrelaxable:414    successors: %bb.2, %bb.3415    liveins: $w1, $x16416 417    TBNZW killed renamable $w1, 0, %bb.2418 419    B %bb.3420 421  bb.2.end:422    liveins: $x16423 424    INLINEASM &".space 996", 1 /* sideeffect attdialect */425    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x16426    early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)427    TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp428  429  bb.3.cold (bbsections Cold):430    liveins: $x16431 432    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x16433    early-clobber $sp, $lr = frame-destroy LDRXpost $sp, 16 :: (load (s64) from %stack.0)434    TCRETURNdi @qux, 0, csr_aarch64_aapcs, implicit $sp435 436...437 438name:            x16_used_cold_to_hot439tracksRegLiveness: true440liveins:         []441machineFunctionInfo:442  hasRedZone:      false443body:             |444  ; INDIRECT-LABEL: name: x16_used_cold_to_hot445  ; COM: Check that unconditional branches from the cold section to446  ; COM: the hot section manually insert indirect branches if x16447  ; COM: isn't available but there is still a free register.448  ; INDIRECT:       bb.0.entry:449  ; INDIRECT-NEXT:    successors: %bb.1450  ; INDIRECT-SAME:                     , %bb.3451  ; INDIRECT:         TBZW killed renamable $w8, 0, %bb.1452  ; INDIRECT-NEXT:    {{ $}}453  ; INDIRECT-NEXT:  bb.3.entry:454  ; INDIRECT-NEXT:    successors: %bb.4455  ; INDIRECT-NEXT:    liveins: $x16456  ; INDIRECT-NEXT:    {{ $}}457  ; INDIRECT-NEXT:    early-clobber $sp = STRXpre $[[SPILL_REGISTER]], $sp, -16458  ; INDIRECT-NEXT:    B %bb.4459  ; INDIRECT:       bb.1.hot:460  ; INDIRECT-NEXT:    liveins: $x16461  ; INDIRECT:           killed $x16462  ; INDIRECT:         RET undef $lr463  ; INDIRECT:       bb.4.cold (bbsections Cold):464  ; INDIRECT-NEXT:    successors: %bb.2465  ; INDIRECT-NEXT:    {{ $}}466  ; INDIRECT-NEXT:    early-clobber $sp, $[[SPILL_REGISTER]] = LDRXpost $sp, 16467  ; INDIRECT-NEXT:    {{ $}}468  ; INDIRECT-NEXT:  bb.2.cold (bbsections Cold):469  ; INDIRECT-NEXT:    successors: %bb.5470  ; INDIRECT-NEXT:    liveins: $x16471  ; INDIRECT-NEXT:    {{ $}}472  ; INDIRECT-NEXT:    INLINEASM &".space 4", 1 /* sideeffect attdialect */473  ; INDIRECT-NEXT:    {{ $}}474  ; INDIRECT-NEXT:  bb.5.cold (bbsections Cold):475  ; INDIRECT-NEXT:    successors: %bb.1476  ; INDIRECT-NEXT:    liveins: $x16477  ; INDIRECT-NEXT:    {{ $}}478  ; INDIRECT-NEXT:    $[[SCAVENGED_REGISTER:x[0-9]+]] = ADRP target-flags(aarch64-page) <mcsymbol >479  ; INDIRECT-NEXT:    $[[SCAVENGED_REGISTER]] = ADDXri $[[SCAVENGED_REGISTER]], target-flags(aarch64-pageoff, aarch64-nc) <mcsymbol >, 0480  ; INDIRECT-NEXT:    BR $[[SCAVENGED_REGISTER]]481 482  bb.0.entry:483    successors: %bb.1, %bb.2484 485    $sp = frame-setup SUBXri $sp, 16, 0486    INLINEASM &"mov x16, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x16487    dead renamable $x8 = SUBSXri $x16, 0, 0, implicit-def $nzcv488    renamable $w8 = CSINCWr $wzr, $wzr, 1, implicit killed $nzcv489    TBZW killed renamable $w8, 0, %bb.1490 491    B %bb.2492 493  bb.1.hot:494    liveins: $x16495 496    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x16497    $sp = frame-destroy ADDXri $sp, 16, 0498    RET undef $lr499 500  bb.2.cold (bbsections Cold):501    successors: %bb.1502    liveins: $x16503 504    INLINEASM &".space 4", 1 /* sideeffect attdialect */505    B %bb.1506...507---508name:            all_used_cold_to_hot509tracksRegLiveness: true510stack:511  - { id: 0, name: '', type: spill-slot, offset: -8, size: 8, alignment: 8, 512      stack-id: default, callee-saved-register: '$x19', callee-saved-restored: true, 513      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }514  - { id: 1, name: '', type: spill-slot, offset: -16, size: 8, alignment: 8, 515      stack-id: default, callee-saved-register: '$x20', callee-saved-restored: true, 516      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }517  - { id: 2, name: '', type: spill-slot, offset: -24, size: 8, alignment: 8, 518      stack-id: default, callee-saved-register: '$x21', callee-saved-restored: true, 519      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }520  - { id: 3, name: '', type: spill-slot, offset: -32, size: 8, alignment: 8, 521      stack-id: default, callee-saved-register: '$x22', callee-saved-restored: true, 522      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }523  - { id: 4, name: '', type: spill-slot, offset: -40, size: 8, alignment: 8, 524      stack-id: default, callee-saved-register: '$x23', callee-saved-restored: true, 525      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }526  - { id: 5, name: '', type: spill-slot, offset: -48, size: 8, alignment: 8, 527      stack-id: default, callee-saved-register: '$x24', callee-saved-restored: true, 528      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }529  - { id: 6, name: '', type: spill-slot, offset: -56, size: 8, alignment: 8, 530      stack-id: default, callee-saved-register: '$x25', callee-saved-restored: true, 531      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }532  - { id: 7, name: '', type: spill-slot, offset: -64, size: 8, alignment: 8, 533      stack-id: default, callee-saved-register: '$x26', callee-saved-restored: true, 534      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }535  - { id: 8, name: '', type: spill-slot, offset: -72, size: 8, alignment: 8, 536      stack-id: default, callee-saved-register: '$x27', callee-saved-restored: true, 537      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }538  - { id: 9, name: '', type: spill-slot, offset: -80, size: 8, alignment: 8, 539      stack-id: default, callee-saved-register: '$x28', callee-saved-restored: true, 540      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }541  - { id: 10, name: '', type: spill-slot, offset: -96, size: 8, alignment: 16, 542      stack-id: default, callee-saved-register: '$fp', callee-saved-restored: true, 543      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }544machineFunctionInfo:545  hasRedZone:      false546body:             |547  ; INDIRECT-LABEL: name: all_used_cold_to_hot548  ; COM: Check that unconditional branches from the cold section to549  ; COM: the hot section spill x16 and defer indirect branch550  ; COM: insertion to the linker if there are no free general-purpose551  ; COM: registers.552  ; INDIRECT:      bb.0.entry:553  ; INDIRECT-NEXT:     successors: %bb.3554  ; INDIRECT-NEXT:     liveins: $fp, $x27, $x28, $x25, $x26, $x23, $x24, $x21, $x22, $x19, $x20555  ; INDIRECT-COUNT-29: INLINEASM &"mov556  ; INDIRECT-NEXT:     {{ $}}557  ; INDIRECT:      bb.3.entry:558  ; INDIRECT-NEXT:     successors: %bb.2559  ; INDIRECT-NEXT:     liveins: $fp,  $x0,  $x1,  $x2,  $x3,  $x4,  $x5,  $x6,  $x7,  $x8,560  ; INDIRECT-SAME:              $x9,  $x10, $x11, $x12, $x13, $x14, $x15, $x17, $x18, $x19,561  ; INDIRECT-SAME:              $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28562  ; INDIRECT-NEXT:     {{ $}}563  ; INDIRECT-NEXT:     B %bb.2564  ; INDIRECT-NEXT:     {{ $}}565  ; INDIRECT-NEXT:   bb.1.exit:566  ; INDIRECT-NEXT:     liveins: $x0,  $x1,  $x2,  $x3,  $x4,  $x5,  $x6,  $x7,  $x8,  $x9,567  ; INDIRECT-SAME:              $x10, $x11, $x12, $x13, $x14, $x15, $x16, $x17, $x18, $x19,568  ; INDIRECT-SAME:              $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp569  ; INDIRECT-NEXT:     {{ $}}570  ; INDIRECT-COUNT-30: INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed571  ; INDIRECT:          RET undef $lr572  ; INDIRECT-NEXT:     {{ $}}573  ; INDIRECT-NEXT:   bb.6.exit:574  ; INDIRECT-NEXT:     successors: %bb.7(0x80000000)575  ; INDIRECT-NEXT:     {{ $}}576  ; INDIRECT-NEXT:     early-clobber $sp, $[[SPILL_REGISTER]] = LDRXpost $sp, 16577  ; INDIRECT-NEXT:     {{ $}}578  ; INDIRECT-NEXT:   bb.7.exit:579  ; INDIRECT-NEXT:     successors: %bb.1(0x80000000)580  ; INDIRECT-NEXT:     {{ $}}581  ; INDIRECT-NEXT:     B %bb.1582  ; INDIRECT-NEXT:     {{ $}}583  ; INDIRECT-NEXT:   bb.2.cold (bbsections Cold):584  ; INDIRECT-NEXT:     successors: %bb.5585  ; INDIRECT-NEXT:     liveins: $x0,  $x1,  $x2,  $x3,  $x4,  $x5,  $x6,  $x7,  $x8,  $x9,586  ; INDIRECT-SAME:              $x10, $x11, $x12, $x13, $x14, $x15, $x17, $x18, $x19, $x20,587  ; INDIRECT-SAME:              $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $fp588  ; INDIRECT-NEXT:     {{ $}}589  ; INDIRECT-NEXT:     INLINEASM &"mov x16, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x16590  ; INDIRECT-NEXT:     {{ $}}591  ; INDIRECT-NEXT:   bb.5.cold (bbsections Cold):592  ; INDIRECT-NEXT:     successors: %bb.6593  ; INDIRECT-NEXT:     liveins: $fp,  $x0,  $x1,  $x2,  $x3,  $x4,  $x5,  $x6,  $x7,  $x8,594  ; INDIRECT-SAME:              $x9,  $x10, $x11, $x12, $x13, $x14, $x15, $x16, $x17, $x18,595  ; INDIRECT-SAME:              $x19, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28596  ; INDIRECT-NEXT:     {{ $}}597  ; INDIRECT-NEXT:     early-clobber $sp = STRXpre $[[SPILL_REGISTER]], $sp, -16598  ; INDIRECT-NEXT:     B %bb.6599 600  bb.0.entry:601    successors: %bb.2602    liveins: $fp, $x27, $x28, $x25, $x26, $x23, $x24, $x21, $x22, $x19, $x20603 604    $sp = frame-setup SUBXri $sp, 112, 0605    frame-setup STRXui killed $fp, $sp, 2 :: (store (s64) into %stack.10)606    frame-setup STPXi killed $x28, killed $x27, $sp, 4 :: (store (s64) into %stack.9), (store (s64) into %stack.8)607    frame-setup STPXi killed $x26, killed $x25, $sp, 6 :: (store (s64) into %stack.7), (store (s64) into %stack.6)608    frame-setup STPXi killed $x24, killed $x23, $sp, 8 :: (store (s64) into %stack.5), (store (s64) into %stack.4)609    frame-setup STPXi killed $x22, killed $x21, $sp, 10 :: (store (s64) into %stack.3), (store (s64) into %stack.2)610    frame-setup STPXi killed $x20, killed $x19, $sp, 12 :: (store (s64) into %stack.1), (store (s64) into %stack.0)611    INLINEASM &"mov x0, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x0612    INLINEASM &"mov x1, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x1613    INLINEASM &"mov x2, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x2614    INLINEASM &"mov x3, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x3615    INLINEASM &"mov x4, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x4616    INLINEASM &"mov x5, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x5617    INLINEASM &"mov x6, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x6618    INLINEASM &"mov x7, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x7619    INLINEASM &"mov x8, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x8620    INLINEASM &"mov x9, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x9621    INLINEASM &"mov x10, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x10622    INLINEASM &"mov x11, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x11623    INLINEASM &"mov x12, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x12624    INLINEASM &"mov x13, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x13625    INLINEASM &"mov x14, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x14626    INLINEASM &"mov x15, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x15627    INLINEASM &"mov x17, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x17628    INLINEASM &"mov x18, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x18629    INLINEASM &"mov x19, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x19630    INLINEASM &"mov x20, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x20631    INLINEASM &"mov x21, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x21632    INLINEASM &"mov x22, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x22633    INLINEASM &"mov x23, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x23634    INLINEASM &"mov x24, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x24635    INLINEASM &"mov x25, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x25636    INLINEASM &"mov x26, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x26637    INLINEASM &"mov x27, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x27638    INLINEASM &"mov x28, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x28639    INLINEASM &"mov fp, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $fp640    B %bb.2641 642 643  bb.1.exit:644    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, $fp645 646    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x0647    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x1648    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x2649    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x3650    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x4651    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x5652    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x6653    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x7654    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x8655    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x9656    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x10657    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x11658    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x12659    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x13660    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x14661    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x15662    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x16663    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x17664    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x18665    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x19666    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x20667    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x21668    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x22669    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x23670    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x24671    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x25672    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x26673    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x27674    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $x28675    INLINEASM &"# reg use $0", 1 /* sideeffect attdialect */, 9 /* reguse */, killed $fp676    $x20, $x19 = frame-destroy LDPXi $sp, 12 :: (load (s64) from %stack.1), (load (s64) from %stack.0)677    $x22, $x21 = frame-destroy LDPXi $sp, 10 :: (load (s64) from %stack.3), (load (s64) from %stack.2)678    $x24, $x23 = frame-destroy LDPXi $sp, 8 :: (load (s64) from %stack.5), (load (s64) from %stack.4)679    $x26, $x25 = frame-destroy LDPXi $sp, 6 :: (load (s64) from %stack.7), (load (s64) from %stack.6)680    $x28, $x27 = frame-destroy LDPXi $sp, 4 :: (load (s64) from %stack.9), (load (s64) from %stack.8)681    $fp = frame-destroy LDRXui $sp, 2 :: (load (s64) from %stack.10)682    $sp = frame-destroy ADDXri $sp, 112, 0683    RET undef $lr684 685  bb.2.cold (bbsections Cold):686    successors: %bb.1687    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, $fp688 689    INLINEASM &"mov x16, 1", 1 /* sideeffect attdialect */, 10 /* regdef */, implicit-def $x16690    B %bb.1691 692...693