libcxx fork for Darling build
Go to file
Eric Fiselier e7f817d01d Fix PR35637: suboptimal codegen for vector<unsigned char>.
The optimizer is petulant and temperamental. In this case LLVM failed to lower
the the "insert at end" loop used by`vector<unsigned char>` to a `memset` despite
`memset` being substantially faster over a range of bytes.

LLVM has the ability to lower loops to `memset` whet appropriate, but the
odd nature of libc++'s loops prevented the optimization from taking places.

This patch addresses the issue by rewriting the loops from the form
`do [ ... --__n; } while (__n > 0);` to instead use a for loop over a pointer
range (For example: `for (auto *__i = ...; __i < __e; ++__i)`).

This patch also rewrites the asan annotations to unposion all additional memory
at the start of the loop instead of once per iterations. This could potentially
permit false negatives where the constructor of element N attempts to access
element N + 1 during its construction.

The before and after results for the `BM_ConstructSize/vector_byte/5140480_mean`
benchmark (run 5 times) are:

--------------------------------------------------------------------------------------------
Benchmark                                                 Time             CPU   Iterations
--------------------------------------------------------------------------------------------
Before
------
BM_ConstructSize/vector_byte/5140480_mean          12530140 ns     12469693 ns            N/A
BM_ConstructSize/vector_byte/5140480_median        12512818 ns     12445571 ns            N/A
BM_ConstructSize/vector_byte/5140480_stddev          106224 ns       107907 ns            5
-----
After
-----
BM_ConstructSize/vector_byte/5140480_mean            167285 ns       166500 ns            N/A
BM_ConstructSize/vector_byte/5140480_median          166749 ns       166069 ns            N/A
BM_ConstructSize/vector_byte/5140480_stddev            3242 ns         3184 ns            5

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@367183 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-28 04:37:02 +00:00
benchmarks Fix PR35637: suboptimal codegen for vector<unsigned char>. 2019-07-28 04:37:02 +00:00
cmake Revert "[libc++] Take 2: Do not cleverly link against libc++abi just because it happens to be there" 2019-07-08 17:46:23 +00:00
docs Bump the trunk version to 10.0.0svn 2019-07-18 11:51:05 +00:00
fuzzing Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
include Fix PR35637: suboptimal codegen for vector<unsigned char>. 2019-07-28 04:37:02 +00:00
lib [libc++] Update ABI list for ABI v2 2019-06-17 19:37:26 +00:00
src [runtimes] Don't depend on libpthread on Android 2019-07-22 20:41:03 +00:00
test Fix a bug in std::chrono::abs where it would fail when the duration's period had not been reduced.s 2019-07-26 15:10:46 +00:00
utils [AIX][lit] Don't depend on psutil on AIX 2019-07-24 15:04:27 +00:00
www Update c++2a status page with post-Cologne information 2019-07-22 15:13:14 +00:00
.arcconfig [libcxx] Set up .arcconfig to point to new Diffusion CXX repository 2017-12-04 17:55:28 +00:00
.clang-format Make clang-format use C++03 syntax 2017-04-15 02:45:43 +00:00
.gitignore Implement N4606 optional 2016-10-12 07:46:20 +00:00
appveyor-reqs-install.cmd Attempt to upgrade compiler used by appveyor builds 2019-04-03 20:40:01 +00:00
appveyor.yml disable appveyor config for MSVC 2015 2019-04-03 20:36:51 +00:00
CMakeLists.txt Revert "[libc++] Integrate the PSTL into libc++" 2019-07-19 18:52:46 +00:00
CREDITS.TXT Try again, this time with the correct address 2017-12-29 19:26:53 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
NOTES.TXT Reland "Use custom command and target to install libc++ headers" 2018-06-12 03:10:02 +00:00
TODO.TXT Add list of filesystem NB comments to TODO.TXT so they can be tracked separately 2017-03-06 21:23:36 +00:00

libc++ Documentation
====================

The libc++ documentation is written using the Sphinx documentation generator. It is
currently tested with Sphinx 1.1.3.

To build the documents into html configure libc++ with the following cmake options:

  * -DLLVM_ENABLE_SPHINX=ON
  * -DLIBCXX_INCLUDE_DOCS=ON

After configuring libc++ with these options the make rule `docs-libcxx-html`
should be available.