[BOLT] Remove unused DenseMapInfo::getTombstoneKey#200637
Merged
Merged
Conversation
llvm#200595 changed DenseMap to no longer create tombstone buckets, so DenseMapInfo<T>::getTombstoneKey() is never called. Remove dead definitions and dead tombstone branches.
|
@llvm/pr-subscribers-bolt Author: Fangrui Song (MaskRay) Changes#200595 changed DenseMap to no longer create tombstone buckets, so 3 Files Affected:
diff --git a/bolt/include/bolt/Passes/DataflowAnalysis.h b/bolt/include/bolt/Passes/DataflowAnalysis.h
index 41b7667a5c9db..5d9442c85be19 100644
--- a/bolt/include/bolt/Passes/DataflowAnalysis.h
+++ b/bolt/include/bolt/Passes/DataflowAnalysis.h
@@ -570,11 +570,6 @@ template <> struct DenseMapInfo<bolt::ProgramPoint> {
Val <<= PointerLikeTypeTraits<MCInst *>::NumLowBitsAvailable;
return bolt::ProgramPoint(reinterpret_cast<MCInst *>(Val));
}
- static inline bolt::ProgramPoint getTombstoneKey() {
- uintptr_t Val = static_cast<uintptr_t>(-2);
- Val <<= PointerLikeTypeTraits<MCInst *>::NumLowBitsAvailable;
- return bolt::ProgramPoint(reinterpret_cast<MCInst *>(Val));
- }
static unsigned getHashValue(const bolt::ProgramPoint &PP) {
return (unsigned((uintptr_t)PP.Data.BB) >> 4) ^
(unsigned((uintptr_t)PP.Data.BB) >> 9);
diff --git a/bolt/include/bolt/Passes/SplitFunctions.h b/bolt/include/bolt/Passes/SplitFunctions.h
index 2c1bf1890cd97..ddbdaf0e7e5f4 100644
--- a/bolt/include/bolt/Passes/SplitFunctions.h
+++ b/bolt/include/bolt/Passes/SplitFunctions.h
@@ -43,9 +43,6 @@ class SplitFunctions : public BinaryFunctionPass {
: SourceFN(SourceFN), Target(Target) {}
static inline TrampolineKey getEmptyKey() { return TrampolineKey(); };
- static inline TrampolineKey getTombstoneKey() {
- return TrampolineKey(FragmentNum(UINT_MAX), nullptr);
- };
static unsigned getHashValue(const TrampolineKey &Val) {
return llvm::hash_combine(Val.SourceFN.get(), Val.Target);
}
diff --git a/bolt/include/bolt/Profile/DataReader.h b/bolt/include/bolt/Profile/DataReader.h
index d5fc1ef38d6a4..01bf17064432b 100644
--- a/bolt/include/bolt/Profile/DataReader.h
+++ b/bolt/include/bolt/Profile/DataReader.h
@@ -491,10 +491,6 @@ template <> struct DenseMapInfo<bolt::Location> {
static inline bolt::Location getEmptyKey() {
return bolt::Location(true, StringRef(), static_cast<uint64_t>(-1LL));
}
- static inline bolt::Location getTombstoneKey() {
- return bolt::Location(true, StringRef(), static_cast<uint64_t>(-2LL));
- ;
- }
static unsigned getHashValue(const bolt::Location &L) {
return (unsigned(DenseMapInfo<StringRef>::getHashValue(L.Name)) >> 4) ^
(unsigned(L.Offset));
|
Contributor
|
LGTM also. But please wait for 1-2 days in case we have to revert the DenseMap change again. |
ayermolo
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#200595 changed DenseMap to no longer create tombstone buckets, so
DenseMapInfo::getTombstoneKey() is never called. Remove dead
definitions and dead tombstone branches.