diff options
author | Peng Liu <winner245@hotmail.com> | 2025-06-18 12:22:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-18 12:22:47 -0400 |
commit | 9827440f1e723423baf4c235e844eb8ac48a8f97 (patch) | |
tree | 447ad93af0f45011cb004b92bd52c8782967a662 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | dd40c460c42d075c47f0d1a6d83f129655eafe10 (diff) | |
download | llvm-9827440f1e723423baf4c235e844eb8ac48a8f97.zip llvm-9827440f1e723423baf4c235e844eb8ac48a8f97.tar.gz llvm-9827440f1e723423baf4c235e844eb8ac48a8f97.tar.bz2 |
[libc++] Optimize ranges::{for_each, for_each_n} for segmented iterators (#132896)
Previously, the segmented iterator optimization was limited to `std::{for_each, for_each_n}`. This patch
extends the optimization to `std::ranges::for_each` and `std::ranges::for_each_n`, ensuring consistent
optimizations across these algorithms. This patch first generalizes the `std` algorithms by introducing
a `Projection` parameter, which is set to `__identity` for the `std` algorithms. Then we let the `ranges`
algorithms to directly call their `std` counterparts with a general `__proj` argument. Benchmarks
demonstrate performance improvements of up to 21.4x for ``std::deque::iterator`` and 22.3x for
``join_view`` of ``vector<vector<char>>``.
Addresses a subtask of #102817.
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions