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

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 21 10:00:34 PDT 2021


Mordante added a comment.

If the compiler isn't smart enough, how about giving it a hint?
https://clang.llvm.org/docs/LanguageExtensions.html#loop-unrolling
Adding `#pragma clang loop unroll_count(4)` to our find causes the loop to unroll
https://clang.godbolt.org/z/687793Te4


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