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

[WIP]: Introducing ptr dialect and its riscv conversion #3350

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

mamanain
Copy link
Collaborator

Porting the ptr dialect proposed here. Transfering the riscv compilation to it for load and store operations

@mamanain mamanain self-assigned this Oct 28, 2024
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.07%. Comparing base (3c60932) to head (ee65d9f).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3350      +/-   ##
==========================================
- Coverage   90.09%   90.07%   -0.03%     
==========================================
  Files         447      450       +3     
  Lines       56494    56780     +286     
  Branches     5431     5447      +16     
==========================================
+ Hits        50896    51142     +246     
- Misses       4163     4196      +33     
- Partials     1435     1442       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

assembly_format = "$addr `,` $offset attr-dict `:` `(` type($addr) `,` type($offset) `)` `->` type($result)"


# haven't managed to pass a type here yet. so did it with a hack.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way that should work but is a bit inelegant is base(IntegerType) | base(IndexType), there might be IntegerTypeConstr already defined, if not BaseAttr(IntegerType) should also work

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it to work but only via passing the type through attributes. Is it possible to pass it as an operand? Xdsl complains that it expects an operand there if write "op"(i32)

@@ -34,7 +35,7 @@ class PtrAddOp(IRDLOperation):
class TypeOffsetOp(IRDLOperation):
name = "ptr.type_offset"

elem_type = prop_def(base(IntegerType))
elem_type = prop_def(base(Attribute))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
elem_type = prop_def(base(Attribute))
elem_type = prop_def()

@mamanain
Copy link
Collaborator Author

Notebooks fail because I deleted Store and Load conversions from the MemrefToRiscv pass. Should we keep the old operation there or make the pass through pointers the default?

@mamanain mamanain changed the title [WIP]: Introducing ptr dialect and it's riscv conversion [WIP]: Introducing ptr dialect and its riscv conversion Oct 31, 2024
@compor compor self-requested a review November 13, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants