[llvm] e0f5ce1 - [IR][Analysis] Remove unused DenseMapInfo::getTombstoneKey (#200958)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 2 05:09:34 PDT 2026
Author: Fangrui Song
Date: 2026-06-02T05:09:29-07:00
New Revision: e0f5ce18c04a5c55e5eb4e35e5ab1f1980e15c31
URL: https://github.com/llvm/llvm-project/commit/e0f5ce18c04a5c55e5eb4e35e5ab1f1980e15c31
DIFF: https://github.com/llvm/llvm-project/commit/e0f5ce18c04a5c55e5eb4e35e5ab1f1980e15c31.diff
LOG: [IR][Analysis] Remove unused DenseMapInfo::getTombstoneKey (#200958)
#200595 changed DenseMap to no longer create tombstone buckets, so
DenseMapInfo<T>::getTombstoneKey() is never called. Remove dead
definitions and dead tombstone branches.
Added:
Modified:
llvm/include/llvm/Analysis/AliasAnalysis.h
llvm/include/llvm/Analysis/AssumeBundleQueries.h
llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
llvm/include/llvm/Analysis/MemoryLocation.h
llvm/include/llvm/Analysis/MemorySSA.h
llvm/include/llvm/Analysis/ScalarEvolution.h
llvm/include/llvm/Analysis/VectorUtils.h
llvm/include/llvm/IR/Attributes.h
llvm/include/llvm/IR/BasicBlock.h
llvm/include/llvm/IR/DebugInfo.h
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/include/llvm/IR/Dominators.h
llvm/include/llvm/IR/Metadata.h
llvm/include/llvm/IR/ModuleSummaryIndex.h
llvm/include/llvm/IR/ValueHandle.h
llvm/include/llvm/IR/ValueMap.h
llvm/lib/Analysis/IRSimilarityIdentifier.cpp
llvm/lib/Analysis/MemorySSA.cpp
llvm/lib/IR/ConstantsContext.h
llvm/lib/IR/LLVMContextImpl.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h
index 7e9b17bcfa4d9..26b6dca986685 100644
--- a/llvm/include/llvm/Analysis/AliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/AliasAnalysis.h
@@ -221,10 +221,6 @@ template <> struct DenseMapInfo<AACacheLoc> {
return {DenseMapInfo<AACacheLoc::PtrTy>::getEmptyKey(),
DenseMapInfo<LocationSize>::getEmptyKey()};
}
- static inline AACacheLoc getTombstoneKey() {
- return {DenseMapInfo<AACacheLoc::PtrTy>::getTombstoneKey(),
- DenseMapInfo<LocationSize>::getTombstoneKey()};
- }
static unsigned getHashValue(const AACacheLoc &Val) {
return DenseMapInfo<AACacheLoc::PtrTy>::getHashValue(Val.Ptr) ^
DenseMapInfo<LocationSize>::getHashValue(Val.Size);
diff --git a/llvm/include/llvm/Analysis/AssumeBundleQueries.h b/llvm/include/llvm/Analysis/AssumeBundleQueries.h
index eb537e5f11afc..56a49b5db8d6f 100644
--- a/llvm/include/llvm/Analysis/AssumeBundleQueries.h
+++ b/llvm/include/llvm/Analysis/AssumeBundleQueries.h
@@ -53,9 +53,6 @@ template<> struct DenseMapInfo<Attribute::AttrKind> {
static Attribute::AttrKind getEmptyKey() {
return Attribute::EmptyKey;
}
- static Attribute::AttrKind getTombstoneKey() {
- return Attribute::TombstoneKey;
- }
static unsigned getHashValue(Attribute::AttrKind AK) {
return hash_combine(AK);
}
diff --git a/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h b/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
index d8e58ad2a9219..c26e7529f9a91 100644
--- a/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
+++ b/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
@@ -315,9 +315,6 @@ LLVM_ABI bool isClose(const IRInstructionData &A, const IRInstructionData &B);
struct IRInstructionDataTraits : DenseMapInfo<IRInstructionData *> {
static inline IRInstructionData *getEmptyKey() { return nullptr; }
- static inline IRInstructionData *getTombstoneKey() {
- return reinterpret_cast<IRInstructionData *>(-1);
- }
static unsigned getHashValue(const IRInstructionData *E) {
using llvm::hash_value;
@@ -327,8 +324,7 @@ struct IRInstructionDataTraits : DenseMapInfo<IRInstructionData *> {
static bool isEqual(const IRInstructionData *LHS,
const IRInstructionData *RHS) {
- if (RHS == getEmptyKey() || RHS == getTombstoneKey() ||
- LHS == getEmptyKey() || LHS == getTombstoneKey())
+ if (RHS == getEmptyKey() || LHS == getEmptyKey())
return LHS == RHS;
assert(LHS && RHS && "nullptr should have been caught by getEmptyKey?");
@@ -511,8 +507,6 @@ struct IRInstructionMapper {
// changed.
static_assert(DenseMapInfo<unsigned>::getEmptyKey() ==
static_cast<unsigned>(-1));
- static_assert(DenseMapInfo<unsigned>::getTombstoneKey() ==
- static_cast<unsigned>(-2));
IDL = new (IDLAllocator->Allocate())
IRInstructionDataList();
diff --git a/llvm/include/llvm/Analysis/MemoryLocation.h b/llvm/include/llvm/Analysis/MemoryLocation.h
index e69bf6373bc96..cba55eb8198f6 100644
--- a/llvm/include/llvm/Analysis/MemoryLocation.h
+++ b/llvm/include/llvm/Analysis/MemoryLocation.h
@@ -330,9 +330,6 @@ class MemoryLocation {
// Specialize DenseMapInfo.
template <> struct DenseMapInfo<LocationSize> {
static inline LocationSize getEmptyKey() { return LocationSize::mapEmpty(); }
- static inline LocationSize getTombstoneKey() {
- return LocationSize::mapTombstone();
- }
static unsigned getHashValue(const LocationSize &Val) {
return DenseMapInfo<uint64_t>::getHashValue(Val.toRaw());
}
@@ -346,10 +343,6 @@ template <> struct DenseMapInfo<MemoryLocation> {
return MemoryLocation(DenseMapInfo<const Value *>::getEmptyKey(),
DenseMapInfo<LocationSize>::getEmptyKey());
}
- static inline MemoryLocation getTombstoneKey() {
- return MemoryLocation(DenseMapInfo<const Value *>::getTombstoneKey(),
- DenseMapInfo<LocationSize>::getTombstoneKey());
- }
static unsigned getHashValue(const MemoryLocation &Val) {
return DenseMapInfo<const Value *>::getHashValue(Val.Ptr) ^
DenseMapInfo<LocationSize>::getHashValue(Val.Size) ^
diff --git a/llvm/include/llvm/Analysis/MemorySSA.h b/llvm/include/llvm/Analysis/MemorySSA.h
index 5b4c65f100c89..9b0038567fa69 100644
--- a/llvm/include/llvm/Analysis/MemorySSA.h
+++ b/llvm/include/llvm/Analysis/MemorySSA.h
@@ -1208,11 +1208,6 @@ template <> struct DenseMapInfo<UpwardDefsElem> {
DenseMapInfo<MemoryLocation>::getEmptyKey(), false};
}
- static inline UpwardDefsElem getTombstoneKey() {
- return {DenseMapInfo<MemoryAccess *>::getTombstoneKey(),
- DenseMapInfo<MemoryLocation>::getTombstoneKey(), false};
- }
-
static unsigned getHashValue(const UpwardDefsElem &Val) {
return hash_combine(DenseMapInfo<MemoryAccess *>::getHashValue(Val.MA),
DenseMapInfo<MemoryLocation>::getHashValue(Val.Loc),
diff --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h
index 0a60435749718..2a536e81e691c 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolution.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolution.h
@@ -206,11 +206,6 @@ template <> struct DenseMapInfo<SCEVUse> {
return PointerLikeTypeTraits<SCEVUse>::getFromVoidPointer((void *)Val);
}
- static inline SCEVUse getTombstoneKey() {
- uintptr_t Val = static_cast<uintptr_t>(-2);
- return PointerLikeTypeTraits<SCEVUse>::getFromVoidPointer((void *)Val);
- }
-
static unsigned getHashValue(SCEVUse U) {
return hash_value(U.getOpaqueValue());
}
@@ -2738,10 +2733,6 @@ template <> struct DenseMapInfo<ScalarEvolution::FoldID> {
ScalarEvolution::FoldID ID(0);
return ID;
}
- static inline ScalarEvolution::FoldID getTombstoneKey() {
- ScalarEvolution::FoldID ID(1);
- return ID;
- }
static unsigned getHashValue(const ScalarEvolution::FoldID &Val) {
return Val.computeHash();
diff --git a/llvm/include/llvm/Analysis/VectorUtils.h b/llvm/include/llvm/Analysis/VectorUtils.h
index 3fd4de926683c..1c73269a54af5 100644
--- a/llvm/include/llvm/Analysis/VectorUtils.h
+++ b/llvm/include/llvm/Analysis/VectorUtils.h
@@ -554,9 +554,8 @@ template <typename InstTy> class InterleaveGroup {
return false;
int32_t Key = *MaybeKey;
- // Skip if the key is used for either the tombstone or empty special values.
- if (DenseMapInfo<int32_t>::getTombstoneKey() == Key ||
- DenseMapInfo<int32_t>::getEmptyKey() == Key)
+ // Skip if the key is used for the empty special value.
+ if (DenseMapInfo<int32_t>::getEmptyKey() == Key)
return false;
// Skip if there is already a member with the same index.
diff --git a/llvm/include/llvm/IR/Attributes.h b/llvm/include/llvm/IR/Attributes.h
index c88d230bc1321..2424d1c0b512d 100644
--- a/llvm/include/llvm/IR/Attributes.h
+++ b/llvm/include/llvm/IR/Attributes.h
@@ -532,12 +532,6 @@ template <> struct DenseMapInfo<AttributeSet, void> {
return AttributeSet(reinterpret_cast<AttributeSetNode *>(Val));
}
- static AttributeSet getTombstoneKey() {
- auto Val = static_cast<uintptr_t>(-2);
- Val <<= PointerLikeTypeTraits<void *>::NumLowBitsAvailable;
- return AttributeSet(reinterpret_cast<AttributeSetNode *>(Val));
- }
-
static unsigned getHashValue(AttributeSet AS) {
return (unsigned((uintptr_t)AS.SetNode) >> 4) ^
(unsigned((uintptr_t)AS.SetNode) >> 9);
@@ -1107,12 +1101,6 @@ template <> struct DenseMapInfo<AttributeList, void> {
return AttributeList(reinterpret_cast<AttributeListImpl *>(Val));
}
- static AttributeList getTombstoneKey() {
- auto Val = static_cast<uintptr_t>(-2);
- Val <<= PointerLikeTypeTraits<void*>::NumLowBitsAvailable;
- return AttributeList(reinterpret_cast<AttributeListImpl *>(Val));
- }
-
static unsigned getHashValue(AttributeList AS) {
return (unsigned((uintptr_t)AS.pImpl) >> 4) ^
(unsigned((uintptr_t)AS.pImpl) >> 9);
diff --git a/llvm/include/llvm/IR/BasicBlock.h b/llvm/include/llvm/IR/BasicBlock.h
index 1f08dcc6114c2..abf5b72f3df10 100644
--- a/llvm/include/llvm/IR/BasicBlock.h
+++ b/llvm/include/llvm/IR/BasicBlock.h
@@ -771,12 +771,6 @@ template <> struct DenseMapInfo<BasicBlock::iterator> {
return BasicBlock::iterator(nullptr);
}
- static inline BasicBlock::iterator getTombstoneKey() {
- BasicBlock::iterator It(nullptr);
- It.setHeadBit(true);
- return It;
- }
-
static unsigned getHashValue(const BasicBlock::iterator &It) {
return DenseMapInfo<void *>::getHashValue(
reinterpret_cast<void *>(It.getNodePtr())) ^
diff --git a/llvm/include/llvm/IR/DebugInfo.h b/llvm/include/llvm/IR/DebugInfo.h
index 872f6cb4b0a12..16d780bb6c8e2 100644
--- a/llvm/include/llvm/IR/DebugInfo.h
+++ b/llvm/include/llvm/IR/DebugInfo.h
@@ -265,11 +265,6 @@ template <> struct DenseMapInfo<at::VarRecord> {
DenseMapInfo<DILocation *>::getEmptyKey());
}
- static inline at::VarRecord getTombstoneKey() {
- return at::VarRecord(DenseMapInfo<DILocalVariable *>::getTombstoneKey(),
- DenseMapInfo<DILocation *>::getTombstoneKey());
- }
-
static unsigned getHashValue(const at::VarRecord &Var) {
return hash_combine(Var.Var, Var.DL);
}
diff --git a/llvm/include/llvm/IR/DebugInfoMetadata.h b/llvm/include/llvm/IR/DebugInfoMetadata.h
index f9ed86ac23d68..29d2de7a58884 100644
--- a/llvm/include/llvm/IR/DebugInfoMetadata.h
+++ b/llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -3925,8 +3925,6 @@ template <> struct DenseMapInfo<DIExpression::FragmentInfo> {
static inline FragInfo getEmptyKey() { return {MaxVal, MaxVal}; }
- static inline FragInfo getTombstoneKey() { return {MaxVal - 1, MaxVal - 1}; }
-
static unsigned getHashValue(const FragInfo &Frag) {
return (Frag.SizeInBits & 0xffff) << 16 | (Frag.OffsetInBits & 0xffff);
}
@@ -4800,11 +4798,6 @@ template <> struct DenseMapInfo<DebugVariable> {
return DebugVariable(nullptr, std::nullopt, nullptr);
}
- /// Difference in tombstone is that the Optional is meaningful.
- static inline DebugVariable getTombstoneKey() {
- return DebugVariable(nullptr, {{0, 0}}, nullptr);
- }
-
static unsigned getHashValue(const DebugVariable &D) {
unsigned HV = 0;
const std::optional<FragmentInfo> Fragment = D.getFragment();
diff --git a/llvm/include/llvm/IR/Dominators.h b/llvm/include/llvm/IR/Dominators.h
index 4ee3c81b55712..7ea06ddccdc5d 100644
--- a/llvm/include/llvm/IR/Dominators.h
+++ b/llvm/include/llvm/IR/Dominators.h
@@ -123,10 +123,6 @@ template <> struct DenseMapInfo<BasicBlockEdge> {
return BasicBlockEdge(BBInfo::getEmptyKey(), BBInfo::getEmptyKey());
}
- static inline BasicBlockEdge getTombstoneKey() {
- return BasicBlockEdge(BBInfo::getTombstoneKey(), BBInfo::getTombstoneKey());
- }
-
static unsigned getHashValue(const BasicBlockEdge &Edge) {
return hash_combine(BBInfo::getHashValue(Edge.getStart()),
BBInfo::getHashValue(Edge.getEnd()));
diff --git a/llvm/include/llvm/IR/Metadata.h b/llvm/include/llvm/IR/Metadata.h
index 09bdb79a4dfda..a6317bd021a9a 100644
--- a/llvm/include/llvm/IR/Metadata.h
+++ b/llvm/include/llvm/IR/Metadata.h
@@ -874,11 +874,6 @@ struct DenseMapInfo<AAMDNodes> {
nullptr, nullptr);
}
- static inline AAMDNodes getTombstoneKey() {
- return AAMDNodes(DenseMapInfo<MDNode *>::getTombstoneKey(), nullptr,
- nullptr, nullptr, nullptr);
- }
-
static unsigned getHashValue(const AAMDNodes &Val) {
return DenseMapInfo<MDNode *>::getHashValue(Val.TBAA) ^
DenseMapInfo<MDNode *>::getHashValue(Val.TBAAStruct) ^
diff --git a/llvm/include/llvm/IR/ModuleSummaryIndex.h b/llvm/include/llvm/IR/ModuleSummaryIndex.h
index ed39eb99a9196..141a977113a65 100644
--- a/llvm/include/llvm/IR/ModuleSummaryIndex.h
+++ b/llvm/include/llvm/IR/ModuleSummaryIndex.h
@@ -304,13 +304,7 @@ template <> struct DenseMapInfo<ValueInfo> {
return ValueInfo(false, (GlobalValueSummaryMapTy::value_type *)-8);
}
- static inline ValueInfo getTombstoneKey() {
- return ValueInfo(false, (GlobalValueSummaryMapTy::value_type *)-16);
- }
-
- static inline bool isSpecialKey(ValueInfo V) {
- return V == getTombstoneKey() || V == getEmptyKey();
- }
+ static inline bool isSpecialKey(ValueInfo V) { return V == getEmptyKey(); }
static bool isEqual(ValueInfo L, ValueInfo R) {
// We are not supposed to mix ValueInfo(s) with
diff erent HaveGVs flag
@@ -1132,10 +1126,6 @@ class FunctionSummary : public GlobalValueSummary {
template <> struct DenseMapInfo<FunctionSummary::VFuncId> {
static FunctionSummary::VFuncId getEmptyKey() { return {0, uint64_t(-1)}; }
- static FunctionSummary::VFuncId getTombstoneKey() {
- return {0, uint64_t(-2)};
- }
-
static bool isEqual(FunctionSummary::VFuncId L, FunctionSummary::VFuncId R) {
return L.GUID == R.GUID && L.Offset == R.Offset;
}
@@ -1148,10 +1138,6 @@ template <> struct DenseMapInfo<FunctionSummary::ConstVCall> {
return {{0, uint64_t(-1)}, {}};
}
- static FunctionSummary::ConstVCall getTombstoneKey() {
- return {{0, uint64_t(-2)}, {}};
- }
-
static bool isEqual(FunctionSummary::ConstVCall L,
FunctionSummary::ConstVCall R) {
return DenseMapInfo<FunctionSummary::VFuncId>::isEqual(L.VFunc, R.VFunc) &&
diff --git a/llvm/include/llvm/IR/ValueHandle.h b/llvm/include/llvm/IR/ValueHandle.h
index 65b1fe5680aea..480f2bb92ebc6 100644
--- a/llvm/include/llvm/IR/ValueHandle.h
+++ b/llvm/include/llvm/IR/ValueHandle.h
@@ -130,9 +130,7 @@ class ValueHandleBase {
Value *getValPtr() const { return Val; }
static bool isValid(Value *V) {
- return V &&
- V != DenseMapInfo<Value *>::getEmptyKey() &&
- V != DenseMapInfo<Value *>::getTombstoneKey();
+ return V && V != DenseMapInfo<Value *>::getEmptyKey();
}
/// Remove this ValueHandle from its current use list.
@@ -212,10 +210,6 @@ template <> struct DenseMapInfo<WeakVH> {
return WeakVH(DenseMapInfo<Value *>::getEmptyKey());
}
- static inline WeakVH getTombstoneKey() {
- return WeakVH(DenseMapInfo<Value *>::getTombstoneKey());
- }
-
static unsigned getHashValue(const WeakVH &Val) {
return DenseMapInfo<Value *>::getHashValue(Val);
}
@@ -588,12 +582,6 @@ template <typename T> struct DenseMapInfo<PoisoningVH<T>> {
return Res;
}
- static inline PoisoningVH<T> getTombstoneKey() {
- PoisoningVH<T> Res;
- Res.setRawValPtr(DenseMapInfo<Value *>::getTombstoneKey());
- return Res;
- }
-
static unsigned getHashValue(const PoisoningVH<T> &Val) {
return DenseMapInfo<Value *>::getHashValue(Val.getRawValPtr());
}
diff --git a/llvm/include/llvm/IR/ValueMap.h b/llvm/include/llvm/IR/ValueMap.h
index acb0d2c316555..350ac8288d2e8 100644
--- a/llvm/include/llvm/IR/ValueMap.h
+++ b/llvm/include/llvm/IR/ValueMap.h
@@ -245,7 +245,7 @@ class ValueMapCallbackVH final : public CallbackVH {
: CallbackVH(const_cast<Value *>(static_cast<const Value *>(Key))),
Map(Map) {}
- // Private constructor used to create empty/tombstone DenseMap keys.
+ // Private constructor used to create empty DenseMap keys.
ValueMapCallbackVH(Value *V) : CallbackVH(V), Map(nullptr) {}
public:
@@ -296,10 +296,6 @@ struct DenseMapInfo<ValueMapCallbackVH<KeyT, ValueT, Config>> {
return VH(DenseMapInfo<Value *>::getEmptyKey());
}
- static inline VH getTombstoneKey() {
- return VH(DenseMapInfo<Value *>::getTombstoneKey());
- }
-
static unsigned getHashValue(const VH &Val) {
return DenseMapInfo<KeyT>::getHashValue(Val.Unwrap());
}
diff --git a/llvm/lib/Analysis/IRSimilarityIdentifier.cpp b/llvm/lib/Analysis/IRSimilarityIdentifier.cpp
index 11a824973de60..e180c203d13c5 100644
--- a/llvm/lib/Analysis/IRSimilarityIdentifier.cpp
+++ b/llvm/lib/Analysis/IRSimilarityIdentifier.cpp
@@ -360,9 +360,7 @@ unsigned IRInstructionMapper::mapToLegalUnsigned(
"Instruction mapping overflow!");
assert(LegalInstrNumber != DenseMapInfo<unsigned>::getEmptyKey() &&
- "Tried to assign DenseMap tombstone or empty key to instruction.");
- assert(LegalInstrNumber != DenseMapInfo<unsigned>::getTombstoneKey() &&
- "Tried to assign DenseMap tombstone or empty key to instruction.");
+ "Tried to assign DenseMap empty key to instruction.");
return INumber;
}
@@ -411,10 +409,7 @@ unsigned IRInstructionMapper::mapToIllegalUnsigned(
"Instruction mapping overflow!");
assert(IllegalInstrNumber != DenseMapInfo<unsigned>::getEmptyKey() &&
- "IllegalInstrNumber cannot be DenseMap tombstone or empty key!");
-
- assert(IllegalInstrNumber != DenseMapInfo<unsigned>::getTombstoneKey() &&
- "IllegalInstrNumber cannot be DenseMap tombstone or empty key!");
+ "IllegalInstrNumber cannot be DenseMap empty key!");
return INumber;
}
diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp
index 62c351499c3fc..c092187841e2a 100644
--- a/llvm/lib/Analysis/MemorySSA.cpp
+++ b/llvm/lib/Analysis/MemorySSA.cpp
@@ -221,10 +221,6 @@ template <> struct DenseMapInfo<MemoryLocOrCall> {
return MemoryLocOrCall(DenseMapInfo<MemoryLocation>::getEmptyKey());
}
- static inline MemoryLocOrCall getTombstoneKey() {
- return MemoryLocOrCall(DenseMapInfo<MemoryLocation>::getTombstoneKey());
- }
-
static unsigned getHashValue(const MemoryLocOrCall &MLOC) {
if (!MLOC.IsCall)
return hash_combine(
diff --git a/llvm/lib/IR/ConstantsContext.h b/llvm/lib/IR/ConstantsContext.h
index d33da85878af8..0fb2d2e49232e 100644
--- a/llvm/lib/IR/ConstantsContext.h
+++ b/llvm/lib/IR/ConstantsContext.h
@@ -569,10 +569,6 @@ template <class ConstantClass> class ConstantUniqueMap {
return ConstantClassInfo::getEmptyKey();
}
- static inline ConstantClass *getTombstoneKey() {
- return ConstantClassInfo::getTombstoneKey();
- }
-
static unsigned getHashValue(const ConstantClass *CP) {
SmallVector<Constant *, 32> Storage;
return getHashValue(LookupKey(CP->getType(), ValType(CP, Storage)));
@@ -591,7 +587,7 @@ template <class ConstantClass> class ConstantUniqueMap {
}
static bool isEqual(const LookupKey &LHS, const ConstantClass *RHS) {
- if (RHS == getEmptyKey() || RHS == getTombstoneKey())
+ if (RHS == getEmptyKey())
return false;
if (LHS.first != RHS->getType())
return false;
diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h
index 25133f0bbb775..57ff622b08813 100644
--- a/llvm/lib/IR/LLVMContextImpl.h
+++ b/llvm/lib/IR/LLVMContextImpl.h
@@ -77,9 +77,6 @@ class ValueHandleBase;
template <> struct DenseMapInfo<APFloat> {
static inline APFloat getEmptyKey() { return APFloat(APFloat::Bogus(), 1); }
- static inline APFloat getTombstoneKey() {
- return APFloat(APFloat::Bogus(), 2);
- }
static unsigned getHashValue(const APFloat &Key) {
return static_cast<unsigned>(hash_value(Key));
@@ -114,10 +111,6 @@ struct AnonStructTypeKeyInfo {
return DenseMapInfo<StructType *>::getEmptyKey();
}
- static inline StructType *getTombstoneKey() {
- return DenseMapInfo<StructType *>::getTombstoneKey();
- }
-
static unsigned getHashValue(const KeyTy &Key) {
return hash_combine(hash_combine_range(Key.ETypes), Key.isPacked);
}
@@ -127,7 +120,7 @@ struct AnonStructTypeKeyInfo {
}
static bool isEqual(const KeyTy &LHS, const StructType *RHS) {
- if (RHS == getEmptyKey() || RHS == getTombstoneKey())
+ if (RHS == getEmptyKey())
return false;
return LHS == KeyTy(RHS);
}
@@ -165,10 +158,6 @@ struct FunctionTypeKeyInfo {
return DenseMapInfo<FunctionType *>::getEmptyKey();
}
- static inline FunctionType *getTombstoneKey() {
- return DenseMapInfo<FunctionType *>::getTombstoneKey();
- }
-
static unsigned getHashValue(const KeyTy &Key) {
return hash_combine(Key.ReturnType, hash_combine_range(Key.Params),
Key.isVarArg);
@@ -179,7 +168,7 @@ struct FunctionTypeKeyInfo {
}
static bool isEqual(const KeyTy &LHS, const FunctionType *RHS) {
- if (RHS == getEmptyKey() || RHS == getTombstoneKey())
+ if (RHS == getEmptyKey())
return false;
return LHS == KeyTy(RHS);
}
@@ -212,10 +201,6 @@ struct TargetExtTypeKeyInfo {
return DenseMapInfo<TargetExtType *>::getEmptyKey();
}
- static inline TargetExtType *getTombstoneKey() {
- return DenseMapInfo<TargetExtType *>::getTombstoneKey();
- }
-
static unsigned getHashValue(const KeyTy &Key) {
return hash_combine(Key.Name, hash_combine_range(Key.TypeParams),
hash_combine_range(Key.IntParams));
@@ -226,7 +211,7 @@ struct TargetExtTypeKeyInfo {
}
static bool isEqual(const KeyTy &LHS, const TargetExtType *RHS) {
- if (RHS == getEmptyKey() || RHS == getTombstoneKey())
+ if (RHS == getEmptyKey())
return false;
return LHS == KeyTy(RHS);
}
@@ -1527,10 +1512,6 @@ struct DIArgListInfo {
return DenseMapInfo<DIArgList *>::getEmptyKey();
}
- static inline DIArgList *getTombstoneKey() {
- return DenseMapInfo<DIArgList *>::getTombstoneKey();
- }
-
static unsigned getHashValue(const KeyTy &Key) { return Key.getHashValue(); }
static unsigned getHashValue(const DIArgList *N) {
@@ -1538,7 +1519,7 @@ struct DIArgListInfo {
}
static bool isEqual(const KeyTy &LHS, const DIArgList *RHS) {
- if (RHS == getEmptyKey() || RHS == getTombstoneKey())
+ if (RHS == getEmptyKey())
return false;
return LHS.isKeyOf(RHS);
}
@@ -1557,10 +1538,6 @@ template <class NodeTy> struct MDNodeInfo {
return DenseMapInfo<NodeTy *>::getEmptyKey();
}
- static inline NodeTy *getTombstoneKey() {
- return DenseMapInfo<NodeTy *>::getTombstoneKey();
- }
-
static unsigned getHashValue(const KeyTy &Key) { return Key.getHashValue(); }
static unsigned getHashValue(const NodeTy *N) {
@@ -1568,7 +1545,7 @@ template <class NodeTy> struct MDNodeInfo {
}
static bool isEqual(const KeyTy &LHS, const NodeTy *RHS) {
- if (RHS == getEmptyKey() || RHS == getTombstoneKey())
+ if (RHS == getEmptyKey())
return false;
return SubsetEqualTy::isSubsetEqual(LHS, RHS) || LHS.isKeyOf(RHS);
}
@@ -1576,7 +1553,7 @@ template <class NodeTy> struct MDNodeInfo {
static bool isEqual(const NodeTy *LHS, const NodeTy *RHS) {
if (LHS == RHS)
return true;
- if (RHS == getEmptyKey() || RHS == getTombstoneKey())
+ if (RHS == getEmptyKey())
return false;
return SubsetEqualTy::isSubsetEqual(LHS, RHS);
}
More information about the llvm-commits
mailing list