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

Avoid duplicating extra class declarations #1990

Conversation

mlevesquedion
Copy link
Contributor

I noticed some duplication and wondered if it was possible to remove it. Then I stumbled upon this thread which provided a solution: https://discourse.llvm.org/t/how-to-add-new-content-to-extraclassdeclaration-in-subclasses/71537

The idea is to declare the common class declaration in the base class and concatenate it with the child-specific declarations.

In some cases, the field was being overriden only to be set to the same value as the parent. In such cases, I simply removed the override.

I noticed some duplication and wondered if it was possible to remove it.
Then I stumbled upon this thread which provided a solution:
https://discourse.llvm.org/t/how-to-add-new-content-to-extraclassdeclaration-in-subclasses/71537

The idea is to declare the common class declaration in the base class
and concatenate it with the child-specific declarations.

In some cases, the field was being overriden only to be set to the same
value as the parent. In such cases, I simply removed the override.
Copy link
Member

@ghpvnist ghpvnist left a comment

Choose a reason for hiding this comment

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

LGTM, I think MHLO can also benefit from this change, so I added a tag to migrate to MHLO.

@mlevesquedion
Copy link
Contributor Author

Thanks, I'll look into it!

@mlevesquedion mlevesquedion merged commit aa9a196 into openxla:main Feb 6, 2024
10 checks passed
@mlevesquedion mlevesquedion deleted the avoid-redundant-respecification-of-extra-class-decls branch February 6, 2024 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup/Refactoring Migrate to MHLO PR that needs to be migrated to MLIR-HLO
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants