|
14 | 14 |
|
15 | 15 | #include "llvm/Passes/StandardInstrumentations.h"
|
16 | 16 | #include "llvm/ADT/Any.h"
|
17 |
| -#include "llvm/ADT/StableHashing.h" |
18 | 17 | #include "llvm/ADT/StringRef.h"
|
19 | 18 | #include "llvm/Analysis/CallGraphSCCPass.h"
|
20 | 19 | #include "llvm/Analysis/LazyCallGraph.h"
|
|
44 | 43 | #include "llvm/Support/Regex.h"
|
45 | 44 | #include "llvm/Support/Signals.h"
|
46 | 45 | #include "llvm/Support/raw_ostream.h"
|
| 46 | +#include "llvm/Support/xxhash.h" |
47 | 47 | #include <unordered_map>
|
48 | 48 | #include <unordered_set>
|
49 | 49 | #include <utility>
|
@@ -753,28 +753,27 @@ static SmallString<32> getIRFileDisplayName(Any IR) {
|
753 | 753 | SmallString<32> Result;
|
754 | 754 | raw_svector_ostream ResultStream(Result);
|
755 | 755 | const Module *M = unwrapModule(IR);
|
756 |
| - stable_hash NameHash = stable_hash_combine_string(M->getName()); |
757 |
| - unsigned int MaxHashWidth = sizeof(stable_hash) * 8 / 4; |
| 756 | + uint64_t NameHash = xxh3_64bits(M->getName()); |
| 757 | + unsigned MaxHashWidth = sizeof(uint64_t) * 2; |
758 | 758 | write_hex(ResultStream, NameHash, HexPrintStyle::Lower, MaxHashWidth);
|
759 | 759 | if (unwrapIR<Module>(IR)) {
|
760 | 760 | ResultStream << "-module";
|
761 | 761 | } else if (const auto *F = unwrapIR<Function>(IR)) {
|
762 | 762 | ResultStream << "-function-";
|
763 |
| - stable_hash FunctionNameHash = stable_hash_combine_string(F->getName()); |
| 763 | + auto FunctionNameHash = xxh3_64bits(F->getName()); |
764 | 764 | write_hex(ResultStream, FunctionNameHash, HexPrintStyle::Lower,
|
765 | 765 | MaxHashWidth);
|
766 | 766 | } else if (const auto *C = unwrapIR<LazyCallGraph::SCC>(IR)) {
|
767 | 767 | ResultStream << "-scc-";
|
768 |
| - stable_hash SCCNameHash = stable_hash_combine_string(C->getName()); |
| 768 | + auto SCCNameHash = xxh3_64bits(C->getName()); |
769 | 769 | write_hex(ResultStream, SCCNameHash, HexPrintStyle::Lower, MaxHashWidth);
|
770 | 770 | } else if (const auto *L = unwrapIR<Loop>(IR)) {
|
771 | 771 | ResultStream << "-loop-";
|
772 |
| - stable_hash LoopNameHash = stable_hash_combine_string(L->getName()); |
| 772 | + auto LoopNameHash = xxh3_64bits(L->getName()); |
773 | 773 | write_hex(ResultStream, LoopNameHash, HexPrintStyle::Lower, MaxHashWidth);
|
774 | 774 | } else if (const auto *MF = unwrapIR<MachineFunction>(IR)) {
|
775 | 775 | ResultStream << "-machine-function-";
|
776 |
| - stable_hash MachineFunctionNameHash = |
777 |
| - stable_hash_combine_string(MF->getName()); |
| 776 | + auto MachineFunctionNameHash = xxh3_64bits(MF->getName()); |
778 | 777 | write_hex(ResultStream, MachineFunctionNameHash, HexPrintStyle::Lower,
|
779 | 778 | MaxHashWidth);
|
780 | 779 | } else {
|
|
0 commit comments