[Mlir-commits] [mlir] [mlir][acc] Add support for data clause modifiers (PR #144806)

Erich Keane llvmlistbot at llvm.org
Wed Jun 25 11:36:29 PDT 2025


================
@@ -321,6 +321,24 @@ static LogicalResult checkVarAndAccVar(Op op) {
   return success();
 }
 
+template <typename Op>
+static LogicalResult checkNoModifier(Op op) {
+  if (op.getModifiers() != acc::DataClauseModifier::none)
+    return op.emitError("no data clause modifiers are allowed");
+  return success();
+}
+
+template <typename Op>
+static LogicalResult
+checkValidModifier(Op op, acc::DataClauseModifier validModifiers) {
+  if (acc::bitEnumContainsAny(op.getModifiers(), ~validModifiers))
----------------
erichkeane wrote:

ONE thing I noticed, is that this doesn't check for anything but the list of modifiers.  We MIGHT want to check that no bits > the largest one are set.  Else we end up failing during printing if `op.getModifiers` is `1<<5`.

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


More information about the Mlir-commits mailing list