[clang] [clang] Fallback to C calling convention for sycl_kernel attribute (PR #161349)

Mariya Podchishchaeva via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 30 04:31:22 PDT 2025


================
@@ -123,8 +123,9 @@ unsigned TargetCodeGenInfo::getDeviceKernelCallingConv() const {
     // conventions; different targets might split structs passed as values
     // to multiple function arguments etc.
     return llvm::CallingConv::SPIR_KERNEL;
+  } else {
+    return llvm::CallingConv::C;
----------------
Fznamznon wrote:

I'm not sure this is entirely right solution.
IMO we should probably ignore sycl_kernel attribute if the target is not offloading target, similar to amggpu_kernel attribute. However it maybe not worth doing if sycl_kernel attribute is going to be removed in favor of `clang::sycl_entry_point` attribute which BTW has the same crashing problem. cc @tahonermann 

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


More information about the cfe-commits mailing list