================
@@ -1079,4 +1079,107 @@ bool DiagnoseUnguardedBuiltins::VisitCallExpr(CallExpr 
*CE) {
 void SemaAMDGPU::DiagnoseUnguardedBuiltinUsage(FunctionDecl *FD) {
   DiagnoseUnguardedBuiltins(SemaRef).IssueDiagnostics(FD->getBody());
 }
+
+bool SemaAMDGPU::checkAMDGPUTypeSupport(QualType Ty, SourceLocation Loc) {
+  ASTContext &Ctx = getASTContext();
+  llvm::Triple TT = Ctx.getTargetInfo().getTriple();
+  const Type *BaseTy = Ty->getPointeeOrArrayElementType();
+
+  if (Ctx.getTargetInfo().getTriple().isSPIRV()) {
+    // The AMDGPU named barrier type requires special handling in the back-end
+    // and is not supported for SPIR-V
+    if (BaseTy->isAMDGPUNamedBarrierType()) {
----------------
yxsamliu wrote:

Could this also reject named barrier wrappers? The raw type is diagnosed now, 
but CodeGen treats wrappers the same way via 
`isAMDGPUNamedBarrierTypeOrWrapper()`. A wrapper global on `spirv64-amd-amdhsa` 
could still reach the unsupported SPIR-V lowering path.

https://github.com/llvm/llvm-project/pull/207687
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to