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

2025-05-08 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/137882 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-se

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

2025-05-08 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/137882 >From 080a9d43ba6544d46c2b36c5dc6a5af421264580 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Wed, 7 May 2025 12:17:30 -0700 Subject: [PATCH 1/2] [clang] Simplify device kernel attributes Signed-off-by: Sar

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

2025-05-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I honestly really like the approach. Those attributes really only differ by spelling and are almost semantically identical, so it makes a lot of sense to do it this way. So I'm happy. The accessors could be cleaned up, otherwise this is a LGTM. https

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

2025-05-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/137882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-05-08 Thread Erich Keane via cfe-commits
@@ -1538,11 +1533,44 @@ def CUDAShared : InheritableAttr { } def : MutualExclusions<[CUDAConstant, CUDAShared, HIPManaged]>; -def SYCLKernel : InheritableAttr { - let Spellings = [Clang<"sycl_kernel">]; - let Subjects = SubjectList<[FunctionTmpl]>; - let LangOpts = [SYCLDev

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

2025-05-08 Thread Aaron Ballman via cfe-commits
@@ -1538,11 +1533,44 @@ def CUDAShared : InheritableAttr { } def : MutualExclusions<[CUDAConstant, CUDAShared, HIPManaged]>; -def SYCLKernel : InheritableAttr { - let Spellings = [Clang<"sycl_kernel">]; - let Subjects = SubjectList<[FunctionTmpl]>; - let LangOpts = [SYCLDev

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

2025-05-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: CC @erichkeane and @jdoerfert for other opinions on the direction this is heading, but my initial thoughts are that this is not unreasonable. But I'd love to hear from others! https://github.com/llvm/llvm-project/pull/137882 __

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

2025-05-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/137882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-05-08 Thread Aaron Ballman via cfe-commits
@@ -1538,11 +1533,44 @@ def CUDAShared : InheritableAttr { } def : MutualExclusions<[CUDAConstant, CUDAShared, HIPManaged]>; -def SYCLKernel : InheritableAttr { - let Spellings = [Clang<"sycl_kernel">]; - let Subjects = SubjectList<[FunctionTmpl]>; - let LangOpts = [SYCLDev

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

2025-05-07 Thread Nick Sarnie via cfe-commits
sarnex wrote: @AaronBallman I just pushed a first attempt to combine the attrs, however I'm not sure if it's much cleaner given the attrs have different subjects/allowed cases/expected warnings/etc. Do you mind taking a first look and seeing if you think the general direction is a good idea? T

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

2025-05-07 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/137882 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-se

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

2025-05-01 Thread Nick Sarnie via cfe-commits
sarnex wrote: > 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

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

2025-05-01 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex converted_to_draft https://github.com/llvm/llvm-project/pull/137882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-05-01 Thread Aaron Ballman via cfe-commits
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 t

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

2025-05-01 Thread Nick Sarnie via cfe-commits
sarnex 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 lo

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

2025-05-01 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: 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 mu

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

2025-05-01 Thread Nick Sarnie via cfe-commits
@@ -1504,6 +1506,12 @@ def NVPTXKernel : InheritableAttr, TargetSpecificAttr { let Documentation = [Undocumented]; } +def SPIRKernel : InheritableAttr, TargetSpecificAttr { + let Spellings = [Clang<"spir_kernel">]; + let Subjects = SubjectList<[Function]>; + let Document

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

2025-05-01 Thread Erich Keane via cfe-commits
@@ -1504,6 +1506,12 @@ def NVPTXKernel : InheritableAttr, TargetSpecificAttr { let Documentation = [Undocumented]; } +def SPIRKernel : InheritableAttr, TargetSpecificAttr { + let Spellings = [Clang<"spir_kernel">]; + let Subjects = SubjectList<[Function]>; + let Document

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

2025-05-01 Thread Erich Keane via cfe-commits
@@ -5503,6 +5503,9 @@ bool Sema::CheckCallingConvAttr(const ParsedAttr &Attrs, CallingConv &CC, llvm::Log2_64(ABIVLen) - 5); break; } + case ParsedAttr::AT_SPIRKernel: erichkeane wrote: Perhaps a silly request, but ple

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

2025-05-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Nick Sarnie (sarnex) Changes SPIR kernels have a specific calling convention, so add an attribute to explicitly specify this calling convention when targetting pure SPIR/SPIRV. --- Full diff: https://github.com/llvm/llvm-project/pull/1378

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

2025-05-01 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex ready_for_review https://github.com/llvm/llvm-project/pull/137882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-30 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/137882 >From be91732b261f7a4874a9b1789fbf9bff6359cd58 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Wed, 30 Apr 2025 13:59:46 -0700 Subject: [PATCH] [clang] Add spir_kernel attribute Signed-off-by: Sarnie, Nick

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

2025-04-30 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/137882 >From 20498a3ab88fc60dfd425958c350e0d80f21951f Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Tue, 29 Apr 2025 14:40:43 -0700 Subject: [PATCH] [clang] Add spir_kernel attribute Signed-off-by: Sarnie, Nick

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

2025-04-30 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff HEAD~1 HEAD --extensions cpp,c,h -- clang/test/Misc/spir-kernel-attr.c clang/include/

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

2025-04-30 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/137882 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-se

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

2025-04-30 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/137882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-30 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/137882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-30 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/137882 >From 563660698c09d0e8b0d3e4d240d9a0ceae092493 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Tue, 29 Apr 2025 14:40:43 -0700 Subject: [PATCH] [clang] Add spir_kernel attribute Signed-off-by: Sarnie, Nick

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

2025-04-29 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex reopened https://github.com/llvm/llvm-project/pull/137882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-29 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex closed https://github.com/llvm/llvm-project/pull/137882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-29 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex created https://github.com/llvm/llvm-project/pull/137882 None >From 48a7768a33434e16c795ab8d575beb91480146f1 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Tue, 29 Apr 2025 14:40:43 -0700 Subject: [PATCH] [clang] Add spir_kernel attribute Signed-off-by: Sarnie,