1# RUN: llc -o - %s -march=amdgcn -mcpu=fiji -run-pass=si-insert-waitcnts -verify-machineinstrs | FileCheck -check-prefix=GCN %s 2 3# GCN-LABEL: waitcnt-back-edge-loop 4# GCN: bb.2 5# GCN: S_WAITCNT 112 6# GCN: $vgpr5 = V_CVT_I32_F32_e32 killed $vgpr5, implicit $exec 7 8--- 9name: waitcnt-back-edge-loop 10body: | 11 bb.0: 12 successors: %bb.1 13 14 $vgpr1 = V_MOV_B32_e32 0, implicit $exec, implicit-def $vgpr1_vgpr2 15 $vgpr2 = V_MOV_B32_e32 0, implicit $exec, implicit-def $vgpr1_vgpr2 16 $vgpr4 = FLAT_LOAD_DWORD $vgpr1_vgpr2, 0, 0, 0, implicit $exec, implicit $flat_scr :: (volatile load 4 from `float addrspace(1)* null`, addrspace 1) 17 $vgpr0 = FLAT_LOAD_DWORD $vgpr1_vgpr2, 0, 0, 0, implicit $exec, implicit $flat_scr :: (volatile load 4 from `float addrspace(1)* null`, addrspace 1) 18 $sgpr0_sgpr1 = V_CMP_EQ_U32_e64 3, killed $sgpr4, implicit $exec 19 $vgpr3 = V_CNDMASK_B32_e64 -1082130432, 1065353216, killed $sgpr0_sgpr1, implicit $exec 20 $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec, implicit $exec 21 S_BRANCH %bb.1 22 23 bb.3: 24 successors: %bb.1 25 26 $vgpr5 = FLAT_LOAD_DWORD $vgpr1_vgpr2, 0, 0, 0, implicit $exec, implicit $flat_scr :: (volatile load 4 from `float addrspace(1)* null`, addrspace 1) 27 28 bb.1: 29 successors: %bb.5, %bb.2 30 31 $vgpr5 = V_CVT_I32_F32_e32 killed $vgpr5, implicit $exec 32 V_CMP_NE_U32_e32 0, $vgpr5, implicit-def $vcc, implicit $exec 33 $vcc = S_AND_B64 $exec, killed $vcc, implicit-def dead $scc 34 S_CBRANCH_VCCZ %bb.5, implicit killed $vcc 35 36 bb.2: 37 successors: %bb.4, %bb.3 38 39 V_CMP_EQ_U32_e32 9, killed $vgpr5, implicit-def $vcc, implicit $exec 40 $vcc = S_AND_B64 $exec, killed $vcc, implicit-def dead $scc 41 S_CBRANCH_VCCZ %bb.3, implicit killed $vcc 42 43 bb.4: 44 successors: %bb.3, %bb.1 45 46 $vgpr5 = FLAT_LOAD_DWORD $vgpr1_vgpr2, 0, 0, 0, implicit $exec, implicit $flat_scr :: (volatile load 4 from `float addrspace(1)* null`, addrspace 1) 47 $vgpr4 = V_CVT_I32_F32_e32 $vgpr5, implicit $exec 48 V_CMP_EQ_U32_e32 2, killed $vgpr4, implicit-def $vcc, implicit $exec 49 $vcc = S_AND_B64 $exec, killed $vcc, implicit-def dead $scc 50 $vgpr4 = V_MOV_B32_e32 $vgpr5, implicit $exec, implicit $exec 51 S_CBRANCH_VCCZ %bb.1, implicit killed $vcc 52 S_BRANCH %bb.3 53 54 bb.5: 55 56 $vgpr4 = V_MAC_F32_e32 killed $vgpr0, killed $vgpr3, killed $vgpr4, implicit $exec 57 EXP_DONE 12, killed $vgpr4, undef $vgpr0, undef $vgpr0, undef $vgpr0, 0, 0, 15, implicit $exec 58 S_ENDPGM 59... 60--- 61 62# GCN-LABEL: name: waitcnt-multiple-back-edges{{$}} 63# GCN: bb.0: 64# GCN: S_WAITCNT 0 65# GCN-NEXT: S_BRANCH %bb.2 66 67name: waitcnt-multiple-back-edges 68body: | 69 bb.0: 70 S_BRANCH %bb.2 71 72 bb.1: 73 S_BRANCH %bb.2 74 75 bb.2: 76 S_CBRANCH_VCCZ %bb.1, implicit $vcc 77 78 bb.3: 79 S_CBRANCH_VCCNZ %bb.5, implicit $vcc 80 81 bb.4: 82 BUFFER_ATOMIC_ADD_OFFSET renamable $vgpr0, renamable $sgpr12_sgpr13_sgpr14_sgpr15, 0, 4, 0, implicit $exec 83 S_CBRANCH_SCC0 %bb.2, implicit $scc 84 S_BRANCH %bb.6 85 86 bb.5: 87 S_CBRANCH_SCC0 %bb.2, implicit $scc 88 S_BRANCH %bb.6 89 90 bb.6: 91 S_CBRANCH_SCC1 %bb.0, implicit $scc 92 S_ENDPGM 93... 94