[libcxx-commits] [PATCH] D143596: [libc++] Optimize std::ranges::{min, max} for types that are cheap to copy

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 9 08:31:02 PST 2023


ldionne accepted this revision.
ldionne added a comment.
This revision is now accepted and ready to land.

> Don't forward to min_element for small types that are trivially copyable. This allows the compiler to vectorize the loop in some cases.

I think this would be clearer:

> Don't forward to min_element for small types that are trivially copyable, and instead use a naive loop that keeps track of the smallest element (as opposed to an iterator to the smallest element). This allows the compiler to vectorize the loop in some cases.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143596/new/

https://reviews.llvm.org/D143596



More information about the libcxx-commits mailing list