Skip to content

[BOLT] Remove unused DenseMapInfo::getTombstoneKey#200637

Merged
MaskRay merged 1 commit into
llvm:mainfrom
MaskRay:pr/drop-tombstone-bolt
Jun 1, 2026
Merged

[BOLT] Remove unused DenseMapInfo::getTombstoneKey#200637
MaskRay merged 1 commit into
llvm:mainfrom
MaskRay:pr/drop-tombstone-bolt

Conversation

@MaskRay
Copy link
Copy Markdown
Member

@MaskRay MaskRay commented May 31, 2026

#200595 changed DenseMap to no longer create tombstone buckets, so
DenseMapInfo::getTombstoneKey() is never called. Remove dead
definitions and dead tombstone branches.

llvm#200595 changed DenseMap to no longer create tombstone buckets, so
DenseMapInfo<T>::getTombstoneKey() is never called. Remove dead
definitions and dead tombstone branches.
@llvmorg-github-actions
Copy link
Copy Markdown

@llvm/pr-subscribers-bolt

Author: Fangrui Song (MaskRay)

Changes

#200595 changed DenseMap to no longer create tombstone buckets, so
DenseMapInfo<T>::getTombstoneKey() is never called. Remove dead
definitions and dead tombstone branches.


Full diff: https://github.com/llvm/llvm-project/pull/200637.diff

3 Files Affected:

  • (modified) bolt/include/bolt/Passes/DataflowAnalysis.h (-5)
  • (modified) bolt/include/bolt/Passes/SplitFunctions.h (-3)
  • (modified) bolt/include/bolt/Profile/DataReader.h (-4)
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));

@aengelke
Copy link
Copy Markdown
Contributor

LGTM also. But please wait for 1-2 days in case we have to revert the DenseMap change again.

Copy link
Copy Markdown
Contributor

@yozhu yozhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@MaskRay MaskRay merged commit f0d3a8f into llvm:main Jun 1, 2026
12 checks passed
@MaskRay MaskRay deleted the pr/drop-tombstone-bolt branch June 1, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants