[llvm] [ADT] Out-of-line the trivially-copyable SmallVector::push_back grow path (PR #206213)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 27 08:52:44 PDT 2026


MaskRay wrote:

Thanks for the experiment, which makes vec_pb_Tcreate faster (avoiding redundant stack copy) and vec_pb_Tcopy slower. Since there is c-t-t difference, I'm inclined to keep the current version.
```  ┌───────────────────────────────┬──────────┬────────────────────────┬───────────────────┐
  │         push_back of…         │ baseline │ PR #206213 (committed) │ AETEST (aengelke) │
  ├───────────────────────────────┼──────────┼────────────────────────┼───────────────────┤
  │ int (small, by-value)         │ 64       │ 22                     │ 22                │
  ├───────────────────────────────┼──────────┼────────────────────────┼───────────────────┤
  │ S{int[4]} 16 B (by-value)     │ 93       │ 54                     │ 54                │
  ├───────────────────────────────┼──────────┼────────────────────────┼───────────────────┤
  │ T{int[32]} 128 B, create+push │ 283      │ 192                    │ 128               │
  ├───────────────────────────────┼──────────┼────────────────────────┼───────────────────┤
  │ T 128 B, copy existing+push   │ 200      │ 93                     │ 290               │
  └───────────────────────────────┴──────────┴────────────────────────┴───────────────────┘
```

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


More information about the llvm-commits mailing list