[clang] [clang] Fix inconsistencies with the device_kernel attr on different targets (PR #161905)
Nick Sarnie via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 6 07:26:08 PDT 2025
================
@@ -277,6 +296,14 @@ void SPIRVTargetCodeGenInfo::setTargetAttributes(
auto FD = dyn_cast_or_null<FunctionDecl>(D);
if (!FD)
return;
+
+ if (FD->hasAttr<DeviceKernelAttr>())
+ F->setCallingConv(llvm::CallingConv::SPIR_KERNEL);
----------------
sarnex wrote:
Not sure if I understand the question but there is no SYCL-specific calling convention, [ex1](https://github.com/llvm/llvm-project/blob/c6a4e84a10ae8b163c9cae3f9a49eb8077a499ff/clang/include/clang/Basic/Specifiers.h#L291), [ex2](https://github.com/llvm/llvm-project/blob/c6a4e84a10ae8b163c9cae3f9a49eb8077a499ff/llvm/include/llvm/IR/CallingConv.h#L144). There is another alias (aka spelling) of the clang attribute but we have no need to check which specific spelling it's using here.
https://github.com/llvm/llvm-project/pull/161905
More information about the cfe-commits
mailing list