[clang] [llvm] [AMDGPU] Add per-kernel kernarg preload count (PR #211059)
Aaron Ballman via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 22 08:49:05 PDT 2026
================
@@ -2525,6 +2525,13 @@ def AMDGPUNumVGPR : InheritableAttr {
let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">;
}
+def AMDGPUKernargPreloadCount : InheritableAttr {
+ let Spellings = [Clang<"amdgpu_kernarg_preload_count", 0>];
----------------
AaronBallman wrote:
These comments apply to other amdgpu attributes, so maybe worth addressing in a follow-up.
This means `__attribute__((amdgpu_kernarg_preload_count))` works in both C and C++, but `[[clang::amdgpu_kernarg_preload_count]]` only works in C++ and not C; is there a reason for that? (If the goal is to expose in C++ only, you can set the `LangOpts` for the attribute to do that. e.g., `let LangOpts = [CPlusPlus];`)
Also, should these be limited to just amdgpu targets or do these attributes do something outside of amd gpus? (I would have expected an "attribute ignored" diagnostic in cases where the attribute has no effect.)
https://github.com/llvm/llvm-project/pull/211059
More information about the llvm-commits
mailing list