[Mlir-commits] [mlir] [MLIR][MemRef] Add verifier check for index count vs memref rank in generic_atomic_rmw (PR #189229)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Wed Apr 1 01:54:06 PDT 2026


================
@@ -1593,6 +1593,12 @@ LogicalResult GenericAtomicRMWOp::verify() {
   if (getResult().getType() != body.getArgument(0).getType())
     return emitOpError("expected block argument of the same type result type");
 
+  auto memrefType = cast<MemRefType>(getMemref().getType());
+  if (getIndices().size() != static_cast<size_t>(memrefType.getRank()))
----------------
ftynse wrote:

Didn't double-check, let's ensure the op is already constrained to only accept ranked memrefs.

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


More information about the Mlir-commits mailing list