[Mlir-commits] [mlir] d0fbfa6 - [mlir] Explain required attrs for CallOpInterface in Toy (NFC) (#141018)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu May 22 02:54:48 PDT 2025


Author: Joshua James Venter
Date: 2025-05-22T11:54:45+02:00
New Revision: d0fbfa6d9771b13e32ed4c64f34150c2364543c2

URL: https://github.com/llvm/llvm-project/commit/d0fbfa6d9771b13e32ed4c64f34150c2364543c2
DIFF: https://github.com/llvm/llvm-project/commit/d0fbfa6d9771b13e32ed4c64f34150c2364543c2.diff

LOG: [mlir] Explain required attrs for CallOpInterface in Toy (NFC) (#141018)

Following #123176.

Signed-off-by: Joshua James Venter <venter.joshua at gmail.com>

Added: 
    

Modified: 
    mlir/docs/Tutorials/Toy/Ch-4.md

Removed: 
    


################################################################################
diff  --git a/mlir/docs/Tutorials/Toy/Ch-4.md b/mlir/docs/Tutorials/Toy/Ch-4.md
index 39e9ecdd92221..1275d36de3531 100644
--- a/mlir/docs/Tutorials/Toy/Ch-4.md
+++ b/mlir/docs/Tutorials/Toy/Ch-4.md
@@ -159,7 +159,20 @@ def GenericCallOp : Toy_Op<"generic_call",
 
 In the above we also use the `DeclareOpInterfaceMethods` directive to
 auto-declare all of the interface methods in the class declaration of
-GenericCallOp. We have already provided the definition in the `extraClassDeclaration`
+`GenericCallOp`. However, using this directive with `CallOpInterface`
+includes methods for handling argument and result attributes. Therefore,
+we need to add these specifically named attributes to our `GenericCallOp`
+definition:
+
+```tablegen
+let arguments = (ins
+  ...
+  OptionalAttr<DictArrayAttr>:$arg_attrs,
+  OptionalAttr<DictArrayAttr>:$res_attrs
+);
+
+
+We have already provided the definition in the `extraClassDeclaration`
 field of the `FuncOp` class:
 
 ```c++


        


More information about the Mlir-commits mailing list