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