-
Notifications
You must be signed in to change notification settings - Fork 76
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
dialects: (affine) No custom format for affine.for
#2673
Comments
The easiest way to start is usually using the assembly format API, our assembly format closely follows the MLIR one, so it's sometimes possible to copy/paste (without the operation name), and it often works. If it doesn't, then we usually use the |
affine.for
I just checked the documentation, and it looks like there's no assembly format for this operation, and a custom |
thanks for your answer. I will try to customize those functions. |
Let's keep the issue around until the fix is merged, just to keep track of it. Can you please comment with |
Alright, I have encountered problems when I try to implement the the affine load's syntax: operation ::= ssa-id `=` `affine.load` ssa-use `[` multi-dim-affine-map-of-ssa-ids `]` `:` memref-type test.mlir: %0 = affine.load %arg0[%arg5 + 3, %arg6, %arg8] : memref<8x128x384xf32> my question is how to parse here is my code and the error message: @classmethod
def parse(cls: Self, parser: Parser) -> Self:
memref = parser.parse_operand()
def parse_index():
return parser.parse_operand() # <-- need to parse operand expreesion
indices = parser.parse_comma_separated_list(
Parser.Delimiter.SQUARE, parse_index)
parser.parse_punctuation(':')
rtype: MemRefType = parser.parse_type()
return cls(memref, indices, None, rtype.get_element_type()) xdsl.utils.exceptions.ParseError: <unknown>:7:41
%0 = affine.load %arg0[%arg5 + 3, %arg6, %arg8] : memref<8x128x384xf32>
^
Expected ']' |
A search for |
It might be the case that the affine expressions supported in |
ok, I will be writing a new parsing function to deal with this. |
I am trying to use xdsl to parse a mlir file:
here is my code:
but I got error:
I found the xdsl needs to override the
parse
method manually. How can I use the mlir ODS to generate this method implement?The text was updated successfully, but these errors were encountered: