[clang] [AMDGPU] Add sema check for global_atomic_fadd_v2f16 builtin (PR #158145)
Matt Arsenault via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 11 23:49:47 PDT 2025
================
@@ -436,4 +440,32 @@ void SemaAMDGPU::handleAMDGPUMaxNumWorkGroupsAttr(Decl *D,
addAMDGPUMaxNumWorkGroupsAttr(D, AL, AL.getArgAsExpr(0), YExpr, ZExpr);
}
+
+bool SemaAMDGPU::checkAMDGCNAtomicFaddV2F16Type(CallExpr *TheCall) {
+ // Check that the pointer argument is a pointer to v2f16
+
+ Expr *Arg = TheCall->getArg(1);
+ QualType ArgType = Arg->getType();
+
+ // Check if it's a vector type
+ if (!ArgType->isVectorType()) {
+ Diag(Arg->getBeginLoc(), diag::err_typecheck_call_different_arg_types)
+ << "expected _Float16 vector of length 2" << ArgType
----------------
arsenm wrote:
This shouldn't require a custom message
https://github.com/llvm/llvm-project/pull/158145
More information about the cfe-commits
mailing list