diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp index 38d97d90acc13..8998a1b5aaebe 100644 --- a/bolt/lib/Core/BinaryFunction.cpp +++ b/bolt/lib/Core/BinaryFunction.cpp @@ -40,6 +40,7 @@ #include "llvm/Support/Regex.h" #include "llvm/Support/Timer.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Support/xxhash.h" #include #include #include @@ -3585,12 +3586,12 @@ size_t BinaryFunction::computeHash(bool UseDFS, llvm::copy(Layout.blocks(), std::back_inserter(Order)); // The hash is computed by creating a string of all instruction opcodes and - // possibly their operands and then hashing that string with std::hash. + // possibly their operands and then hashing that string with xxh3. std::string HashString; for (const BinaryBasicBlock *BB : Order) HashString.append(hashBlock(BC, *BB, OperandHashFunc)); - return Hash = std::hash{}(HashString); + return Hash = llvm::xxh3_64bits(HashString); } void BinaryFunction::insertBasicBlocks( diff --git a/bolt/test/X86/pre-aggregated-perf.test b/bolt/test/X86/pre-aggregated-perf.test index 720d179d1c6b8..e8c3f64239a27 100644 --- a/bolt/test/X86/pre-aggregated-perf.test +++ b/bolt/test/X86/pre-aggregated-perf.test @@ -46,7 +46,7 @@ PERF2BOLT: 1 usqrt a 1 usqrt 10 0 22 NEWFORMAT: - name: 'frame_dummy/1' NEWFORMAT: fid: 3 -NEWFORMAT: hash: 0x24496F7F9594E89F +NEWFORMAT: hash: 0x28C72085C0BD8D37 NEWFORMAT: exec: 1 NEWFORMAT: - name: usqrt