[PATCH] D112175: [NFC] Add llvm::StaticVector ADT

James Player via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 10:49:18 PDT 2022


jplayer-nv added a comment.

In D112175#3481996 <https://reviews.llvm.org/D112175#3481996>, @dexonsmith wrote:

> Ideally the outer `if` would be `if constexpr(!U::TakesParamByValue)` but that needs to wait for C++17.
>
> The current implementation is easy to verify since the check is just in one place. Is it just a synthetic benchmark where it's causing a slowdown? Or, can we help the optimizer along somehow without changing the layering? (I don't feel strongly attached to exact design of the current thing, but IIRC it took some compromise at the time to make everyone happy. But I could be remembering the patch series incorrectly.)

Just tried compiling for C++20 and added the `constexpr`.  No improvement in runtime.  FYI I'm building on nearly the latest MSVC 2022 (just one update behind).

My benchmark is just a contrived loop of `push_back` calls to the small storage.

My time is a bit fragmented today... I'll give your suggested `reserveForParamAndGetAddressImpl()` changes a whirl later and report back.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112175/new/

https://reviews.llvm.org/D112175



More information about the llvm-commits mailing list