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: (func) Add custom syntax for func.return #1168

Merged
merged 1 commit into from Jun 21, 2023

Conversation

AntonLydike
Copy link
Collaborator

This PR:

  • adds an __init__ constructor for func.Return, deprecating the old one.
  • Adds custom print and parse as per MLIR docs

@AntonLydike AntonLydike added the dialects Changes on the dialects label Jun 21, 2023
@AntonLydike AntonLydike self-assigned this Jun 21, 2023
@AntonLydike
Copy link
Collaborator Author

The print and parse methods should be able to be lifted to riscv.Return and scf.yield and stencil.return I think. Maybe we should put them in a nice interface ReturnOpLikePrinting?

@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Patch coverage: 82.22% and project coverage change: -0.02 ⚠️

Comparison is base (68f1d3a) 88.63% compared to head (a3d740b) 88.61%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1168      +/-   ##
==========================================
- Coverage   88.63%   88.61%   -0.02%     
==========================================
  Files         158      158              
  Lines       22148    22180      +32     
  Branches     3318     3326       +8     
==========================================
+ Hits        19630    19654      +24     
- Misses       1985     1990       +5     
- Partials      533      536       +3     
Impacted Files Coverage Δ
tests/filecheck/frontend/dialects/affine.py 52.72% <ø> (ø)
tests/filecheck/frontend/dialects/func.py 76.92% <ø> (ø)
tests/filecheck/frontend/dialects/scf.py 50.57% <ø> (ø)
xdsl/frontend/code_generation.py 91.72% <66.66%> (ø)
xdsl/dialects/func.py 91.32% <78.12%> (-3.19%) ⬇️
tests/dialects/test_func.py 100.00% <100.00%> (ø)
tests/dialects/test_memref.py 100.00% <100.00%> (ø)
tests/interpreters/test_pdl_interpreter.py 90.97% <100.00%> (ø)

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

Copy link
Contributor

@georgebisbas georgebisbas left a comment

Choose a reason for hiding this comment

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

NIce

Copy link
Collaborator

@webmiche webmiche left a comment

Choose a reason for hiding this comment

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

LGMT 👍

@webmiche
Copy link
Collaborator

The print and parse methods should be able to be lifted to riscv.Return and scf.yield and stencil.return I think. Maybe we should put them in a nice interface ReturnOpLikePrinting?

It indeed seems that many dialects need such an operation to return controlflow back out of a region. Therefore, I think that would be a good idea 👍

Not for this PR though, I really like the self-containedness of this one. Maybe open a starter issue?

@AntonLydike AntonLydike merged commit 25c326f into main Jun 21, 2023
12 checks passed
@AntonLydike AntonLydike deleted the anton/func-return-custom-syntax branch June 21, 2023 09:54
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

3 participants