[Mlir-commits] [mlir] [MLIR][NVVM] Add clusterlaunchcontrol Ops (PR #156585)

Durgadoss R llvmlistbot at llvm.org
Tue Sep 9 04:26:50 PDT 2025


================
@@ -2088,6 +2106,49 @@ bool NVVM::InlinePtxOp::getAsmValues(
   return false; // No manual mapping needed
 }
 
+NVVM::IDArgPair ClusterLaunchControlTryCancelOp::getIntrinsicIDAndArgs(
+    Operation &op, LLVM::ModuleTranslation &mt, llvm::IRBuilderBase &builder) {
+  auto curOp = cast<NVVM::ClusterLaunchControlTryCancelOp>(op);
+  llvm::SmallVector<llvm::Value *> args;
+  args.push_back(mt.lookupValue(curOp.getSmemAddress()));
+  args.push_back(mt.lookupValue(curOp.getMbarrier()));
+
+  return curOp.getMulticast()
+             ? NVVM::IDArgPair(
+                   {llvm::Intrinsic::
+                        nvvm_clusterlaunchcontrol_try_cancel_async_multicast_shared,
+                    args})
+             : NVVM::IDArgPair(
+                   {llvm::Intrinsic::
+                        nvvm_clusterlaunchcontrol_try_cancel_async_shared,
+                    args});
+}
+
+NVVM::IDArgPair ClusterLaunchControlQueryCancelOp::getIntrinsicIDAndArgs(
+    Operation &op, LLVM::ModuleTranslation &mt, llvm::IRBuilderBase &builder) {
+  auto curOp = cast<NVVM::ClusterLaunchControlQueryCancelOp>(op);
+  llvm::SmallVector<llvm::Value *> args;
+  args.push_back(mt.lookupValue(curOp.getTryCancelResponse()));
+
+  switch (curOp.getQueryType()) {
+  case NVVM::ClusterLaunchControlQueryType::IS_CANCELED:
+    return {llvm::Intrinsic::nvvm_clusterlaunchcontrol_query_cancel_is_canceled,
+            args};
+  case NVVM::ClusterLaunchControlQueryType::GET_FIRST_CTA_ID_X:
+    return {llvm::Intrinsic::
+                nvvm_clusterlaunchcontrol_query_cancel_get_first_ctaid_x,
+            args};
+  case NVVM::ClusterLaunchControlQueryType::GET_FIRST_CTA_ID_Y:
+    return {llvm::Intrinsic::
+                nvvm_clusterlaunchcontrol_query_cancel_get_first_ctaid_y,
+            args};
+  case NVVM::ClusterLaunchControlQueryType::GET_FIRST_CTA_ID_Z:
+    return {llvm::Intrinsic::
+                nvvm_clusterlaunchcontrol_query_cancel_get_first_ctaid_z,
+            args};
----------------
durga4github wrote:

Same here for these too..

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


More information about the Mlir-commits mailing list