Skip to content

Commit d0fbfa6

Browse files
authored
[mlir] Explain required attrs for CallOpInterface in Toy (NFC) (#141018)
Following #123176. Signed-off-by: Joshua James Venter <[email protected]>
1 parent c82b30c commit d0fbfa6

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,20 @@ def GenericCallOp : Toy_Op<"generic_call",
159159

160160
In the above we also use the `DeclareOpInterfaceMethods` directive to
161161
auto-declare all of the interface methods in the class declaration of
162-
GenericCallOp. We have already provided the definition in the `extraClassDeclaration`
162+
`GenericCallOp`. However, using this directive with `CallOpInterface`
163+
includes methods for handling argument and result attributes. Therefore,
164+
we need to add these specifically named attributes to our `GenericCallOp`
165+
definition:
166+
167+
```tablegen
168+
let arguments = (ins
169+
...
170+
OptionalAttr<DictArrayAttr>:$arg_attrs,
171+
OptionalAttr<DictArrayAttr>:$res_attrs
172+
);
173+
174+
175+
We have already provided the definition in the `extraClassDeclaration`
163176
field of the `FuncOp` class:
164177
165178
```c++

0 commit comments

Comments
 (0)