1 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=si-late-branch-lowering -verify-machineinstrs %s -o - | FileCheck -check-prefixes=GCN,GFX9 %s
2 # RUN: llc -march=amdgcn -mcpu=gfx1010 -mattr=-wavefrontsize32,+wavefrontsize64 -run-pass=si-late-branch-lowering -verify-machineinstrs %s -o - | FileCheck -check-prefixes=GCN,GFX10 %s
3 # RUN: llc -march=amdgcn -mcpu=gfx1100 -mattr=-wavefrontsize32,+wavefrontsize64 -run-pass=si-late-branch-lowering -verify-machineinstrs %s -o - | FileCheck -check-prefixes=GCN,GFX11 %s
6 define amdgpu_ps void @early_term_scc0_end_block() {
10 define amdgpu_ps void @early_term_scc0_next_terminator() {
14 define amdgpu_ps void @early_term_scc0_in_block() {
18 define amdgpu_gs void @early_term_scc0_gs() {
22 define amdgpu_cs void @early_term_scc0_cs() {
26 define amdgpu_ps void @early_term_no_export() #0 {
30 define amdgpu_ps void @early_term_depth_only() #1 {
34 attributes #0 = { "amdgpu-color-export"="0" "amdgpu-depth-export"="0" }
35 attributes #1 = { "amdgpu-color-export"="0" "amdgpu-depth-export"="1" }
39 name: early_term_scc0_end_block
40 tracksRegLiveness: true
45 ; GCN-LABEL: name: early_term_scc0_end_block
47 ; GCN: successors: %bb.1(0x80000000), %bb.2(0x00000000)
48 ; GCN: liveins: $sgpr0, $sgpr1
49 ; GCN: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
50 ; GCN: dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
51 ; GCN: S_CBRANCH_SCC0 %bb.2, implicit $scc
53 ; GCN: liveins: $vgpr0
54 ; GCN: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
57 ; GCN: $exec = S_MOV_B64 0
58 ; GFX9: EXP_DONE 9, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
59 ; GFX10: EXP_DONE 9, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
60 ; GFX11: EXP_DONE 0, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
63 liveins: $sgpr0, $sgpr1
66 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
67 dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
68 SI_EARLY_TERMINATE_SCC0 implicit $scc, implicit $exec
72 EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
77 name: early_term_scc0_next_terminator
78 tracksRegLiveness: true
83 ; GCN-LABEL: name: early_term_scc0_next_terminator
85 ; GCN: successors: %bb.2(0x80000000), %bb.3(0x00000000)
86 ; GCN: liveins: $sgpr0, $sgpr1
87 ; GCN: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
88 ; GCN: dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
89 ; GCN: S_CBRANCH_SCC0 %bb.3, implicit $scc
92 ; GCN: successors: %bb.2(0x80000000)
93 ; GCN: $vgpr0 = V_MOV_B32_e32 1, implicit $exec
95 ; GCN: liveins: $vgpr0
96 ; GCN: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
99 ; GCN: $exec = S_MOV_B64 0
100 ; GFX9: EXP_DONE 9, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
101 ; GFX10: EXP_DONE 9, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
102 ; GFX11: EXP_DONE 0, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
105 liveins: $sgpr0, $sgpr1
108 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
109 dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
110 SI_EARLY_TERMINATE_SCC0 implicit $scc, implicit $exec
115 $vgpr0 = V_MOV_B32_e32 1, implicit $exec
120 EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
125 name: early_term_scc0_in_block
126 tracksRegLiveness: true
131 ; GCN-LABEL: name: early_term_scc0_in_block
133 ; GCN: successors: %bb.3(0x40000000), %bb.2(0x40000000)
134 ; GCN: liveins: $sgpr0, $sgpr1
135 ; GCN: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
136 ; GCN: dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
137 ; GCN: S_CBRANCH_SCC0 %bb.2, implicit $scc
139 ; GCN: successors: %bb.1(0x80000000)
140 ; GCN: liveins: $vgpr0, $scc
141 ; GCN: $vgpr1 = V_MOV_B32_e32 1, implicit $exec
143 ; GCN: liveins: $vgpr0, $vgpr1
144 ; GCN: EXP 1, $vgpr1, $vgpr1, $vgpr1, $vgpr1, -1, -1, 15, implicit $exec
145 ; GCN: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
148 ; GCN: $exec = S_MOV_B64 0
149 ; GFX9: EXP_DONE 9, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
150 ; GFX10: EXP_DONE 9, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
151 ; GFX11: EXP_DONE 0, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
154 liveins: $sgpr0, $sgpr1
157 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
158 dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
159 SI_EARLY_TERMINATE_SCC0 implicit $scc, implicit $exec
160 $vgpr1 = V_MOV_B32_e32 1, implicit $exec
163 liveins: $vgpr0, $vgpr1
164 EXP 1, $vgpr1, $vgpr1, $vgpr1, $vgpr1, -1, -1, 15, implicit $exec
165 EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
170 name: early_term_scc0_gs
171 tracksRegLiveness: true
176 ; GCN-LABEL: name: early_term_scc0_gs
178 ; GCN: successors: %bb.1(0x80000000)
179 ; GCN: liveins: $sgpr0, $sgpr1
180 ; GCN: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
181 ; GCN: dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
183 ; GCN: liveins: $vgpr0
186 ; GCN: $exec = S_MOV_B64 0
189 liveins: $sgpr0, $sgpr1
192 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
193 dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
194 SI_EARLY_TERMINATE_SCC0 implicit $scc, implicit $exec
202 name: early_term_scc0_cs
203 tracksRegLiveness: true
208 ; GCN-LABEL: name: early_term_scc0_cs
210 ; GCN: successors: %bb.1(0x80000000), %bb.2(0x00000000)
211 ; GCN: liveins: $sgpr0, $sgpr1
212 ; GCN: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
213 ; GCN: dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
214 ; GCN: S_CBRANCH_SCC0 %bb.2, implicit $scc
216 ; GCN: liveins: $vgpr0
219 ; GCN: $exec = S_MOV_B64 0
222 liveins: $sgpr0, $sgpr1
225 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
226 dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
227 SI_EARLY_TERMINATE_SCC0 implicit $scc, implicit $exec
235 name: early_term_no_export
236 tracksRegLiveness: true
241 ; GCN-LABEL: name: early_term_no_export
243 ; GCN: successors: %bb.1(0x80000000), %bb.2(0x00000000)
244 ; GCN: liveins: $sgpr0, $sgpr1
245 ; GCN: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
246 ; GCN: dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
247 ; GCN: S_CBRANCH_SCC0 %bb.2, implicit $scc
249 ; GCN: liveins: $vgpr0
250 ; GCN: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
253 ; GCN: $exec = S_MOV_B64 0
254 ; GFX9: EXP_DONE 9, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
255 ; GFX10-NOT: EXP_DONE
256 ; GFX11-NOT: EXP_DONE
259 liveins: $sgpr0, $sgpr1
262 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
263 dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
264 SI_EARLY_TERMINATE_SCC0 implicit $scc, implicit $exec
268 EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
273 name: early_term_depth_only
274 tracksRegLiveness: true
279 ; GCN-LABEL: name: early_term_depth_only
281 ; GCN: successors: %bb.1(0x80000000), %bb.2(0x00000000)
282 ; GCN: liveins: $sgpr0, $sgpr1
283 ; GCN: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
284 ; GCN: dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
285 ; GCN: S_CBRANCH_SCC0 %bb.2, implicit $scc
287 ; GCN: liveins: $vgpr0
288 ; GCN: EXP_DONE 8, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
291 ; GCN: $exec = S_MOV_B64 0
292 ; GFX9: EXP_DONE 9, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
293 ; GFX10: EXP_DONE 9, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
294 ; GFX11: EXP_DONE 8, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
297 liveins: $sgpr0, $sgpr1
300 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
301 dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
302 SI_EARLY_TERMINATE_SCC0 implicit $scc, implicit $exec
306 EXP_DONE 8, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec