[llvm] [StructuralHash] Global Variable (PR #118412)

Zhaoxuan Jiang via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 2 22:19:57 PST 2024


================
@@ -98,14 +123,21 @@ class StructuralHashImpl {
       return stable_hash_combine(Hashes);
     }
 
+    if (auto *GVar = dyn_cast<GlobalVariable>(C)) {
+      Hashes.emplace_back(hashGlobalVariable(*GVar));
+      return stable_hash_combine(Hashes);
+    }
+
     if (auto *G = dyn_cast<GlobalValue>(C)) {
       Hashes.emplace_back(hashGlobalValue(G));
       return stable_hash_combine(Hashes);
     }
 
     if (const auto *Seq = dyn_cast<ConstantDataSequential>(C)) {
-      Hashes.emplace_back(xxh3_64bits(Seq->getRawDataValues()));
-      return stable_hash_combine(Hashes);
+      if (Seq->isString()) {
----------------
nocchijiang wrote:

What about other `ConstantDataSequential`s which are not string?

https://github.com/llvm/llvm-project/pull/118412


More information about the llvm-commits mailing list