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
5 define amdgpu_ps void @early_term_scc0_end_block() {
9 define amdgpu_ps void @early_term_scc0_next_terminator() {
13 define amdgpu_ps void @early_term_scc0_in_block() {
17 define amdgpu_gs void @early_term_scc0_gs() {
21 define amdgpu_cs void @early_term_scc0_cs() {
25 define amdgpu_ps void @early_term_no_export() #0 {
29 attributes #0 = { "amdgpu-color-export"="0" "amdgpu-depth-export"="0" }
33 name: early_term_scc0_end_block
34 tracksRegLiveness: true
39 ; GCN-LABEL: name: early_term_scc0_end_block
41 ; GCN: successors: %bb.1(0x80000000), %bb.2(0x00000000)
42 ; GCN: liveins: $sgpr0, $sgpr1
43 ; GCN: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
44 ; GCN: dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
45 ; GCN: S_CBRANCH_SCC0 %bb.2, implicit $scc
47 ; GCN: liveins: $vgpr0
48 ; GCN: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
51 ; GCN: $exec = S_MOV_B64 0
52 ; GCN: EXP_DONE 9, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
55 liveins: $sgpr0, $sgpr1
58 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
59 dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
60 SI_EARLY_TERMINATE_SCC0 implicit $scc, implicit $exec
64 EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
69 name: early_term_scc0_next_terminator
70 tracksRegLiveness: true
75 ; GCN-LABEL: name: early_term_scc0_next_terminator
77 ; GCN: successors: %bb.2(0x80000000), %bb.3(0x00000000)
78 ; GCN: liveins: $sgpr0, $sgpr1
79 ; GCN: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
80 ; GCN: dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
81 ; GCN: S_CBRANCH_SCC0 %bb.3, implicit $scc
84 ; GCN: successors: %bb.2(0x80000000)
85 ; GCN: $vgpr0 = V_MOV_B32_e32 1, implicit $exec
87 ; GCN: liveins: $vgpr0
88 ; GCN: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
91 ; GCN: $exec = S_MOV_B64 0
92 ; GCN: EXP_DONE 9, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
95 liveins: $sgpr0, $sgpr1
98 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
99 dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
100 SI_EARLY_TERMINATE_SCC0 implicit $scc, implicit $exec
105 $vgpr0 = V_MOV_B32_e32 1, implicit $exec
110 EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
115 name: early_term_scc0_in_block
116 tracksRegLiveness: true
121 ; GCN-LABEL: name: early_term_scc0_in_block
123 ; GCN: successors: %bb.3(0x40000000), %bb.2(0x40000000)
124 ; GCN: liveins: $sgpr0, $sgpr1
125 ; GCN: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
126 ; GCN: dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
127 ; GCN: S_CBRANCH_SCC0 %bb.2, implicit $scc
129 ; GCN: successors: %bb.1(0x80000000)
130 ; GCN: liveins: $vgpr0, $scc
131 ; GCN: $vgpr1 = V_MOV_B32_e32 1, implicit $exec
133 ; GCN: liveins: $vgpr0, $vgpr1
134 ; GCN: EXP 1, $vgpr1, $vgpr1, $vgpr1, $vgpr1, -1, -1, 15, implicit $exec
135 ; GCN: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
138 ; GCN: $exec = S_MOV_B64 0
139 ; GCN: EXP_DONE 9, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
142 liveins: $sgpr0, $sgpr1
145 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
146 dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
147 SI_EARLY_TERMINATE_SCC0 implicit $scc, implicit $exec
148 $vgpr1 = V_MOV_B32_e32 1, implicit $exec
151 liveins: $vgpr0, $vgpr1
152 EXP 1, $vgpr1, $vgpr1, $vgpr1, $vgpr1, -1, -1, 15, implicit $exec
153 EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
158 name: early_term_scc0_gs
159 tracksRegLiveness: true
164 ; GCN-LABEL: name: early_term_scc0_gs
166 ; GCN: successors: %bb.1(0x80000000)
167 ; GCN: liveins: $sgpr0, $sgpr1
168 ; GCN: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
169 ; GCN: dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
171 ; GCN: liveins: $vgpr0
174 ; GCN: $exec = S_MOV_B64 0
177 liveins: $sgpr0, $sgpr1
180 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
181 dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
182 SI_EARLY_TERMINATE_SCC0 implicit $scc, implicit $exec
190 name: early_term_scc0_cs
191 tracksRegLiveness: true
196 ; GCN-LABEL: name: early_term_scc0_cs
198 ; GCN: successors: %bb.1(0x80000000), %bb.2(0x00000000)
199 ; GCN: liveins: $sgpr0, $sgpr1
200 ; GCN: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
201 ; GCN: dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
202 ; GCN: S_CBRANCH_SCC0 %bb.2, implicit $scc
204 ; GCN: liveins: $vgpr0
207 ; GCN: $exec = S_MOV_B64 0
210 liveins: $sgpr0, $sgpr1
213 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
214 dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
215 SI_EARLY_TERMINATE_SCC0 implicit $scc, implicit $exec
223 name: early_term_no_export
224 tracksRegLiveness: true
229 ; GCN-LABEL: name: early_term_no_export
231 ; GCN: successors: %bb.1(0x80000000), %bb.2(0x00000000)
232 ; GCN: liveins: $sgpr0, $sgpr1
233 ; GCN: $vgpr0 = V_MOV_B32_e32 0, implicit $exec
234 ; GCN: dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
235 ; GCN: S_CBRANCH_SCC0 %bb.2, implicit $scc
237 ; GCN: liveins: $vgpr0
238 ; GCN: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
241 ; GCN: $exec = S_MOV_B64 0
242 ; GFX9: EXP_DONE 9, undef $vgpr0, undef $vgpr0, undef $vgpr0, undef $vgpr0, 1, 0, 0, implicit $exec
243 ; GFX10-NOT: EXP_DONE
246 liveins: $sgpr0, $sgpr1
249 $vgpr0 = V_MOV_B32_e32 0, implicit $exec
250 dead $sgpr0 = S_AND_B32 $sgpr0, killed $sgpr1, implicit-def $scc
251 SI_EARLY_TERMINATE_SCC0 implicit $scc, implicit $exec
255 EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec