[all-commits] [llvm/llvm-project] ab3d79: [libc++] Optimize ranges::move{, _backward} for vec...

Peng Liu via All-commits all-commits at lists.llvm.org
Wed Feb 19 08:37:08 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ab3d793982acb946afc2028ca41304913879c6c9
      https://github.com/llvm/llvm-project/commit/ab3d793982acb946afc2028ca41304913879c6c9
  Author: Peng Liu <winner245 at hotmail.com>
  Date:   2025-02-19 (Wed, 19 Feb 2025)

  Changed paths:
    M libcxx/docs/ReleaseNotes/21.rst
    M libcxx/include/__algorithm/move.h
    M libcxx/include/__algorithm/move_backward.h
    M libcxx/include/__bit_reference
    A libcxx/test/benchmarks/algorithms/move.bench.cpp
    A libcxx/test/benchmarks/algorithms/move_backward.bench.cpp
    M libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp
    M libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp
    M libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move.pass.cpp
    M libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move_backward.pass.cpp

  Log Message:
  -----------
  [libc++] Optimize ranges::move{,_backward} for vector<bool>::iterator (#121109)

As a follow-up to #121013 (which optimized `ranges::copy`) and #121026
(which optimized `ranges::copy_backward`), this PR enhances the
performance of `std::ranges::{move, move_backward}` for
`vector<bool>::iterator`, addressing a subtask outlined in issue #64038.

The optimizations bring performance improvements analogous to those
achieved for the `{copy, copy_backward}` algorithms: up to 2000x for
aligned moves and 60x for unaligned moves. Moreover, comprehensive
tests covering up to 4 storage words (256 bytes) with odd and even bit
sizes are provided, which validate the proposed optimizations in this
patch.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list