[libcxx-commits] [libcxx] [libc++] Mark __{emplace, push}_back_slow_path as noinline (PR #94379)
via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jun 4 10:46:38 PDT 2024
gerben-stavenga wrote:
Furthermore, I don't understand the philosophy of push_back_slow_path in this case. The act of constructing a new type at the end of the vector happens regardless if the buffer needs to grow or not. Why would you duplicate the construction code? You just want to grow the buffer, which is the same between emplace_back or push_back.
This way of tailcalling slow paths only make sense if the function is outline in the first place, where it potentially prevents stack frames. But push_back is made to be inlined.
https://github.com/llvm/llvm-project/pull/94379
More information about the libcxx-commits
mailing list