[Mlir-commits] [mlir] [mlir][acc] Add GPU workgroup memory operation for planning (PR #205972)

Valentin Clement バレンタイン クレメン llvmlistbot at llvm.org
Fri Jun 26 11:49:13 PDT 2026


================
@@ -792,6 +792,34 @@ ParseResult ComputeRegionOp::parse(OpAsmParser &parser,
   return success();
 }
 
+//===----------------------------------------------------------------------===//
+// GPUSharedMemoryOp
+//===----------------------------------------------------------------------===//
+
+LogicalResult GPUSharedMemoryOp::verify() {
+  if (getNumCopies() <= 0)
+    return emitOpError("num_copies must be positive");
+  if (getStaticUpperBoundBytes() <= 0)
+    return emitOpError("static_upper_bound_bytes must be positive");
+
+  bool hasScaling = static_cast<bool>(getDynamicSharedMemoryScalingBytes());
+  bool hasFixed = static_cast<bool>(getDynamicSharedMemoryFixedBytes());
+  if (hasScaling != hasFixed)
+    return emitOpError(
+        "dynamic_shared_memory_scaling_bytes and "
+        "dynamic_shared_memory_fixed_bytes must both be present or both be "
+        "absent");
+
----------------
clementval wrote:

Maybe adding a check for the optional attribute to be positive integer since they are i64. 

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


More information about the Mlir-commits mailing list