97 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -stress-regalloc=4 -verify-regalloc -start-before=greedy,0 -stop-after=virtregrewriter,0 %s -o - | FileCheck %s3 4# RUN: llc -enable-new-pm -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -stress-regalloc=4 -verify-regalloc -passes="greedy<sgpr>,virt-reg-rewriter<no-clear-vregs>" %s -o - | FileCheck %s5 6# Check that we don't generate *** Bad machine code: Instruction loads7# from dead spill slot ***8 9 10---11name: restore_undef_copy_use12tracksRegLiveness: true13frameInfo:14 adjustsStack: true15machineFunctionInfo:16 maxKernArgAlign: 117 isEntryFunction: true18 scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'19 stackPtrOffsetReg: '$sgpr32'20 occupancy: 821body: |22 ; CHECK-LABEL: name: restore_undef_copy_use23 ; CHECK: bb.0:24 ; CHECK-NEXT: successors: %bb.3(0x40000000), %bb.1(0x40000000)25 ; CHECK-NEXT: liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr1126 ; CHECK-NEXT: {{ $}}27 ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.3, implicit $exec28 ; CHECK-NEXT: {{ $}}29 ; CHECK-NEXT: bb.1:30 ; CHECK-NEXT: successors: %bb.5(0x40000000), %bb.2(0x40000000)31 ; CHECK-NEXT: {{ $}}32 ; CHECK-NEXT: renamable $sgpr4_sgpr5 = S_OR_SAVEEXEC_B64 undef renamable $sgpr4_sgpr5, implicit-def $exec, implicit-def $scc, implicit $exec33 ; CHECK-NEXT: $exec = S_XOR_B64_term $exec, killed renamable $sgpr4_sgpr5, implicit-def $scc34 ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.5, implicit $exec35 ; CHECK-NEXT: {{ $}}36 ; CHECK-NEXT: bb.2:37 ; CHECK-NEXT: successors: %bb.5(0x80000000)38 ; CHECK-NEXT: {{ $}}39 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $scc, implicit-def $sgpr32, implicit $sgpr3240 ; CHECK-NEXT: $sgpr6_sgpr7 = KILL undef renamable $sgpr6_sgpr741 ; CHECK-NEXT: dead $sgpr30_sgpr31 = SI_CALL undef renamable $sgpr4_sgpr5, 0, csr_amdgpu_gfx90ainsts, implicit $sgpr6_sgpr7, implicit $sgpr0_sgpr1_sgpr2_sgpr342 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $scc, implicit-def $sgpr32, implicit $sgpr3243 ; CHECK-NEXT: S_BRANCH %bb.544 ; CHECK-NEXT: {{ $}}45 ; CHECK-NEXT: bb.3:46 ; CHECK-NEXT: successors: %bb.4(0x80000000)47 ; CHECK-NEXT: liveins: $sgpr10_sgpr1148 ; CHECK-NEXT: {{ $}}49 ; CHECK-NEXT: SI_SPILL_S64_SAVE killed renamable $sgpr10_sgpr11, %stack.0, implicit $exec, implicit $sgpr32 :: (store (s64) into %stack.0, align 4, addrspace 5)50 ; CHECK-NEXT: {{ $}}51 ; CHECK-NEXT: bb.4:52 ; CHECK-NEXT: successors: %bb.5(0x80000000)53 ; CHECK-NEXT: {{ $}}54 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $scc, implicit-def $sgpr32, implicit $sgpr3255 ; CHECK-NEXT: dead $sgpr30_sgpr31 = SI_CALL undef renamable $sgpr4_sgpr5, 0, csr_amdgpu_gfx90ainsts, implicit $sgpr0_sgpr1_sgpr2_sgpr356 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $scc, implicit-def $sgpr32, implicit $sgpr3257 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $scc, implicit-def $sgpr32, implicit $sgpr3258 ; CHECK-NEXT: $sgpr4_sgpr5 = SI_SPILL_S64_RESTORE %stack.0, implicit $exec, implicit $sgpr32 :: (load (s64) from %stack.0, align 4, addrspace 5)59 ; CHECK-NEXT: dead $sgpr30_sgpr31 = SI_CALL undef renamable $sgpr4_sgpr5, 0, csr_amdgpu_gfx90ainsts, implicit $sgpr4_sgpr560 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $scc, implicit-def $sgpr32, implicit $sgpr3261 ; CHECK-NEXT: {{ $}}62 ; CHECK-NEXT: bb.5:63 bb.0:64 liveins: $vgpr0, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11, $sgpr14, $sgpr15, $sgpr1665 66 %0:sgpr_64 = COPY $sgpr10_sgpr1167 S_CBRANCH_EXECZ %bb.3, implicit $exec68 69 bb.1:70 %1:sreg_64 = S_OR_SAVEEXEC_B64 undef %2:sreg_64, implicit-def $exec, implicit-def $scc, implicit $exec71 $exec = S_XOR_B64_term $exec, %1, implicit-def $scc72 S_CBRANCH_EXECZ %bb.5, implicit $exec73 74 bb.2:75 ADJCALLSTACKUP 0, 0, implicit-def dead $scc, implicit-def $sgpr32, implicit $sgpr3276 ; A restore for %0 should not be inserted here.77 $sgpr6_sgpr7 = COPY undef %078 dead $sgpr30_sgpr31 = SI_CALL undef %1, 0, csr_amdgpu_gfx90ainsts, implicit $sgpr6_sgpr7, implicit $sgpr0_sgpr1_sgpr2_sgpr379 ADJCALLSTACKDOWN 0, 0, implicit-def dead $scc, implicit-def $sgpr32, implicit $sgpr3280 S_BRANCH %bb.581 82 bb.3:83 84 bb.4:85 ADJCALLSTACKUP 0, 0, implicit-def dead $scc, implicit-def $sgpr32, implicit $sgpr3286 dead $sgpr30_sgpr31 = SI_CALL undef %3:sreg_64_xexec, 0, csr_amdgpu_gfx90ainsts, implicit $sgpr0_sgpr1_sgpr2_sgpr387 ADJCALLSTACKDOWN 0, 0, implicit-def dead $scc, implicit-def $sgpr32, implicit $sgpr3288 ADJCALLSTACKUP 0, 0, implicit-def dead $scc, implicit-def $sgpr32, implicit $sgpr3289 $sgpr4_sgpr5 = COPY %090 dead $sgpr30_sgpr31 = SI_CALL undef %3:sreg_64_xexec, 0, csr_amdgpu_gfx90ainsts, implicit $sgpr4_sgpr591 ADJCALLSTACKDOWN 0, 0, implicit-def dead $scc, implicit-def $sgpr32, implicit $sgpr3292 93 bb.5:94 95...96 97