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] Dedup: dedup private modules into public ones #7877

Merged
merged 3 commits into from
Nov 22, 2024

Conversation

youngar
Copy link
Member

@youngar youngar commented Nov 22, 2024

This change allows private modules to deduplicate in to public modules. It does this by swapping a private canonical module with a public module when found. Future public modules will not deduplicate into this group, as public modules can not dedup with other public modules in general. This also begins ignoring the convention of private modules, as it doesn't really carry any meaning. In the future we might want to disallow conventions to be specified on private modules.

@youngar youngar added the FIRRTL Involving the `firrtl` dialect label Nov 22, 2024
@youngar youngar marked this pull request as ready for review November 22, 2024 19:58
Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

LGTM modulo that this does the right thing with the annotations that moderate dedup.

test/Dialect/FIRRTL/dedup.mlir Show resolved Hide resolved
lib/Dialect/FIRRTL/Transforms/Dedup.cpp Outdated Show resolved Hide resolved
Comment on lines -1708 to -1709
if (!checkVisibility(module))
return success();
Copy link
Member

Choose a reason for hiding this comment

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

Something to keep an eye on: now that there is no early exit here, all modules will be hashed. This may affect performance, specifically for private classes.

@youngar youngar merged commit fe6e5ae into llvm:main Nov 22, 2024
4 checks passed
@youngar youngar deleted the firrtl-dedup-public branch November 22, 2024 22:44
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.

3 participants