JonChesterfield added a comment.

Calling convention is the right model here. Kernels are functions with a 
different calling convention to the 'normal' functions in a very literal sense. 
The calling convention modelling in clang is different to attribute handling 
and changing nvptx to it is probably invasive, though it seems to me it could 
be done incrementally.

I wouldn't suggest adding a nvptx_kernel calling convention to clang though, 
rather we could repurpose the amdgpu one to be gpu_kernel. Possibly spelled 
nvptx_kernel for the user but represented within clang as gpu_kernel.

Related, I think there's a spirv or opencl kernel representation in llvm for 
amdgpu, I would be interested in collapsing those and the openmp or hip 
annotation to a single thing if possible.

That's all medium term cleanup ideas, current patch looks good to me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140226/new/

https://reviews.llvm.org/D140226

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to