[libcxx-commits] [libcxx] [libc++] Optimize std::find if types are integral (PR #70345)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 26 09:37:38 PDT 2023


https://github.com/ldionne commented:

Overall I think this makes sense, but it's tricky so we really need some tests.

Also, this is the kind of stuff that I would really expect something like Clang IR to render completely obsolete (along with most of the `memchr`-related optimizations, I guess). But we're not there yet I guess.

CC @bcardosolopes for awareness -- we have a bunch of these optimizations where we try to lower things like `std::find(char*, char*, char)` to a call to `memchr`, and we're thinking that Clang IR might make it easy for the compiler to understand that this optimization is possible without us telling it. In case you have thoughts about this, we'd love to hear them.

https://github.com/llvm/llvm-project/pull/70345


More information about the libcxx-commits mailing list