[clang] [NVPTX] Add support for maxclusterrank in launch_bounds (PR #66496)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 21 03:42:22 PDT 2023


================
@@ -307,6 +307,14 @@ void CodeGenModule::handleCUDALaunchBoundsAttr(
       NVPTXTargetCodeGenInfo::addNVVMMetadata(F, "minctasm",
                                               MinBlocks.getExtValue());
   }
+  if (Attr->getMaxBlocks()) {
+    llvm::APSInt MaxBlocks(32);
+    MaxBlocks = Attr->getMaxBlocks()->EvaluateKnownConstInt(getContext());
+    if (MaxBlocks > 0)
+      // Create !{<func-ref>, metadata !"maxclusterrank", i32 <val>} node
+      NVPTXTargetCodeGenInfo::addNVVMMetadata(F, "maxclusterrank",
----------------
ldrumm wrote:

Do we have enough information to assert this is non-negative?

https://github.com/llvm/llvm-project/pull/66496


More information about the cfe-commits mailing list