[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

Erich Keane via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 07:09:02 PST 2024


================
@@ -2031,6 +2031,13 @@ def AMDGPUNumVGPR : InheritableAttr {
   let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">;
 }
 
+def AMDGPUNumWorkGroups : InheritableAttr {
+  let Spellings = [Clang<"amdgpu_num_work_groups", 0>];
+  let Args = [UnsignedArgument<"NumWorkGroupsX">, UnsignedArgument<"NumWorkGroupsY">, UnsignedArgument<"NumWorkGroupsZ">];
----------------
erichkeane wrote:

`UnsignedArgument` doesn't allow dependent values.  Is this something we're OK with?  Typically we'd want to support some level of template support, which means you have to store as expressions and convert when needed (then TreeTransform it properly).

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


More information about the llvm-commits mailing list