[Mlir-commits] [clang] [llvm] [mlir] [mlir] Don't assume non-erased DenseMap entries remain valid after erase. NFC (PR #199365)
Fangrui Song
llvmlistbot at llvm.org
Sun May 24 12:29:56 PDT 2026
================
@@ -159,11 +156,12 @@ class ThreadLocalCache {
}
threadInstance.keepalive = perInstanceState;
- // Before returning the new instance, take the chance to clear out any used
- // entries in the static map. The cache is only cleared within the same
- // thread to remove the need to lock the cache itself.
+ // Capture the value before clearing expired entries: clearExpiredEntries
+ // erases from `staticCache`, and backward-shift deletion can relocate the
+ // bucket referenced by `threadInstance`.
----------------
MaskRay wrote:
Improved the comment.
https://github.com/llvm/llvm-project/pull/199365
More information about the Mlir-commits
mailing list