1 # RUN: llc -march=amdgcn -mcpu=gfx803 -verify-machineinstrs -run-pass si-insert-waitcnts -o - %s | FileCheck -check-prefixes=GCN,GFX8 %s
2 # RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass si-insert-waitcnts -o - %s | FileCheck -check-prefixes=GCN,GFX9 %s
6 define amdgpu_ps void @irreducible_loop() {
9 define amdgpu_ps void @irreducible_loop_extended() {
16 # GCN-LABEL: name: irreducible_loop{{$}}
17 # GCN: S_LOAD_DWORDX4_IMM
18 # GFX8: S_WAITCNT 127{{$}}
19 # GFX9: S_WAITCNT 49279{{$}}
20 # GCN: S_BUFFER_LOAD_DWORD_IMM
21 # GFX8: S_WAITCNT 127{{$}}
22 # GFX9: S_WAITCNT 49279{{$}}
24 name: irreducible_loop
27 successors: %bb.3, %bb.2
29 S_CBRANCH_VCCZ %bb.2, implicit $vcc
33 successors: %bb.3, %bb.2
35 S_CBRANCH_VCCNZ %bb.3, implicit $vcc
40 renamable $sgpr4_sgpr5_sgpr6_sgpr7 = S_LOAD_DWORDX4_IMM renamable $sgpr0_sgpr1, 0, 0, 0
41 renamable $sgpr3 = S_BUFFER_LOAD_DWORD_IMM killed renamable $sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0
44 successors: %bb.1, %bb.4
46 S_CMP_GE_I32 renamable $sgpr2, renamable $sgpr3, implicit-def $scc
47 S_CBRANCH_SCC0 %bb.1, implicit killed $scc
55 # GCN-LABEL: name: irreducible_loop_extended
57 # GCN: S_LOAD_DWORDX4_IMM
58 # GFX8: S_WAITCNT 127{{$}}
59 # GFX9: S_WAITCNT 49279{{$}}
60 # GCN: BUFFER_STORE_DWORD_OFFEN_exact
61 # GFX8: S_WAITCNT 127{{$}}
62 # GFX9: S_WAITCNT 49279{{$}}
63 # GCN: BUFFER_STORE_DWORD_OFFEN_exact
64 # GCN: S_LOAD_DWORDX4_IMM
65 # GFX8: S_WAITCNT 127{{$}}
66 # GFX9: S_WAITCNT 49279{{$}}
67 # GCN: BUFFER_ATOMIC_ADD_OFFSET_RTN
69 # GCN: FLAT_STORE_DWORD
71 name: irreducible_loop_extended
75 successors: %bb.1, %bb.2
76 $sgpr4_sgpr5_sgpr6_sgpr7 = S_LOAD_DWORDX4_IMM renamable $sgpr2_sgpr3, 0, 0, 0
77 S_CBRANCH_VCCZ %bb.2, implicit $vcc
81 BUFFER_STORE_DWORD_OFFEN_exact killed renamable $vgpr3, renamable $vgpr2, renamable $sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, 0, 0, implicit $exec
84 successors: %bb.3, %bb.6
85 S_CBRANCH_VCCNZ %bb.6, implicit $vcc
88 successors: %bb.4, %bb.5
89 BUFFER_STORE_DWORD_OFFEN_exact killed renamable $vgpr3, killed renamable $vgpr2, killed renamable $sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, 0, 0, implicit $exec
90 S_CBRANCH_VCCNZ %bb.5, implicit $vcc
94 renamable $sgpr12_sgpr13_sgpr14_sgpr15 = S_LOAD_DWORDX4_IMM killed renamable $sgpr2_sgpr3, 64, 0, 0
95 renamable $vgpr2 = BUFFER_ATOMIC_ADD_OFFSET_RTN killed renamable $vgpr2, killed renamable $sgpr12_sgpr13_sgpr14_sgpr15, 0, 0, 0, implicit $exec
101 FLAT_STORE_DWORD $vgpr3_vgpr4, $vgpr2, 0, 0, 0, 0, implicit $exec, implicit $flat_scr