[llvm] [StructuralHash] Refactor (PR #112621)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 11:08:37 PDT 2024


================
@@ -121,14 +148,17 @@ class StructuralHashImpl {
       // This random value acts as a block header, as otherwise the partition of
       // opcodes into BBs wouldn't affect the hash, only the order of the
       // opcodes
-      hash(45798);
+      Hashes.emplace_back(45798);
----------------
boomanaiden154 wrote:

The functions end up getting sorted by hash, so can cause test failures if you aren't careful (and I remember running into issues like 32-bit vs 64-bit x86 differences there). I'd prefer to keep explicit constants, but refactoring them to named constants would make a lot of sense to me.

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


More information about the llvm-commits mailing list