Skip to content

Commit bd49a51

Browse files
committed
Add AMDGPU_kernel calling convention to detected kernels
1 parent 2517606 commit bd49a51

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

llvm/lib/SYCLLowerIR/ModuleSplitter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ bool isGenericBuiltin(StringRef FName) {
113113
}
114114

115115
bool isKernel(const Function &F) {
116-
return F.getCallingConv() == CallingConv::SPIR_KERNEL;
116+
return F.getCallingConv() == CallingConv::SPIR_KERNEL ||
117+
F.getCallingConv() == CallingConv::AMDGPU_KERNEL;
117118
}
118119

119120
bool isEntryPoint(const Function &F, bool EmitOnlyKernelsAsEntryPoints) {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; -- Per-kernel split
2+
; RUN: sycl-post-link -split=kernel -emit-only-kernels-as-entry-points -S < %s -o %tC.table
3+
; RUN: FileCheck %s -input-file=%tC_0.ll --check-prefixes CHECK-A0
4+
; RUN: FileCheck %s -input-file=%tC_1.ll --check-prefixes CHECK-A1
5+
6+
define dso_local amdgpu_kernel void @Kernel1() {
7+
ret void
8+
}
9+
10+
define dso_local amdgpu_kernel void @Kernel2() {
11+
ret void
12+
}
13+
14+
; CHECK-A0: define dso_local amdgpu_kernel void @Kernel2()
15+
; CHECK-A0-NOT: define dso_local amdgpu_kernel void @Kernel1()
16+
; CHECK-A1-NOT: define dso_local amdgpu_kernel void @Kernel2()
17+
; CHECK-A1: define dso_local amdgpu_kernel void @Kernel1()

0 commit comments

Comments
 (0)