Skip to content

AMDGPU: Avoid report_fatal_error for unsupported ds_ordered_count #145172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10101,8 +10101,12 @@ unsigned SIInstrInfo::getDSShaderTypeValue(const MachineFunction &MF) {
return 3;
case CallingConv::AMDGPU_HS:
case CallingConv::AMDGPU_LS:
case CallingConv::AMDGPU_ES:
report_fatal_error("ds_ordered_count unsupported for this calling conv");
case CallingConv::AMDGPU_ES: {
const Function &F = MF.getFunction();
F.getContext().diagnose(DiagnosticInfoUnsupported(
F, "ds_ordered_count unsupported for this calling conv"));
[[fallthrough]];
}
case CallingConv::AMDGPU_CS:
case CallingConv::AMDGPU_KERNEL:
case CallingConv::C:
Expand Down
22 changes: 22 additions & 0 deletions llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.ordered.add-unsupported.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
; RUN: not llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx900 -filetype=null 2>&1 %s | FileCheck %s

; CHECK: error: <unknown>:0:0: in function ds_ordered_add_amdgpu_hs void (ptr addrspace(2), ptr addrspace(1)): ds_ordered_count unsupported for this calling conv
define amdgpu_hs void @ds_ordered_add_amdgpu_hs(ptr addrspace(2) inreg %gds, ptr addrspace(1) %out) {
%val = call i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 true, i1 true)
store i32 %val, ptr addrspace(1) %out
ret void
}

; CHECK: error: <unknown>:0:0: in function ds_ordered_add_amdgpu_ls void (ptr addrspace(2), ptr addrspace(1)): ds_ordered_count unsupported for this calling conv
define amdgpu_ls void @ds_ordered_add_amdgpu_ls(ptr addrspace(2) inreg %gds, ptr addrspace(1) %out) {
%val = call i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 true, i1 true)
store i32 %val, ptr addrspace(1) %out
ret void
}

; CHECK: error: <unknown>:0:0: in function ds_ordered_add_amdgpu_es void (ptr addrspace(2), ptr addrspace(1)): ds_ordered_count unsupported for this calling conv
define amdgpu_es void @ds_ordered_add_amdgpu_es(ptr addrspace(2) inreg %gds, ptr addrspace(1) %out) {
%val = call i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 true, i1 true)
store i32 %val, ptr addrspace(1) %out
ret void
}
Loading