[clang] [clang] Fix inconsistencies with the device_kernel attr on different targets (PR #161905)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 3 14:51:34 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);
----------------
jhuber6 wrote:

Isn't the attribute called `sycl_kernel`? I thought that was a little strange since the others use the architecture name, not the language.

https://github.com/llvm/llvm-project/pull/161905


More information about the cfe-commits mailing list