[all-commits] [llvm/llvm-project] a296bd: [StringMap] Replace tombstone deletion with TAOCP ...
Fangrui Song via All-commits
all-commits at lists.llvm.org
Thu Jun 11 11:30:03 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a296bdef76b9e9c6effbb6d052e75b3ef3670f3e
https://github.com/llvm/llvm-project/commit/a296bdef76b9e9c6effbb6d052e75b3ef3670f3e
Author: Fangrui Song <i at maskray.me>
Date: 2026-06-11 (Thu, 11 Jun 2026)
Changed paths:
M llvm/docs/ProgrammersManual.rst
M llvm/include/llvm/ADT/StringMap.h
M llvm/lib/Support/StringMap.cpp
M llvm/unittests/ADT/StringMapTest.cpp
M llvm/utils/gdb-scripts/prettyprinters.py
Log Message:
-----------
[StringMap] Replace tombstone deletion with TAOCP 6.4 Algorithm R () (#203354)
Reland #202103 after relanding "[StringMap] Invalidate iterators in
remove()" (#203249)
StringMap uses quadratic probing with lazy deletion: an erased entry
becomes a tombstone, a third bucket state alongside empty and live that
every find/insert must inspect.
Switch to linear probing with Knuth TAOCP 6.4 Algorithm R deletion,
similar to DenseMap #200595.
erase now relocates the following entries to close the hole. StringMap
buckets are pointers to heap-allocated entries, so only the pointers
(and the parallel hash array) move. References and pointers to entries
remain valid, but iterators are invalidated.
Depends on #202237 and #202520
Aided by Claude Opus 4.8
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list