[libcxx-commits] [PATCH] D132505: [libc++] Refactor deque::iterator algorithm optimizations

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 23 15:00:28 PDT 2022


philnik created this revision.
philnik added reviewers: ldionne, Mordante, var-const, huixie90.
Herald added a subscriber: mgorny.
Herald added a project: All.
philnik requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This has multiple benefits:

- The optimizations are also performed for the `ranges::` versions of the algorithms
- Code duplication has been reduced
- it is simpler to add this optimization for other segmented iterators, like ranges::join_view::iterator
- Algorithm code is removed from `<deque>`

Also fix ranges::move with contiguous iterators and non-iterator sentinels as a drive-by.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132505

Files:
  libcxx/include/CMakeLists.txt
  libcxx/include/__algorithm/copy.h
  libcxx/include/__algorithm/copy_backward.h
  libcxx/include/__algorithm/move.h
  libcxx/include/__algorithm/move_backward.h
  libcxx/include/__iterator/segmented_iterator.h
  libcxx/include/deque
  libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy.pass.cpp
  libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_backward.pass.cpp
  libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move.pass.cpp
  libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move_backward.pass.cpp
  libcxx/test/support/test_iterators.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132505.454977.patch
Type: text/x-patch
Size: 70904 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220823/c8e1538d/attachment-0001.bin>


More information about the libcxx-commits mailing list