Skip to content

Commit 4be4b82

Browse files
authored
AMDGPU: Use reportFatalUsageError for unhandled calling conventions (#145261)
Should switch this to DiagnosticInfo and use the default calling convention, but that would require passing in the context.
1 parent 3892096 commit 4be4b82

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ CCAssignFn *AMDGPUCallLowering::CCAssignFnForCall(CallingConv::ID CC,
11421142
case CallingConv::AMDGPU_KERNEL:
11431143
case CallingConv::SPIR_KERNEL:
11441144
default:
1145-
report_fatal_error("Unsupported calling convention for call");
1145+
reportFatalUsageError("unsupported calling convention for call");
11461146
}
11471147
}
11481148

@@ -1169,7 +1169,7 @@ CCAssignFn *AMDGPUCallLowering::CCAssignFnForReturn(CallingConv::ID CC,
11691169
case CallingConv::Cold:
11701170
return RetCC_AMDGPU_Func;
11711171
default:
1172-
report_fatal_error("Unsupported calling convention.");
1172+
reportFatalUsageError("unsupported calling convention");
11731173
}
11741174
}
11751175

llvm/lib/Target/AMDGPU/R600ISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ CCAssignFn *R600TargetLowering::CCAssignFnForCall(CallingConv::ID CC,
14481448
case CallingConv::AMDGPU_LS:
14491449
return CC_R600;
14501450
default:
1451-
report_fatal_error("Unsupported calling convention.");
1451+
reportFatalUsageError("unsupported calling convention");
14521452
}
14531453
}
14541454

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -filetype=null %s 2>&1 | FileCheck %s
2+
3+
; CHECK: LLVM ERROR: unsupported calling convention
4+
define void @caller(ptr %func) {
5+
call aarch64_sve_vector_pcs void %func()
6+
ret void
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -filetype=null %s 2>&1 | FileCheck %s
2+
3+
; CHECK: LLVM ERROR: unsupported calling convention
4+
define aarch64_sve_vector_pcs void @func() {
5+
ret void
6+
}

0 commit comments

Comments
 (0)