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] Use type_{cast, isa, dyn_cast} and FIRRTLTypeSwitch #5539

Merged
merged 3 commits into from
Jul 19, 2023

Conversation

uenoku
Copy link
Member

@uenoku uenoku commented Jul 5, 2023

This PR mechanically replaces type casts with firrtl::type* casts which strips outer most type aliases. Also replace TypeSwitch with FIRRTLTypeSwitch.

Unline #5167, this PR just replaces all the casts in FIRRTL dialect with firrtl::type_* because it's tedious to use a brain to think about whether or not firrtl::type_cast is necessary. Since type casts introduced by #5417 automatically eliminate unnecessary look up for type aliases at the compile time, there is no runtime regression because of that.

@dtzSiFive dtzSiFive added the FIRRTL Involving the `firrtl` dialect label Jul 7, 2023
@uenoku uenoku requested a review from prithayan July 11, 2023 16:10
Copy link
Contributor

@prithayan prithayan left a comment

Choose a reason for hiding this comment

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

Looks good, seems mostly mechanical change, I grepped around to confirm none of the cast were still left around.

Copy link
Contributor

@fabianschuiki fabianschuiki left a comment

Choose a reason for hiding this comment

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

LGTM!

@uenoku uenoku merged commit c923041 into main Jul 19, 2023
5 checks passed
@uenoku uenoku deleted the dev/uenoku/type-cast branch July 19, 2023 09:31
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.

None yet

4 participants