Fix confusing diagnostic during partial dialect conversion. A failure to
legalize is not the same as an operation being illegal: for eg. an
operation neither explicity marked legal nor explicitly marked illegal
could have been generated and may have failed to legalize further. The
op isn't an illegal one per
https://mlir.llvm.org/docs/DialectConversion/#conversion-target
which is an op that is explicitly marked illegal.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
The op isn't an illegal one per https://mlir.llvm.org/docs/DialectConversion/#conversion-target which is an op that is explicitly marked illegal.
Can you clarify this? I looked at the doc and your point isn't clear to me.
For example, to me if an op isn't illegal we should not even try to convert it at all.
I guess something in the doc isn't clear to me: it does not define anything else than legal or illegal as far as I can tell. To me that has been enough to reason about the process, but you're introducing here another state where an operation is neither legal nor illegal?
This third state kind of exists for the purpose of failing the partial legalization I guess, but I can't figure out where it'd be really defined in the section you're linking to?
Well, we have a tri-state: explicitly marked legal, explicitly marked illegal, and those that are neither of the former two. The three are treated differently -- for example with a partial conversion, you can end up with success with ops of the last kind but not with those of the second kind.
Right, I mentioned this in my last message.
Seems like the doc should get updated to reflect this if we want to embrace the "tri-state": right now I see these ops as illegal, they don't make a partial conversion fail.
That's right. The doc needs an update here - it can get quite tricky and confusing the way it's now. I'm happy to tackle that in this revision too. I'll update and will need a review for that.
LG, thanks.
mlir/lib/Transforms/Utils/DialectConversion.cpp | ||
---|---|---|
1934 | nit: failed to legalized <blah> Feels like ^ would read better, unless what you have matches other messages |
Adjust other failure messages to be consistent.
mlir/lib/Transforms/Utils/DialectConversion.cpp | ||
---|---|---|
1934 | Sure, done. |
nit: failed to legalized <blah>
Feels like ^ would read better, unless what you have matches other messages