1 # RUN: llc -mtriple=amdgcn -mcpu=tonga -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=GCN -check-prefix=VI %s
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx803 -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=GCN -check-prefix=GFX8 %s
3 # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=GCN -check-prefix=GFX9 %s
5 # GCN-LABEL: name: hazard_implicit_def
10 # GCN: V_INTERP_P1_F32
13 name: hazard_implicit_def
15 exposesReturnsTwice: false
17 regBankSelected: false
19 tracksRegLiveness: true
22 - { reg: '$sgpr7', virtual-reg: '' }
23 - { reg: '$vgpr4', virtual-reg: '' }
26 liveins: $sgpr7, $vgpr4
28 $m0 = S_MOV_B32 killed $sgpr7
30 $vgpr0 = V_INTERP_P1_F32 killed $vgpr4, 0, 0, implicit $mode, implicit $m0, implicit $exec
31 SI_RETURN_TO_EPILOG killed $vgpr5, killed $vgpr0
35 # GCN-LABEL: name: hazard_inlineasm
37 # GCN: $m0 = S_MOV_B32
40 # GCN: V_INTERP_P1_F32
42 name: hazard_inlineasm
44 exposesReturnsTwice: false
46 regBankSelected: false
48 tracksRegLiveness: true
51 - { reg: '$sgpr7', virtual-reg: '' }
52 - { reg: '$vgpr4', virtual-reg: '' }
55 liveins: $sgpr7, $vgpr4
57 $m0 = S_MOV_B32 killed $sgpr7
58 INLINEASM &"; no-op", 1, 327690, def $vgpr5
59 $vgpr0 = V_INTERP_P1_F32 killed $vgpr4, 0, 0, implicit $mode, implicit $m0, implicit $exec
60 SI_RETURN_TO_EPILOG killed $vgpr5, killed $vgpr0
63 # IMPLICIT_DEF/DBG_VALUE instructions should not prevent the hazard recognizer
64 # from adding s_nop instructions between m0 update and s_sendmsg.
66 # GCN-LABEL: name: hazard-lookahead-implicit-def
67 # GCN: $vgpr6 = IMPLICIT_DEF
70 # GCN: S_SENDMSG 3, implicit $exec, implicit $m0
72 name: hazard-lookahead-implicit-def
75 $m0 = S_MOV_B32 killed $sgpr12
83 S_SENDMSG 3, implicit $exec, implicit $m0
87 # GCN-LABEL: name: hazard-lookahead-dbg-value
91 # GCN: S_SENDMSG 3, implicit $exec, implicit $m0
93 name: hazard-lookahead-dbg-value
96 $m0 = S_MOV_B32 killed $sgpr12
104 S_SENDMSG 3, implicit $exec, implicit $m0
108 # GCN-LABEL: name: hazard-lookahead-dbg-label
112 # GCN: S_SENDMSG 3, implicit $exec, implicit $m0
114 name: hazard-lookahead-dbg-label
117 $m0 = S_MOV_B32 killed $sgpr12
125 S_SENDMSG 3, implicit $exec, implicit $m0
128 # GCN-LABEL: name: hazard-lookahead-wave-barrier
131 # GCN-NEXT: V_ADD_F16_dpp
133 name: hazard-lookahead-wave-barrier
136 liveins: $vgpr0, $vgpr1, $vgpr3
138 renamable $vgpr1 = contract nofpexcept V_ADD_F16_e32 killed $vgpr1, $vgpr0, implicit $mode, implicit $exec
141 renamable $vgpr2 = contract nofpexcept V_ADD_F16_dpp undef $vgpr2, 0, $vgpr1, 0, $vgpr3, 273, 15, 15, 1, implicit $mode, implicit $exec
143 # GCN-LABEL: name: hazard-lookahead-masked-unreachable
144 # GCN: SI_MASKED_UNREACHABLE
146 # GCN-NEXT: S_SENDMSG
148 name: hazard-lookahead-masked-unreachable
152 SI_MASKED_UNREACHABLE
153 S_SENDMSG 3, implicit $exec, implicit $m0
158 # GCN-LABEL: name: fallthrough-hazard-lookahead-masked-unreachable
159 # GCN: SI_MASKED_UNREACHABLE
162 # GCN-NEXT: S_SENDMSG
164 name: fallthrough-hazard-lookahead-masked-unreachable
168 SI_MASKED_UNREACHABLE
171 S_SENDMSG 3, implicit $exec, implicit $m0
175 # GCN-LABEL: name: buffer_store_lds_dword
176 # GCN: $m0 = S_MOV_B32 0
178 # GCN-NEXT: BUFFER_STORE_LDS_DWORD
180 name: buffer_store_lds_dword
184 BUFFER_STORE_LDS_DWORD $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, implicit $exec, implicit $m0
187 # GCN-LABEL: name: lds_direct_read_m0
188 # GCN: $m0 = S_MOV_B32 0
190 # GCN-NEXT: V_MOV_B32
192 name: lds_direct_read_m0
196 $vgpr0 = V_MOV_B32_e32 $lds_direct, implicit $exec, implicit $m0