[mlir][StorageUniquer] Use allocators per thread instead of per shard
authorRiver Riddle <riddleriver@gmail.com>
Tue, 14 Mar 2023 00:32:10 +0000 (17:32 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Thu, 16 Mar 2023 21:56:22 +0000 (14:56 -0700)
commit9f991ed3e82dc9014c56f3b6092a67affc6eb297
tree5f3104633f1cf220b6309f5646aa9b2355c6857e
parent96118f1b0ab7a18999a4f2199ba1ecd546c68cb8
[mlir][StorageUniquer] Use allocators per thread instead of per shard

This greatly reduces the number of allocators we create, while still
retaining thread safety. Reducing the number of allocators is much
better for locality and memory usage; this revision drops memory
usage for some MLIR heavy workloads (with lots of attributes/types)
by >=5%. This is due to the observation that the number of threads
is effectively always smaller than the number of parametric attributes/types.

Differential Revision: https://reviews.llvm.org/D145991
mlir/lib/Support/StorageUniquer.cpp