[libcxx-commits] [PATCH] D112152: [libc++] Unroll loop in std::find_if and define other std::find variants in terms of it

Roman Lebedev via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 20 12:20:30 PDT 2021


lebedev.ri added a comment.

FWIW, this isn't my prime areal, but i can't not comment here.
Like stated in previous review, i think this is a pretty bad idea.
Here's an incomplete list of reasons:

1. This is clearly a compiler deficiency. Fixing it will benefit everyone
2. How do you know that unrolling is always beneficial? What about -Os/-Oz? What about in-order CPU's? Why unroll 4x specifically?
3. What happens with more complex predicates? The old code had a single call, now you have how many? Will this affect (prevent) inlining in some cases?
4. The old code seems straight-forward to auto-vectorize (for certain predicates), new one, uhh.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112152



More information about the libcxx-commits mailing list