[Mlir-commits] [mlir] [mlir] Optimize ThreadLocalCache by removing atomic bottleneck (attempt #3) (PR #93315)

Mehdi Amini llvmlistbot at llvm.org
Wed May 29 21:26:24 PDT 2024


================
@@ -25,28 +25,80 @@ namespace mlir {
 /// cache has very large lock contention.
 template <typename ValueT>
 class ThreadLocalCache {
+  struct PerInstanceState;
+
+  /// The "observer" is owned by a thread-local cache instance. It is
+  /// constructed the first time a `ThreadLocalCache` instance is accessed by a
+  /// thread, unless `perInstanceState` happens to get re-allocated to the same
+  /// address as a previous one. This class is destructed the thread in which
+  /// the `thread_local` cache lives is destroyed.
----------------
joker-eph wrote:

Can you proof read this, it seems like it is missing something.

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


More information about the Mlir-commits mailing list