================
@@ -229,6 +229,12 @@ class CodeGenTypes {
   const CGFunctionInfo &arrangeBuiltinFunctionCall(QualType resultType,
                                                    const CallArgList &args);
 
+  /// A SYCL device kernel function is a free standing function with
+  /// spir_kernel calling convention
----------------
bader wrote:

```suggestion
  /// target specific calling convention (e.g. spir_kernel for the SPIR target).
```
Technically we use OpenCL language calling convention, but I'm not sure if we 
should specify that in the comments. Typically, each offload target has its own 
calling convention. For example, OpenCL compiler emits `amdgpu_kernel` calling 
convention for AMD GPU targets and `ptx_kernel` for NVIDIA GPU targets.

NOTE: Setting calling convention might be not enough for decorating kernel 
functions properly. E.g. NVPTX target uses named metadata to identify kernel 
functions. 
https://docs.nvidia.com/cuda/nvvm-ir-spec/index.html#representation-of-properties
I suppose this means that SYCL compiler for NVPTX target must emit named 
metadata referring to the kernel in addition to using `ptx_kernel` calling 
convention.
Some SPIR tools consuming LLVM IR doesn't require additional metadata, so 
setting calling convention is enough. I don't know how NVPTX backend will 
handle LLVM w/o the metadata.
@npmiller, FYI. 

https://github.com/llvm/llvm-project/pull/133030
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to