forked from OSchip/llvm-project
b0945e1bd2
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. llvm-svn: 368547 |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
CartesianBenchmarks.hpp | ||
ContainerBenchmarks.hpp | ||
GenerateInput.hpp | ||
Utilities.hpp | ||
algorithms.bench.cpp | ||
algorithms.partition_point.bench.cpp | ||
allocation.bench.cpp | ||
deque.bench.cpp | ||
filesystem.bench.cpp | ||
function.bench.cpp | ||
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 | ||
vector_operations.bench.cpp |