Skip to content

[ADT,CodeGen] Remove stable_hash_combine_string #100668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions llvm/include/llvm/ADT/StableHashing.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,6 @@ inline stable_hash stable_hash_combine_array(const stable_hash *P, size_t C) {
hashing::detail::stable_hash_append(Hash, P[I]);
return Hash;
}

inline stable_hash stable_hash_combine_string(const StringRef &S) {
return stable_hash_combine_range(S.begin(), S.end());
}

inline stable_hash stable_hash_combine_string(const char *C) {
stable_hash Hash = hashing::detail::FNV_OFFSET_64;
while (*C)
hashing::detail::stable_hash_append(Hash, *(C++));
return Hash;
}

} // namespace llvm

#endif
8 changes: 4 additions & 4 deletions llvm/lib/CodeGen/MachineStableHash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/xxhash.h"

#define DEBUG_TYPE "machine-stable-hash"

Expand Down Expand Up @@ -100,8 +101,7 @@ stable_hash llvm::stableHashValue(const MachineOperand &MO) {
case MachineOperand::MO_TargetIndex: {
if (const char *Name = MO.getTargetIndexName())
return stable_hash_combine(MO.getType(), MO.getTargetFlags(),
stable_hash_combine_string(Name),
MO.getOffset());
xxh3_64bits(Name), MO.getOffset());
StableHashBailingTargetIndexNoName++;
return 0;
}
Expand All @@ -113,7 +113,7 @@ stable_hash llvm::stableHashValue(const MachineOperand &MO) {

case MachineOperand::MO_ExternalSymbol:
return hash_combine(MO.getType(), MO.getTargetFlags(), MO.getOffset(),
stable_hash_combine_string(MO.getSymbolName()));
xxh3_64bits(MO.getSymbolName()));

case MachineOperand::MO_RegisterMask:
case MachineOperand::MO_RegisterLiveOut: {
Expand Down Expand Up @@ -151,7 +151,7 @@ stable_hash llvm::stableHashValue(const MachineOperand &MO) {
case MachineOperand::MO_MCSymbol: {
auto SymbolName = MO.getMCSymbol()->getName();
return hash_combine(MO.getType(), MO.getTargetFlags(),
stable_hash_combine_string(SymbolName));
xxh3_64bits(SymbolName));
}
case MachineOperand::MO_CFIIndex:
return stable_hash_combine(MO.getType(), MO.getTargetFlags(),
Expand Down
Loading