Skip to content

Commit 2b8923f

Browse files
committed
[Review] Fail to select buffer_load_lds on targets where it is not supported
1 parent 88932f8 commit 2b8923f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3368,7 +3368,8 @@ bool AMDGPUInstructionSelector::selectG_INSERT_VECTOR_ELT(
33683368
}
33693369

33703370
bool AMDGPUInstructionSelector::selectBufferLoadLds(MachineInstr &MI) const {
3371-
assert(Subtarget->hasLDSBufferLoad());
3371+
if (!Subtarget->hasLDSBufferLoad())
3372+
return false;
33723373
unsigned Opc;
33733374
unsigned Size = MI.getOperand(3).getImm();
33743375

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10102,7 +10102,8 @@ SDValue SITargetLowering::LowerINTRINSIC_VOID(SDValue Op,
1010210102
case Intrinsic::amdgcn_raw_ptr_buffer_load_lds:
1010310103
case Intrinsic::amdgcn_struct_buffer_load_lds:
1010410104
case Intrinsic::amdgcn_struct_ptr_buffer_load_lds: {
10105-
assert(Subtarget->hasLDSBufferLoad());
10105+
if (!Subtarget->hasLDSBufferLoad())
10106+
return SDValue();
1010610107
unsigned Opc;
1010710108
bool HasVIndex =
1010810109
IntrinsicID == Intrinsic::amdgcn_struct_buffer_load_lds ||

0 commit comments

Comments
 (0)