Hello everyone. Right now I am struggling with a couple of issues I ran into while trying to design a MLIR dialect for Dataflow Engines and I am afraid I couldn’t find specific information in neither the provided documentation nor examples. I would be very grateful if you could help me.
- Recently I found out that it is possible to parametrize a type with another type like this:
let parameters = (ins "Type":$stream_type);
and it would be quite helpful to me, but when I tried to do the same with an operation
def InputOp : DFCIR_Op<"input"> {
let arguments = (ins
"Type":$type,
...
I couldn’t get over the following error error: undefined type for argument #0
regarding the operation described above. Am I correct to assume it is by design that you cannot parametrize an operation with a type or do I have other issues in my code? I used the same inclusion directives as I had used in the types-file, primarily
include "mlir/IR/OpBase.td"
include "mlir/IR/DialectBase.td"
include "mlir/IR/AttrTypeBase.td"
include "mlir/IR/BuiltinAttributes.td"
and yet the error remains.
- If we are trying do describe an operation with a number of arguments: attributes and operands, neither of which can be omitted and attributes represent data which you can’t/shouldn’t express with an SSA-variable with a type (a name for a data stream, for example), isn’t it possible to define an assembly format relatively close to one that of, let’s say, a C++ function code, where string literals don’t have to be wrapped in a dictionary like we have to in MLIR?
Speaking more specific, I am trying to make the following pattern
let assemblyFormat = "`<` $type `>` `(` $name (`,` $ctrl^)? `)`";
where $name
is the only attribute and if we forget the problem №1 with parametrizing ops with types and don’t use the optional $ctrl
-operand, I wanted to achieve the following syntax for the operation input
in dfcir
dialect:
dfcir.input<dfcir.int(32)>("aaaaa")
As you can see, the string literal aaaaa
isn’t incased in attributes dictionary, and because of that I keep running into the following error
error: `attr-dict` directive not found in custom assembly format
. Is it necessary to use a number of directives like attr-dict
in custom assembly formats or is there a workaround for it?
As I have mentioned before, I would be really glad if you could help me because right now I cannot progress further with my work, so thanks in advance!