[llvm] [BOLT] Provide backwards compatibility for YAML profile with std::hash (PR #74253)
Amir Ayupov via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 1 14:55:39 PDT 2024
================
@@ -241,12 +241,26 @@ void BinaryFunction::computeBlockHashes() const {
// Hashing complete instructions.
std::string InstrHashStr = hashBlock(
BC, *BB, [&](const MCOperand &Op) { return hashInstOperand(BC, Op); });
- uint64_t InstrHash = llvm::xxh3_64bits(InstrHashStr);
- BlendedHashes[I].InstrHash = (uint16_t)InstrHash;
+ if (HashFunction == HashFunction::StdHash) {
+ uint64_t InstrHash = std::hash<std::string>{}(InstrHashStr);
+ BlendedHashes[I].InstrHash = (uint16_t)hash_value(InstrHash);
----------------
aaupov wrote:
Yes, we realized that but couldn't make the change at the time (breaks profile matching). But now that the default has switched to xxh3 we can drop hash_value and adjust tests.
https://github.com/llvm/llvm-project/pull/74253
More information about the llvm-commits
mailing list