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

core: (irdl) Add support for regions in optional groups to declarative assembly format #3106

Merged
merged 15 commits into from
Aug 31, 2024

Conversation

kimxworrall
Copy link
Collaborator

Added support for regions in optional groups and tests for this.

@kimxworrall kimxworrall added minor For minor PRs, easy and quick to review, quickly mergeable core xDSL core (ir, textual format, ...) labels Aug 28, 2024
@kimxworrall kimxworrall requested a review from superlopuh August 28, 2024 12:18
@kimxworrall kimxworrall self-assigned this Aug 28, 2024
@kimxworrall kimxworrall changed the title Kim/declarative assembly parser/add_optional_groups core: (irdl) Add suport for regions in optional groups to declarative assembly format Aug 28, 2024
Copy link

codecov bot commented Aug 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.91%. Comparing base (a2ed14d) to head (0c70f4a).
Report is 16 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #3106    +/-   ##
========================================
  Coverage   89.91%   89.91%            
========================================
  Files         419      421     +2     
  Lines       53070    53319   +249     
  Branches     8226     8267    +41     
========================================
+ Hits        47718    47942   +224     
- Misses       4023     4039    +16     
- Partials     1329     1338     +9     

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

kimxworrall and others added 2 commits August 28, 2024 18:34
Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
@alexarice alexarice changed the title core: (irdl) Add suport for regions in optional groups to declarative assembly format core: (irdl) Add support for regions in optional groups to declarative assembly format Aug 28, 2024
@alexarice
Copy link
Collaborator

Perhaps you and @superlopuh have discussed this in person but would it be possible to describe what wasn't working before/brief summary of what you've changed, as there seems to be lots of changes in the "files changed section"

):
case VariadicLikeVariable(), VariadicLikeVariable():
if not (
isinstance(a, RegionDirective, VariadicLikeTypeDirective)
Copy link
Member

Choose a reason for hiding this comment

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

My bad

Suggested change
isinstance(a, RegionDirective, VariadicLikeTypeDirective)
isinstance(a, RegionDirective | VariadicLikeTypeDirective)

@kimxworrall
Copy link
Collaborator Author

This commit adds a RegionDirective that all RegionVariables inherit from. When sequences of variables in declarative assembly format are checked, if two consecutive variables are optional (either two optional operands or two optional regions in a row, but not one optional region and one optional operand), an error is raised to inidicate ambiguity.

test_optional_groups_regions is modified to catch this error, and two other tests are made cleaner as hang overs from the previous pr on this branch.

@alexarice
Copy link
Collaborator

Is this ready to merge?

@superlopuh
Copy link
Member

Yeah seems ready to me, feel free to hit the merge button at your convenience :) @kimxworrall

@kimxworrall kimxworrall merged commit e8c0942 into main Aug 31, 2024
14 checks passed
@kimxworrall kimxworrall deleted the kim/declarative-assembly-parser/add-regions branch August 31, 2024 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core xDSL core (ir, textual format, ...) minor For minor PRs, easy and quick to review, quickly mergeable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants