Skip to content

[OM] Add field_locs array attribute for ClassFieldsOp locations #8439

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

Merged
merged 7 commits into from
Apr 25, 2025

Conversation

leonardt
Copy link
Contributor

@leonardt leonardt commented Apr 24, 2025

This changes the ClassFieldsOp logic to use an inherent attribute to store an array mapping field to location by index. This avoids the issue where FusedLoc merges non-unique locations (preventing us from retrieving a fields location by mapping it to an index). It also avoids an issue where metadata is removed from the FusedLoc that was previously being used to store this information.

Copy link
Contributor

@mikeurbach mikeurbach left a comment

Choose a reason for hiding this comment

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

Generally looks good, just a couple minor things from my end. I guess one question is if this should go on the ClassOp (like we do for HWModuleOp) or on the ClassFieldsOp. I don't have any particularly strong reason to go one way or another. Keeping it on ClassFieldsOp like this PR does seems reasonable, since existing code expects to get field locations from the ClassFieldsOp.

@mikeurbach
Copy link
Contributor

Also please update the description / commit message (really, the commit message when this merges), to explain why we want to make this change.

@leonardt
Copy link
Contributor Author

Re: putting this in ClassOp, since we may need to implement a custom parser/printer for this, there could be motivation to just hook onto the existing parser/printer for ClassOp, but I think since it's information associated with the fields op it does make sense to store it with the op.

@leonardt leonardt changed the title [OM] Use OptionalAttr argument for ClassFieldsOp locations [OM] Use field_locs array attribute for ClassFieldsOp locations Apr 24, 2025
@leonardt leonardt changed the title [OM] Use field_locs array attribute for ClassFieldsOp locations [OM] Add field_locs array attribute for ClassFieldsOp locations Apr 24, 2025
@leonardt leonardt requested a review from mikeurbach April 24, 2025 21:24
Copy link
Contributor

@mikeurbach mikeurbach left a comment

Choose a reason for hiding this comment

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

A couple more minor comments. I think this would be fine to go in now, but a couple minor niceties that could help.

Copy link
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

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

LG

@leonardt leonardt merged commit c07d31b into main Apr 25, 2025
5 of 7 checks passed
@leonardt leonardt deleted the class-op-locs branch April 25, 2025 18:16
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.

3 participants