1 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -start-before=si-lower-sgpr-spills -stop-after=greedy,1 -verify-machineinstrs --stress-regalloc=2 -o - %s | FileCheck -check-prefix GCN-REGALLOC %s
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -start-before=si-lower-sgpr-spills -stop-after=virtregrewriter,1 -verify-machineinstrs --stress-regalloc=2 -o - %s | FileCheck -check-prefix GCN-REWRITER %s
4 name: test_wwm_reg_superclass_spill
5 tracksRegLiveness: true
7 - { id: 0, name: '', type: spill-slot, offset: 0, size: 8, alignment: 8,
8 stack-id: sgpr-spill, callee-saved-register: '', callee-saved-restored: true}
11 stackPtrOffsetReg: '$sgpr32'
12 sgprForEXECCopy: '$sgpr100_sgpr101'
15 ; GCN-REGALLOC-NUM-2: %{{[0-9]+}}:av_32 = SI_SPILL_WWM_AV32_RESTORE
16 ; GCN-REGALLOC: S_ENDPGM 0
18 ; GCN-REWRITER-NUM-2: renamable $vgpr0 = SI_SPILL_WWM_AV32_RESTORE
19 ; GCN-REWRITER: S_ENDPGM 0
21 $sgpr0_sgpr1 = IMPLICIT_DEF
22 %temp0:vgpr_32(s32) = COPY $vgpr0
23 %temp1:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
24 $vcc = S_AND_B64 $exec, $sgpr0_sgpr1, implicit-def dead $scc
25 S_CBRANCH_VCCNZ %bb.2, implicit $vcc
29 %temp2:vreg_64 = IMPLICIT_DEF
30 %temp1:vgpr_32 = FLAT_LOAD_DWORD %temp2, 0, 0, implicit $exec, implicit $flat_scr
33 %temp3:vreg_64 = V_MOV_B64_PSEUDO 0, implicit $exec
34 $sgpr2_sgpr3 = IMPLICIT_DEF
35 $sgpr4_sgpr5 = IMPLICIT_DEF
36 %temp4:vgpr_32 = FLAT_LOAD_UBYTE %temp3, 0, 0, implicit $exec, implicit $flat_scr
37 S_CBRANCH_EXECZ %bb.5, implicit $exec
44 liveins: $sgpr0_sgpr1, $sgpr2_sgpr3, $sgpr4_sgpr5
45 SI_SPILL_S64_SAVE killed $sgpr2_sgpr3, %stack.0, implicit $exec, implicit $sgpr32
46 $sgpr56_sgpr57 = S_LOAD_DWORDX2_IMM $sgpr4_sgpr5, 48, 0
47 $sgpr2 = S_MOV_B32 124
48 %temp5:vreg_64 = COPY $sgpr56_sgpr57
49 %temp6:vreg_64, dead $sgpr2_sgpr3 = V_MAD_U64_U32_e64 %temp0(s32), killed $sgpr2, %temp5, 0, implicit $exec
50 %temp7:vreg_64 = V_MOV_B64_PSEUDO 0, implicit $exec
51 undef %temp8.sub0:vreg_64 = FLAT_LOAD_DWORD %temp7, 0, 0, implicit $exec, implicit $flat_scr
52 $sgpr44_sgpr45_sgpr46_sgpr47 = S_LOAD_DWORDX4_IMM $sgpr4_sgpr5, 88, 0
53 $sgpr58_sgpr59 = S_LOAD_DWORDX2_IMM $sgpr4_sgpr5, 104, 0
54 $sgpr62_sgpr63 = S_XOR_B64 $sgpr0_sgpr1, -1, implicit-def dead $scc
55 $sgpr60_sgpr61 = S_MOV_B64 0
59 S_CBRANCH_EXECZ %bb.8, implicit $exec
63 liveins: $sgpr0_sgpr1, $sgpr60_sgpr61
64 %temp9:vgpr_32 = nofpexcept V_ADD_F32_e32 0, %temp1, implicit $mode, implicit $exec
65 %temp10:vgpr_32 = V_AND_B32_e32 2147483647, %temp9, implicit $exec
66 %temp11:vgpr_32 = V_AND_B32_e32 65535, %temp4, implicit $exec
67 undef %temp12.sub1:vreg_64 = V_MOV_B32_e32 0, implicit $exec
68 FLAT_STORE_DWORD %temp7, %temp12.sub1, 0, 0, implicit $exec, implicit $flat_scr
69 %temp13:vgpr_32 = V_CNDMASK_B32_e64 0, 1065353216, 0, 0, $sgpr0_sgpr1, implicit $exec
70 $sgpr19 = IMPLICIT_DEF
71 %temp14:vgpr_32 = nofpexcept V_MUL_F32_e64 0, 0, 0, $sgpr19, 0, 0, implicit $mode, implicit $exec
72 $sgpr17 = IMPLICIT_DEF
75 liveins: $sgpr60_sgpr61
76 $exec = S_OR_B64 $exec, killed $sgpr60_sgpr61, implicit-def $scc
77 $sgpr2_sgpr3 = SI_SPILL_S64_RESTORE %stack.0, implicit $exec, implicit $sgpr32