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

[FIRRTL] Add MatchOp statement #5037

Merged
merged 1 commit into from
Apr 13, 2023
Merged

[FIRRTL] Add MatchOp statement #5037

merged 1 commit into from
Apr 13, 2023

Conversation

youngar
Copy link
Member

@youngar youngar commented Apr 13, 2023

This commit adds a match statement operation to the FIRRTL dialect. Match is used as an eliminator for enumeration types. It enforces exaustive case handling on all enumeration variants.

This commit adds a match statement operation to the FIRRTL dialect.
Match is used as an eliminator for enumeration types.  It enforces
exaustive case handling on all enumeration variants.
@youngar youngar added the FIRRTL Involving the `firrtl` dialect label Apr 13, 2023
@youngar youngar requested a review from darthscsi April 13, 2023 22:30
Example:
```mlir
firrtl.match %in : !firrtl.enum<Some: uint<1>, None: uint<0>> {
case Some(%arg0) {
Copy link
Member Author

Choose a reason for hiding this comment

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

The ( and ) are not technically needed here, but I added them to match the FIRRTL syntax.

I might be able to get rid of the case keyword here but it made parsing easier.

@youngar
Copy link
Member Author

youngar commented Apr 13, 2023

Happy for any post-merge review but I'm going to merge it so I can keep moving forward.

@youngar youngar merged commit 567bc73 into llvm:main Apr 13, 2023
@youngar youngar deleted the firrtl-matchop branch April 13, 2023 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FIRRTL Involving the `firrtl` dialect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant