We have an readability-related mechanism in the op parser that lets the op declare the default dialect for the ops contained in its regions. When set up, it makes
foo.bar {
qux
}
and
foo.bar {
foo.qux
}
parse to the same IR. The former form is always printed. However, this is broken if the op has dots in its name:
foo.bar {
baz.qux
}
will be parsed as the qux
op from the baz
dialect, and fail if there is no such dialect instead of attempting to look up the baz.qux
op in the default dialect. The bigger problem is the broken roundtripping where:
foo.bar {
foo.baz.qux
}
is parsed okay but printed without the leading foo
, which cannot be parsed back, or is parsed as a different op.
There are two ways to fix this:
- fall back to the default dialect specified by the op for ops that come from unregistered dialects;
- ignore the default dialect when printing the op with dots in the name.
Any preference for one or another?