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

Kyungwoo Lee via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 2 22:40:21 PST 2024


================
@@ -97,9 +99,14 @@ stable_hash llvm::stableHashValue(const MachineOperand &MO) {
       ++StableHashBailingGlobalAddress;
       return 0;
     }
-    auto Name = GV->getName();
-    return stable_hash_combine(MO.getType(), MO.getTargetFlags(),
-                               stable_hash_name(Name), MO.getOffset());
+    stable_hash GVHash = 0;
+    if (auto *GVar = dyn_cast<GlobalVariable>(GV))
----------------
kyulee-com wrote:

Moved `hasName` check below.

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


More information about the llvm-commits mailing list