[clang] [llvm] [clang] Add spir_kernel attribute (PR #137882)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu May 1 08:21:34 PDT 2025


AaronBallman wrote:

> > Do we need yet another calling convention or is there a way we can start to combine some of these for all the offloading languages? It seems we keep re-implementing the same concepts multiple times for each language and it would be nice to share as much of the frontend logic as possible rather than keep doing this dance of adding another case to every switch in the compiler. :-D
> 
> Do you have an idea? Maybe we could have a `calling_convention` attribute that takes in a string that specifies the calling convention?

I was thinking that orthogonal calling conventions could be combined so that we need fewer of them. e.g., if spir_kernel cannot be mixed with nvptx_kernel in the same TU, then there's no need for two distinct internal representations for the attributes, just two distinct spellings that are based on the target.

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


More information about the cfe-commits mailing list