llvm-project/libcxx/lib/abi
Martijn Vels 2bad222680 Add optimization to basic_string::assign for compile-time known constant values.
Summary:
This change optimizes the assign() methods for string where either the contents or lengths are compile time known constants. For small strings (< min_cap) we can execute the assignment entirely inline. For strings up to 128 bytes we allow the compiler to efficiently inline the copy operation after we call the offline __resize<>() method. Short / long branches are taken at the call site for better branch prediction and allowing FDO optimizations.

Benchmarks (unstable / google perflab):
```
name                                                old time/op             new time/op             delta
BM_StringAssignAsciiz_Empty_Opaque                  5.69ns ± 7%             5.97ns ± 7%     ~             (p=0.056 n=5+5)
BM_StringAssignAsciiz_Empty_Transparent             5.39ns ± 7%             0.79ns ± 8%  -85.36%          (p=0.008 n=5+5)
BM_StringAssignAsciiz_Small_Opaque                  11.2ns ± 5%             11.0ns ± 6%     ~             (p=0.548 n=5+5)
BM_StringAssignAsciiz_Small_Transparent             10.1ns ± 7%              1.0ns ± 8%  -89.76%          (p=0.008 n=5+5)
BM_StringAssignAsciiz_Large_Opaque                  23.5ns ± 7%             23.8ns ± 7%     ~             (p=0.841 n=5+5)
BM_StringAssignAsciiz_Large_Transparent             21.4ns ± 7%             12.7ns ± 7%  -40.83%          (p=0.008 n=5+5)
BM_StringAssignAsciiz_Huge_Opaque                    336ns ± 4%              327ns ± 7%     ~             (p=0.421 n=5+5)
BM_StringAssignAsciiz_Huge_Transparent               331ns ± 5%              324ns ± 7%     ~             (p=0.548 n=5+5)
BM_StringAssignAsciizMix_Opaque                     13.6ns ±10%             13.7ns ± 9%     ~             (p=0.690 n=5+5)
BM_StringAssignAsciizMix_Transparent                12.9ns ± 8%              3.6ns ± 8%  -71.82%          (p=0.008 n=5+5)
```

Reviewers: EricWF, #libc!

Subscribers: jfb, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D82221
2020-06-29 14:34:34 -04:00
..
3.9
4.0
5.0 Update ABI lists after change in r333467. 2018-05-29 23:52:14 +00:00
6.0 Update ABI lists after change in r333467. 2018-05-29 23:52:14 +00:00
8.0 Add ABI list directories for 8.0 2019-02-10 04:09:46 +00:00
9.0 [libc++] Add ABI list for 9.0 release 2020-02-18 10:50:49 -05:00
CHANGELOG.TXT [libc++] Add SHA for C++20 Synchronization Library in ABI changelog 2020-03-11 16:13:13 -04:00
CMakeLists.txt [libc++] Fix the no-exceptions build of libc++ on Apple 2020-04-20 10:45:14 -04:00
README.TXT
x86_64-apple-darwin.v1.abilist [libc++] Adapt a few things around the implementation of P1135R6 2020-02-24 10:59:35 -05:00
x86_64-unknown-linux-gnu.v1.abilist [libc++] Fix CI and Linux failures after landing D68480 2020-02-24 11:58:25 -05:00

README.TXT

This directory contains abi lists representing the symbols exported
by the libc++ library. The lists are generated using sym_extract.py.

Every time a symbol is added or removed from the libc++ library each of the
lists *MUST* be updated to reflect the changes.

TODO Add more documentation about generating and using the lists.
TODO Add more documentation about the build configuration the lists are generated against.