[libcxx-commits] [PATCH] D59999: Make it easier for the compiler to optimize `operator==(string, char*)`.

Marshall Clow via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 29 13:17:01 PDT 2019


mclow.lists added a comment.

So, Roman and I did some playing around with compiler explorer, and we discovered that if you define `_LIBCPP_DISABLE_EXTERN_TEMPLATE` so that you're not using the `string` code that's in the dylib, then you get the benefits of this patch w/o any code changes.

The reason that this doesn't get inlined is because `basic_string<char, char_traits<char>, allocator<char>>` (and also for `wchar_t`) is instantiated in the dylib.

This code replicates the logic for `operator==`, rather than keeping it in one place. That makes me mildly uncomfortable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59999





More information about the libcxx-commits mailing list