================ @@ -5662,22 +5677,39 @@ Sema::CreateLaunchBoundsAttr(const AttributeCommonInfo &CI, Expr *MaxThreads, return nullptr; } + if (MaxBlocks) { + // Feature '.maxclusterrank' requires .target sm_90 or higher. + auto SM = getCudaArch(Context.getTargetInfo()); + if (SM == CudaArch::UNKNOWN || SM < CudaArch::SM_90) { + Diag(MaxBlocks->getBeginLoc(), diag::warn_cuda_maxclusterrank_sm_90) + << CudaArchToString(SM) << CI << MaxBlocks->getSourceRange(); + // Ignore it by setting MaxBlocks to null; + MaxBlocks = nullptr; + } else { + MaxBlocks = makeLaunchBoundsArgExpr(*this, MaxBlocks, TmpAttr, 2); + if (MaxBlocks == nullptr) ---------------- ldrumm wrote:
```suggestion if (!MaxBlocks) ``` https://github.com/llvm/llvm-project/pull/66496 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits