[llvm] [GVN] add reverse leader map to improve compile time (PR #175870)

Princeton Ferro via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 14 14:20:27 PST 2026


================
@@ -831,19 +835,14 @@ void GVNPass::LeaderMap::erase(uint32_t N, Instruction *I,
       Curr->Next = Next->Next;
     }
   }
+
+#ifndef NDEBUG
+  LeaderToNums.del(N, I, BB);
+#endif
 }
 
 void GVNPass::LeaderMap::verifyRemoved(const Value *V) const {
-  // Walk through the value number scope to make sure the instruction isn't
-  // ferreted away in it.
-  for (const auto &I : NumToLeaders) {
-    (void)I;
-    assert(I.second.Entry.Val != V && "Inst still in value numbering scope!");
-    assert(
-        std::none_of(leader_iterator(&I.second), leader_iterator(nullptr),
----------------
Prince781 wrote:

It looks so.

https://github.com/llvm/llvm-project/pull/175870


More information about the llvm-commits mailing list