Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[FIRRTL][Dedup] Reduce size of integer data hashed. #7469

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

dtzSiFive
Copy link
Contributor

Don't always zext to size_t.

Use smaller integer sizes for ValueId and add to hash together.

Small performance win.

Don't always zext to size_t.

Use smaller integer sizes for ValueId and add to hash together.
@dtzSiFive dtzSiFive force-pushed the feature/dedup-less-bytes-to-hash branch from 8fe893a to 0512d22 Compare August 8, 2024 16:01
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.

Makes sense to me.


void update(size_t value) {
/// Hash value as array of bytes.
template <typename T>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FWIW:
If I could confidently enable_if this to ensure it doesn't get used with things that have possibly unset padding or short reads or something I would but instead I just wrap it for types that are definitely safe and cover our needs.

@dtzSiFive dtzSiFive merged commit da2428a into llvm:main Aug 8, 2024
4 checks passed
@dtzSiFive dtzSiFive deleted the feature/dedup-less-bytes-to-hash branch August 8, 2024 18:55
dtzSiFive added a commit that referenced this pull request Aug 8, 2024
Revisit with unambiguous methods.

This reverts commit da2428a.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants