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

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 25 15:09:57 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:

Is there a reason we can't mark these `constexpr` and use the existing sentinel values (or choose arbitrary new ones) to completely avoid having to call `stable_hash_name`? I believe the variable name along should provide the same level of readability.

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


More information about the llvm-commits mailing list