Skip to content

Commit ad715be

Browse files
authored
[AMDGPU] Remove HasSampler variable. NFC. (#146682)
Putting the complex condition in a variable does not help readability. It is simpler to use separate `if`s.
1 parent 5a8d096 commit ad715be

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,17 @@ VmemType getVmemType(const MachineInstr &Inst) {
202202
const AMDGPU::MIMGInfo *Info = AMDGPU::getMIMGInfo(Inst.getOpcode());
203203
const AMDGPU::MIMGBaseOpcodeInfo *BaseInfo =
204204
AMDGPU::getMIMGBaseOpcodeInfo(Info->BaseOpcode);
205+
206+
if (BaseInfo->BVH)
207+
return VMEM_BVH;
208+
205209
// We have to make an additional check for isVSAMPLE here since some
206210
// instructions don't have a sampler, but are still classified as sampler
207211
// instructions for the purposes of e.g. waitcnt.
208-
bool HasSampler =
209-
BaseInfo->Sampler || BaseInfo->MSAA || SIInstrInfo::isVSAMPLE(Inst);
210-
return BaseInfo->BVH ? VMEM_BVH : HasSampler ? VMEM_SAMPLER : VMEM_NOSAMPLER;
212+
if (BaseInfo->Sampler || BaseInfo->MSAA || SIInstrInfo::isVSAMPLE(Inst))
213+
return VMEM_SAMPLER;
214+
215+
return VMEM_NOSAMPLER;
211216
}
212217

213218
unsigned &getCounterRef(AMDGPU::Waitcnt &Wait, InstCounterType T) {

0 commit comments

Comments
 (0)