================ @@ -8069,6 +8069,25 @@ static void handleAMDGPUNumVGPRAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) AMDGPUNumVGPRAttr(S.Context, AL, NumVGPR)); } +static void handleAMDGPUNumWorkGroupsAttr(Sema &S, Decl *D, + const ParsedAttr &AL) { + uint32_t NumWGX = 0; + uint32_t NumWGY = 0; + uint32_t NumWGZ = 0; + Expr *NumWGXExpr = AL.getArgAsExpr(0); + Expr *NumWGYExpr = AL.getArgAsExpr(1); + Expr *NumWGZExpr = AL.getArgAsExpr(2); + if (!checkUInt32Argument(S, AL, NumWGXExpr, NumWGX)) + return; + if (!checkUInt32Argument(S, AL, NumWGYExpr, NumWGY)) + return; + if (!checkUInt32Argument(S, AL, NumWGZExpr, NumWGZ)) + return; + + D->addAttr(::new (S.Context) AMDGPUNumWorkGroupsAttr(S.Context, AL, NumWGX, ---------------- erichkeane wrote:
Based on the above, if any of these are zero, this attribute has no effect. We should diagnose based on the value of X, Y, and Z, then only create it in the AST if it has an effect. https://github.com/llvm/llvm-project/pull/79035 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits