-
Notifications
You must be signed in to change notification settings - Fork 77
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: (riscv) initial arith lowering #1212
Conversation
adutilleul
commented
Jun 28, 2023
•
edited
Loading
edited
- Lowering scalar types (i.e: not Vector)
- Lowering for ALU-like ops
- Lowering for FPU-like ops
- Tests
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1212 +/- ##
==========================================
+ Coverage 88.66% 88.77% +0.11%
==========================================
Files 167 168 +1
Lines 22874 23110 +236
Branches 3480 3506 +26
==========================================
+ Hits 20281 20517 +236
+ Misses 2038 2032 -6
- Partials 555 561 +6
☔ View full report in Codecov by Sentry. |
|
||
def apply(self, ctx: MLContext, op: ModuleOp) -> None: | ||
# Implemented lowerings | ||
PatternRewriteWalker(LowerArithConstant()).rewrite_module(op) |
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.
Should probably use the GreedyRewritePatternApplier
here
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.
I think this is ready to merge modulo greedy pattern applier
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.
Hi @adutilleul,
Thanks for your contribution! This is an important step forward, but I do have some questions
I missed the part where we introduced signed integers to the Riscv dialect (or I forgot that I did that? Not sure anymore).
After learning about signless types it seems a bit weird to me that we would be introducing them after arith, since riscv assembly is pretty much signless all the way?
I also don't like the naming of the current pass.
Also, this PR introduces a lot of exceptions that don't seem to be tested.
Can you add some negative tests to increase coverage please?
Thanks!
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.
Forgot to press "request changes" on my last review!
I don't think we need the tests for coverage, seems like an inversion of the purpose of coverage. It seems that the implemented lowerings are tested in the filecheck, so I think we're good. About the name, I don't think we're that careful about non platform-specific lowerings elsewhere, I don't think it's worth worrying about that too much for the time being. At some point we'll come up with actual infrastructure for targets and stick to it, but I'd rather just assume that riscemu is the only riscv that exists until that becomes a problem. |
I've changed the naming @JosseVanDelm, so I think we're good for merging ? |
@adutilleul sure! go ahead! sorry for the slow response! |