[Mlir-commits] [mlir] [MLIR][IRDL][Python] Fix error while composing `irdl.any_of` and `irdl.base` (PR #187914)

Théo Degioanni llvmlistbot at llvm.org
Thu Mar 26 00:06:50 PDT 2026


================
@@ -736,3 +736,44 @@ class AssignNoneOnNonOptionalOp(
     except ValueError as e:
         # CHECK: only optional operand can be a keyword parameter
         print(e)
+
+
+# CHECK: TEST: testExtDialectWithAttrInOp
+ at run
+def testExtDialectWithAttrInOp():
+    class TestAttrInOp(Dialect, name="ext_attr_in_op"):
+        pass
+
+    class OpWithAttr(TestAttrInOp.Operation, name="op_with_attr"):
+        a: IntegerAttr | StringAttr
+        b: IntegerType[32] | IntegerType[64]
----------------
Moxinilian wrote:

I think we agreed in the first place. What I meant is that the concept of types and attributes is materialised separately in the MLIR API, but that separation serves no purpose other than being an implementation detail of the MLIR API and is strictly equivalent to no separation (provided correct insertion of TypeAttr). It is thus not represented in IRDL for the sake of simplicity.

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


More information about the Mlir-commits mailing list