[llvm-branch-commits] [llvm] [NFC][MachineBlockHashInfo] Fork hash_16_bytes to guarantee stability (PR #192862)

Vitaly Buka via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Apr 21 12:52:21 PDT 2026


https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/192862

>From b0a029fc9d2466269493f98073e28cee96c2869f Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Sun, 19 Apr 2026 11:33:48 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20change?=
 =?UTF-8?q?s=20to=20main=20this=20commit=20is=20based=20on?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.7

[skip ci]
---
 llvm/lib/CodeGen/MachineBlockHashInfo.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/CodeGen/MachineBlockHashInfo.cpp b/llvm/lib/CodeGen/MachineBlockHashInfo.cpp
index 3aa3823731396..eeddaf6d48de4 100644
--- a/llvm/lib/CodeGen/MachineBlockHashInfo.cpp
+++ b/llvm/lib/CodeGen/MachineBlockHashInfo.cpp
@@ -11,6 +11,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/CodeGen/MachineBlockHashInfo.h"
+#include "llvm/ADT/Hashing.h"
+#include "llvm/CodeGen/MachineStableHash.h"
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/Target/TargetMachine.h"
@@ -25,8 +27,8 @@ static uint64_t hashBlock(const MachineBasicBlock &MBB, bool HashOperands) {
     Hash = hashing::detail::hash_16_bytes(Hash, MI.getOpcode());
     if (HashOperands) {
       for (unsigned i = 0; i < MI.getNumOperands(); i++) {
-        Hash =
-            hashing::detail::hash_16_bytes(Hash, hash_value(MI.getOperand(i)));
+        Hash = hashing::detail::hash_16_bytes(
+            Hash, stableHashValue(MI.getOperand(i)));
       }
     }
   }



More information about the llvm-branch-commits mailing list