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

[IR] Modernize StructuralHashImpl (NFC) #105951

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Aug 24, 2024

@llvm/pr-subscribers-llvm-ir

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/105951.diff

1 Files Affected:

  • (modified) llvm/lib/IR/StructuralHash.cpp (+2-2)
diff --git a/llvm/lib/IR/StructuralHash.cpp b/llvm/lib/IR/StructuralHash.cpp
index b6de1ed725d7d4..fb4f33a021a96b 100644
--- a/llvm/lib/IR/StructuralHash.cpp
+++ b/llvm/lib/IR/StructuralHash.cpp
@@ -24,7 +24,7 @@ namespace {
 // by the MergeFunctions pass.
 
 class StructuralHashImpl {
-  uint64_t Hash;
+  uint64_t Hash = 4;
 
   void hash(uint64_t V) { Hash = hashing::detail::hash_16_bytes(Hash, V); }
 
@@ -43,7 +43,7 @@ class StructuralHashImpl {
   }
 
 public:
-  StructuralHashImpl() : Hash(4) {}
+  StructuralHashImpl() = default;
 
   void updateOperand(Value *Operand) {
     hashType(Operand->getType());

Copy link
Contributor

@boomanaiden154 boomanaiden154 left a comment

Choose a reason for hiding this comment

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

One question, otherwise seems reasonable enough to me.

llvm/lib/IR/StructuralHash.cpp Show resolved Hide resolved
@kazutakahirata kazutakahirata merged commit d252365 into llvm:main Aug 24, 2024
8 of 10 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_modernize_StructuralHashImpl branch August 24, 2024 17:53
dmpolukhin pushed a commit to dmpolukhin/llvm-project that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants