Skip to content

Commit c7cbd39

Browse files
author
git apple-llvm automerger
committed
Merge commit '0e8590f06599' from llvm.org/main into next
2 parents 2fcd216 + 0e8590f commit c7cbd39

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,19 @@ enum VmemType {
150150
VMEM_NOSAMPLER,
151151
// MIMG instructions with a sampler.
152152
VMEM_SAMPLER,
153+
// BVH instructions
154+
VMEM_BVH
153155
};
154156

155157
VmemType getVmemType(const MachineInstr &Inst) {
156158
assert(SIInstrInfo::isVMEM(Inst));
157159
if (!SIInstrInfo::isMIMG(Inst))
158160
return VMEM_NOSAMPLER;
159161
const AMDGPU::MIMGInfo *Info = AMDGPU::getMIMGInfo(Inst.getOpcode());
160-
return AMDGPU::getMIMGBaseOpcodeInfo(Info->BaseOpcode)->Sampler
161-
? VMEM_SAMPLER
162-
: VMEM_NOSAMPLER;
162+
const AMDGPU::MIMGBaseOpcodeInfo *BaseInfo =
163+
AMDGPU::getMIMGBaseOpcodeInfo(Info->BaseOpcode);
164+
return BaseInfo->BVH ? VMEM_BVH
165+
: BaseInfo->Sampler ? VMEM_SAMPLER : VMEM_NOSAMPLER;
163166
}
164167

165168
void addWait(AMDGPU::Waitcnt &Wait, InstCounterType T, unsigned Count) {

llvm/test/CodeGen/AMDGPU/waitcnt-bvh.mir

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ body: |
2323
; GCN: S_WAITCNT 0
2424
; GCN-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
2525
; GCN-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = IMAGE_BVH_INTERSECT_RAY_sa_gfx10 killed $vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15_vgpr16_vgpr17_vgpr18_vgpr19, renamable $sgpr0_sgpr1_sgpr2_sgpr3, implicit $exec :: (dereferenceable load (s128) from custom "ImageResource")
26+
; GCN-NEXT: S_WAITCNT 16240
2627
; GCN-NEXT: $vgpr0 = BUFFER_LOAD_DWORD_OFFEN $vgpr16, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec
2728
; GCN-NEXT: S_ENDPGM 0
2829
$vgpr0_vgpr1_vgpr2_vgpr3 = IMAGE_BVH_INTERSECT_RAY_sa_gfx10 killed $vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15_vgpr16_vgpr17_vgpr18_vgpr19, renamable $sgpr0_sgpr1_sgpr2_sgpr3, implicit $exec :: (dereferenceable load (s128) from custom "ImageResource")
@@ -52,6 +53,7 @@ body: |
5253
; GCN: S_WAITCNT 0
5354
; GCN-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
5455
; GCN-NEXT: $vgpr0 = BUFFER_LOAD_DWORD_OFFEN $vgpr20, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec
56+
; GCN-NEXT: S_WAITCNT 16240
5557
; GCN-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = IMAGE_BVH_INTERSECT_RAY_sa_gfx10 killed $vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15_vgpr16_vgpr17_vgpr18_vgpr19, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, implicit $exec :: (dereferenceable load (s128) from custom "ImageResource")
5658
; GCN-NEXT: S_ENDPGM 0
5759
$vgpr0 = BUFFER_LOAD_DWORD_OFFEN $vgpr20, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, implicit $exec

0 commit comments

Comments
 (0)