mirror of
https://github.com/darlinghq/darling-libcxx.git
synced 2024-11-27 05:40:48 +00:00
6cebf7c36f
This patch rewrites a few loops in deque and split_buffer to better optimize the codegen. For constructors like `deque<unsigned char> d(500000, 0);` this patch results in a 2x speedup. The patch improves the codegen in roughly three ways: 1. Changes do { ... } while (...) loops into more typical for loops. The optimizer can reason about normal looking loops better. 2. Split the iteration over a range into (A) iteration over the blocks, then (B) iteration within the block. This nested structure helps LLVM lower the inner loop to `memset`. 3. Do fewer things each iteration. Some of these loops were incrementing or changing 4-5 variables every loop (in addition to the construction). Previously most loops would increment the end pointer, the size, and decrement the count of remaining items to construct. Now we only increment a single pointer for most iterations. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368547 91177308-0d34-0410-b5e6-96231b3b80d8 |
||
---|---|---|
.. | ||
algorithms.bench.cpp | ||
algorithms.partition_point.bench.cpp | ||
allocation.bench.cpp | ||
CartesianBenchmarks.hpp | ||
CMakeLists.txt | ||
ContainerBenchmarks.hpp | ||
deque.bench.cpp | ||
filesystem.bench.cpp | ||
function.bench.cpp | ||
GenerateInput.hpp | ||
lit.cfg.py | ||
lit.site.cfg.py.in | ||
ordered_set.bench.cpp | ||
string.bench.cpp | ||
stringstream.bench.cpp | ||
unordered_set_operations.bench.cpp | ||
util_smartptr.bench.cpp | ||
Utilities.hpp | ||
vector_operations.bench.cpp |