[Mlir-commits] [mlir] [MLIR][NVVM] Update redux.sync op (PR #166125)

Durgadoss R llvmlistbot at llvm.org
Mon Nov 3 01:46:57 PST 2025


================
@@ -1577,6 +1563,32 @@ LogicalResult NVVM::ClusterLaunchControlQueryCancelOp::verify() {
   return success();
 }
 
+LogicalResult NVVM::ReduxOp::verify() {
+  mlir::Type reduxType = getType();
+
+  if (!reduxType.isF32() && getAbs())
+    return emitOpError("abs attribute is supported only for f32 type");
+
+  if (!reduxType.isF32() && getNan())
+    return emitOpError("nan attribute is supported only for f32 type");
+
+  NVVM::ReduxKind kind = getKind();
+  switch (kind) {
+  case NVVM::ReduxKind::FMIN:
+  case NVVM::ReduxKind::FMAX:
+    if (!reduxType.isF32())
+      return emitOpError("fmin and fmax redux kind must be used with f32 type");
+    break;
----------------
durga4github wrote:

May be this can also be moved above, within the `if (!f32)` check.

Let us try and see if that looks better

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


More information about the Mlir-commits mailing list