-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Design a Verona MLIR dialect #106
Comments
Two sources for the list of operations we need is the existing IR and Bytecode. In the existing prototype, a number of runtime features were exposed as builtin functions rather than special syntax and ir statements (they do have special bytecode instructions though). I don’t know what makes more sense in MLIR. |
I would be keen to keep them as builtin functions, and only do something special when lowering to LLVM. I think this will help with experimentation (as long as the type system can express their requirements). |
I believe |
Pony has a much weaker isolation model for foreign code, so I'm a bit nervous about accidentally introducing an |
In MLIR, operations and function calls are treated equal (ish). For example, you can have an unnamed/undeclared "operator" by having its name in quotes and operands laid out like a function:
You can also declare a "verona.myop" in the TD file and say it has a
Note the lack of quotes in the name. The former was a generic operand that needed additional logic to understand, the latter is an official verona operation, with accessors for the operands, result, types, etc. Of course, you can go further and make it more neat, like other native operations:
But that doesn't change the internal representation inside TableGen (and the compiler), where the operation is some form of We could do this process as smooth or blunt as necessary, but the real issue, as @mjp41 said, is the type system. We need to make sure first, that we can create an opaque type system. If we can't, we'll have to be a lot more blunt than we may want, to get the type system in place before we can look at the actual operations, which may create a chicken-egg problem. I'm hoping the two problems (operation and type definition) just happen to be orthogonal. If so, we can hopefully lower directly to an untyped verona dialect and then just do the type inference. But I'm not sure this is possible. Hopefully #101 will help us understand better. |
We're moving the high level IR to a different design, only having the low-level parts in MLIR, so all of the designs in this issue are being deprecated in favour of a more modular approach. |
Related to #104, this task is about lowering the operations, constructs (like if, when, where), lexical scopes, lambda logic, future registration, dispatch and completion, etc.
This can be a mix of existing dialects (std, loop) and Verona-specific constructs, but anything that touches specific Verona types must be Verona-specific nodes as well, so likely to be mostly Verona anyway.
Acceptance criteria:
Not included:
The text was updated successfully, but these errors were encountered: