-
Notifications
You must be signed in to change notification settings - Fork 369
[ConvertToArcs] Add llhd.combinational conversion #8950
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
Conversation
bf81909
to
ac154f1
Compare
a8437ac
to
8c75ba9
Compare
ac154f1
to
1625508
Compare
Introduce a dialect conversion step into the `ConvertToArcs` pass. We'll use this to map various core dialect operations to Arc-specific ones in the future. As a starting point, add a conversion from `llhd.combinational` to `arc.execute`. This, alongside lowering to LLVM to be added in later PRs, will implement some basic LLHD support in the Arc dialect.
1625508
to
078d3f1
Compare
target.markUnknownOpDynamicallyLegal( | ||
[](Operation *op) { return !isa<llhd::LLHDDialect>(op->getDialect()); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it required even when llhd::LHDDialect is registered as an illegal dialect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I ran into the issue that all operations/dialects not explicitly listed as legal leading to a "failed to legalize" error. I would have thought that the partial dialect conversion would just rewrite ops that were explicitly marked as illegal. But that didn't work for me 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, interesting! Thank you for trying it out!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the reasons I often just use greedy pattern rewriter or simple walk, as I always have to remember again and mostly I want any pattern that can apply to apply. (dialect conversion still very useful for ones where type conversion needed and I haven't tried the new oneshot one).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah same here. I have no mental model of the dialect conversion framework. It feels completely random to me what I have to put into legalization, type conversion, and what gets converted where. But the plain old rewriting framework is annoying when a lot of type conversions are involved. I'm also having trouble finding good documentation for the dialect conversion framework. Seems to be a RTFC kind of deal 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, that was meant to be part of this review ^ otherwise LGTM!
Introduce a dialect conversion step into the
ConvertToArcs
pass. We'll use this to map various core dialect operations to Arc-specific ones in the future. As a starting point, add a conversion fromllhd.combinational
toarc.execute
. This, alongside lowering to LLVM to be added in later PRs, will implement some basic LLHD support in the Arc dialect.