Skip to content

Commit c894f90

Browse files
authored
AMDGPU: Do not assert on v6x16 buffer load intrinsics (#94966)
Just use the original type and let it hit a standard legalization error.
1 parent 11a944c commit c894f90

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ EVT AMDGPUTargetLowering::getEquivalentMemType(LLVMContext &Ctx, EVT VT) {
4242
if (StoreSize <= 32)
4343
return EVT::getIntegerVT(Ctx, StoreSize);
4444

45-
assert(StoreSize % 32 == 0 && "Store size not a multiple of 32");
46-
return EVT::getVectorVT(Ctx, MVT::i32, StoreSize / 32);
45+
if (StoreSize % 32 == 0)
46+
return EVT::getVectorVT(Ctx, MVT::i32, StoreSize / 32);
47+
48+
return VT;
4749
}
4850

4951
unsigned AMDGPUTargetLowering::numBitsUnsigned(SDValue Op, SelectionDAG &DAG) {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
; RUN: not --crash llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -filetype=null %s 2>&1 | FileCheck %s
2+
3+
; CHECK: LLVM ERROR: Do not know how to widen the result of this operator!
4+
5+
define <6 x bfloat> @raw_ptr_buffer_load_v6bf16(ptr addrspace(8) inreg %rsrc) {
6+
%val = call <6 x bfloat> @llvm.amdgcn.raw.ptr.buffer.load.v6bf16(ptr addrspace(8) %rsrc, i32 0, i32 0, i32 0)
7+
ret <6 x bfloat> %val
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
; RUN: not --crash llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -filetype=null %s 2>&1 | FileCheck %s
2+
3+
; FIXME: This should be handled
4+
5+
; CHECK: LLVM ERROR: Do not know how to widen this operator's operand!
6+
7+
8+
define void @buffer_store_v6bf16(ptr addrspace(8) inreg %rsrc, <6 x bfloat> %data, i32 %offset) {
9+
call void @llvm.amdgcn.raw.ptr.buffer.store.v6bf16(<6 x bfloat> %data, ptr addrspace(8) %rsrc, i32 %offset, i32 0, i32 0)
10+
ret void
11+
}

0 commit comments

Comments
 (0)