Skip to content
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

Merged
merged 15 commits into from Jul 3, 2023

Conversation

adutilleul
Copy link
Collaborator

@adutilleul adutilleul commented Jun 28, 2023

  • Lowering scalar types (i.e: not Vector)
  • Lowering for ALU-like ops
  • Lowering for FPU-like ops
  • Tests

@adutilleul adutilleul added the dialects Changes on the dialects label Jun 28, 2023
@adutilleul adutilleul self-assigned this Jun 28, 2023
@codecov
Copy link

codecov bot commented Jun 28, 2023

Codecov Report

Patch coverage: 98.30% and project coverage change: +0.11 🎉

Comparison is base (0b866aa) 88.66% compared to head (7d29395) 88.77%.

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     
Impacted Files Coverage Δ
...dsl/backend/riscv/lowering/riscv_arith_lowering.py 98.29% <98.29%> (ø)
xdsl/xdsl_opt_main.py 96.65% <100.00%> (+0.01%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.


def apply(self, ctx: MLContext, op: ModuleOp) -> None:
# Implemented lowerings
PatternRewriteWalker(LowerArithConstant()).rewrite_module(op)
Copy link
Member

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

Copy link
Member

@superlopuh superlopuh left a 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

@adutilleul adutilleul changed the title [WIP] dialects: (riscv) initial arith lowering dialects: (riscv) initial arith lowering Jun 29, 2023
@adutilleul adutilleul marked this pull request as ready for review June 29, 2023 10:18
Copy link
Collaborator

@JosseVanDelm JosseVanDelm left a 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!

xdsl/backend/riscv/lowering/rv32_arith_lowering.py Outdated Show resolved Hide resolved
xdsl/xdsl_opt_main.py Outdated Show resolved Hide resolved
xdsl/backend/riscv/lowering/rv32_arith_lowering.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@JosseVanDelm JosseVanDelm left a 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!

@superlopuh
Copy link
Member

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.

@adutilleul
Copy link
Collaborator Author

I've changed the naming @JosseVanDelm, so I think we're good for merging ?

@JosseVanDelm JosseVanDelm self-requested a review July 3, 2023 09:32
@JosseVanDelm
Copy link
Collaborator

@adutilleul sure! go ahead! sorry for the slow response!

@adutilleul adutilleul merged commit 08368d7 into main Jul 3, 2023
12 checks passed
@adutilleul adutilleul deleted the adutilleul/riscv/arith-lowering branch July 3, 2023 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialects Changes on the dialects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants