[clang] [AMDGPU] Add sema check for global_atomic_fadd_v2f16 builtin (PR #158145)
Tim Gu via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 12 09:35:25 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
----------------
tcgu-amd wrote:
There doesn't seem to be a "expect vector" message so I resorted to this. What do you suggest I use instead? Thanks!
https://github.com/llvm/llvm-project/pull/158145
More information about the cfe-commits
mailing list