1 # RUN: llc -march=amdgcn -verify-machineinstrs -run-pass si-optimize-exec-masking-pre-ra %s -o - | FileCheck -check-prefix=GCN %s
3 # GCN-LABEL: name: kill_all
7 tracksRegLiveness: true
9 - { id: 0, class: vreg_64 }
10 - { id: 1, class: vgpr_32 }
11 - { id: 2, class: vgpr_32 }
12 - { id: 3, class: sgpr_32 }
13 - { id: 4, class: sgpr_32 }
19 $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
20 %1 = FLAT_LOAD_DWORD %0, 0, 0, 0, 0, implicit $exec, implicit $flat_scr :: (load 4)
21 %2 = V_ADD_F32_e64 0, killed %1, 0, 1, 0, 0, implicit $exec
22 %4 = S_ADD_U32 %3, 1, implicit-def $scc
26 # GCN-LABEL: name: load_without_memoperand
27 # GCN: $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
28 # GCN-NEXT: dead %1:vgpr_32 = FLAT_LOAD_DWORD %0, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
29 # GCN-NEXT: S_ENDPGM 0
30 name: load_without_memoperand
31 tracksRegLiveness: true
33 - { id: 0, class: vreg_64 }
34 - { id: 1, class: vgpr_32 }
35 - { id: 2, class: vgpr_32 }
36 - { id: 3, class: sgpr_32 }
37 - { id: 4, class: sgpr_32 }
43 $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
44 %1 = FLAT_LOAD_DWORD %0, 0, 0, 0, 0, implicit $exec, implicit $flat_scr
45 %2 = V_ADD_F32_e64 0, killed %1, 0, 1, 0, 0, implicit $exec
46 %4 = S_ADD_U32 %3, 1, implicit-def $scc
50 # GCN-LABEL: name: load_volatile
51 # GCN: $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
52 # GCN-NEXT: dead %1:vgpr_32 = FLAT_LOAD_DWORD %0, 0, 0, 0, 0, implicit $exec, implicit $flat_scr :: (volatile load 4)
53 # GCN-NEXT: S_ENDPGM 0
55 tracksRegLiveness: true
57 - { id: 0, class: vreg_64 }
58 - { id: 1, class: vgpr_32 }
59 - { id: 2, class: vgpr_32 }
60 - { id: 3, class: sgpr_32 }
61 - { id: 4, class: sgpr_32 }
67 $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
68 %1 = FLAT_LOAD_DWORD %0, 0, 0, 0, 0, implicit $exec, implicit $flat_scr :: (volatile load 4)
69 %2 = V_ADD_F32_e64 0, killed %1, 0, 1, 0, 0, implicit $exec
70 %4 = S_ADD_U32 %3, 1, implicit-def $scc
74 # GCN-LABEL: name: store
75 # GCN: $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
76 # GCN-NEXT: FLAT_STORE_DWORD %0, %1, 0, 0, 0, 0, implicit $exec, implicit $flat_scr :: (store 4)
77 # GCN-NEXT: S_ENDPGM 0
79 tracksRegLiveness: true
81 - { id: 0, class: vreg_64 }
82 - { id: 1, class: vgpr_32 }
88 $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
89 FLAT_STORE_DWORD %0, %1, 0, 0, 0, 0, implicit $exec, implicit $flat_scr :: (store 4)
93 # GCN-LABEL: name: barrier
94 # GCN: $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
96 # GCN-NEXT: S_ENDPGM 0
98 tracksRegLiveness: true
102 $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
107 # GCN-LABEL: name: call
108 # GCN: $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
109 # GCN-NEXT: $sgpr4_sgpr5 = S_SWAPPC_B64 $sgpr2_sgpr3
110 # GCN-NEXT: S_ENDPGM 0
112 tracksRegLiveness: true
115 liveins: $sgpr2_sgpr3
117 $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
118 $sgpr4_sgpr5 = S_SWAPPC_B64 $sgpr2_sgpr3
122 # GCN-LABEL: name: exp
123 # GCN: $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
124 # GCN-NEXT: EXP 32, undef %0:vgpr_32, undef %1:vgpr_32, %2, undef %3:vgpr_32, 0, 0, 15, implicit $exec
125 # GCN-NEXT: S_ENDPGM 0
127 tracksRegLiveness: true
129 - { id: 0, class: vgpr_32 }
130 - { id: 1, class: vgpr_32 }
131 - { id: 2, class: vgpr_32 }
132 - { id: 3, class: vgpr_32 }
137 $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
138 EXP 32, undef %0, undef %1, killed %2, undef %3, 0, 0, 15, implicit $exec
142 # GCN-LABEL: name: return_to_epilog
143 # GCN: $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
144 # GCN-NEXT: SI_RETURN_TO_EPILOG killed $vgpr0
145 name: return_to_epilog
146 tracksRegLiveness: true
150 $vgpr0 = IMPLICIT_DEF
151 $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
152 SI_RETURN_TO_EPILOG killed $vgpr0
155 # GCN-LABEL: name: split_block
157 # GCN-NEXT: successors: %bb.1
160 # GCN-NEXT: S_ENDPGM 0
162 tracksRegLiveness: true
164 - { id: 0, class: vgpr_32 }
165 - { id: 1, class: vgpr_32 }
166 - { id: 2, class: sgpr_32 }
167 - { id: 3, class: sgpr_32 }
171 $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
176 %1 = V_ADD_F32_e64 0, killed %0, 0, 1, 0, 0, implicit $exec
177 %3 = S_ADD_U32 %2, 1, implicit-def $scc
181 # GCN-LABEL: name: split_block_empty_block
183 # GCN-NEXT: successors: %bb.1
187 # GCN-NEXT: S_ENDPGM 0
188 name: split_block_empty_block
189 tracksRegLiveness: true
193 $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
201 # GCN-LABEL: name: split_block_uncond_branch
203 # GCN-NEXT: successors: %bb.1
204 # GCN: S_BRANCH %bb.1
207 # GCN-NEXT: S_ENDPGM 0
208 name: split_block_uncond_branch
209 tracksRegLiveness: true
213 $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
220 # GCN-LABEL: name: split_block_cond_branch
222 # GCN-NEXT: successors: %bb.2(0x40000000), %bb.1(0x40000000)
223 # GCN: $sgpr0_sgpr1 = S_OR_B64 $exec, $vcc, implicit-def $scc
224 # GCN: S_CBRANCH_VCCNZ %bb.2, implicit undef $vcc
227 # GCN-NEXT: S_ENDPGM 0
228 name: split_block_cond_branch
229 tracksRegLiveness: true
233 $sgpr0_sgpr1 = S_OR_B64 $exec, $vcc, implicit-def $scc
234 S_CBRANCH_VCCNZ %bb.2, implicit undef $vcc
242 # GCN-LABEL: name: two_preds_both_dead
244 # GCN-NEXT: successors: %bb.2
246 # GCN: S_BRANCH %bb.2
248 # GCN-NEXT: successors: %bb.2
250 # GCN: S_BRANCH %bb.2
252 # GCN-NEXT: S_ENDPGM 0
253 name: two_preds_both_dead
254 tracksRegLiveness: true
258 $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
263 $sgpr0_sgpr1 = S_AND_B64 $exec, killed $vcc, implicit-def $scc
270 # GCN-LABEL: name: two_preds_one_dead
272 # GCN-NEXT: successors: %bb.2
273 # GCN: $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
274 # GCN-NEXT: S_BARRIER
275 # GCN-NEXT: S_BRANCH %bb.2
277 # GCN-NEXT: successors: %bb.2
279 # GCN: S_BRANCH %bb.2
281 # GCN-NEXT: S_ENDPGM 0
282 name: two_preds_one_dead
283 tracksRegLiveness: true
287 $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
293 $sgpr0_sgpr1 = S_AND_B64 $exec, killed $vcc, implicit-def $scc
300 # GCN-LABEL: name: implicit_use_on_S_ENDPGM 0
304 # GCN: S_ENDPGM 0, implicit %3
305 name: implicit_use_on_S_ENDPGM 0
306 tracksRegLiveness: true
310 dead %0:vgpr_32 = V_ADD_I32_e32 12345, undef %1:vgpr_32, implicit-def $vcc, implicit $exec
311 %2:sreg_64_xexec = COPY $vcc
312 %3:vgpr_32, dead %4:sreg_64_xexec = V_ADDC_U32_e64 undef %5:vgpr_32, undef %6:vgpr_32, %2, 0, implicit $exec
313 S_ENDPGM 0, implicit %3
318 # GCN-LABEL: name: inlineasm_nosideeffect
322 name: inlineasm_nosideeffect
323 tracksRegLiveness: true
325 - { id: 0, class: vreg_64 }
326 - { id: 1, class: vgpr_32 }
332 $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
333 %2:sreg_64 = IMPLICIT_DEF
339 # GCN-LABEL: name: inlineasm_sideeffect
340 # GCN: $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
341 # GCN-NEXT: IMPLICIT_DEF
342 # GCN-NEXT: INLINEASM
343 # GCN-NEXT: S_ENDPGM 0
344 name: inlineasm_sideeffect
345 tracksRegLiveness: true
347 - { id: 0, class: vreg_64 }
348 - { id: 1, class: vgpr_32 }
354 $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
355 %2:sreg_64 = IMPLICIT_DEF