[libcxx-commits] [libcxx] [libc++] Mark __{emplace, push}_back_slow_path as noinline (PR #94379)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 5 15:39:18 PDT 2024


================
@@ -844,10 +844,11 @@ private:
   }
 
   template <class _Up>
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI inline pointer __push_back_slow_path(_Up&& __x);
+  _LIBCPP_NOINLINE _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI inline pointer __push_back_slow_path(_Up&& __x);
----------------
EricWF wrote:

@philnik777 Would you be open  simply removing the `inline` here so that with `-Os`, the compiler doesn't inline it.

That way we don't have to add `_LIBCPP_NOINLINE` and pessimize other code? 

I would LGTM that change in a heartbeat. 

Otherwise, I think we should try to get some concrete performance numbers here.

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


More information about the libcxx-commits mailing list