[Mlir-commits] [mlir] [mlir][affine] Fix crash in AffineParallelLowering for unsupported reductions (PR #186189)

Jakub Kuderski llvmlistbot at llvm.org
Thu Mar 12 11:55:49 PDT 2026


================
@@ -2801,6 +2801,8 @@ Value mlir::arith::getIdentityValue(AtomicRMWKind op, Type resultType,
                                     bool useOnlyFiniteValue) {
   auto attr =
       getIdentityValueAttr(op, resultType, builder, loc, useOnlyFiniteValue);
+  if (!attr)
+    return {};
   return arith::ConstantOp::create(builder, loc, attr);
----------------
kuhar wrote:

nit/optional:
```suggestion
  if (auto attr =
getIdentityValueAttr(op, resultType, builder, loc, useOnlyFiniteValue))
    return arith::ConstantOp::create(builder, loc, attr);
  return {};
```

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


More information about the Mlir-commits mailing list