llvm-project
578ba5f3 - [ADT] Avoid map storage for small SmallMapVector (#196473)

Commit
6 days ago
[ADT] Avoid map storage for small SmallMapVector (#196473) SmallMapVector previously used SmallDenseMap for its index, which still initializes and maintains map storage even when the number of entries is tiny. Teach MapVector to support a vector-only small mode. While the entry count stays within the configured small size, operations use the underlying vector directly. When the size grows past the threshold, the map index is built and subsequent operations use the regular MapVector path. This mirrors the small-size strategy used by SmallSetVector.
Author
Parents
Loading