-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vectorize basic_string::find_first_of
#4744
Conversation
basic_string::find_first_of
basic_string::find_first_of
# Conflicts: # tests/std/tests/VSO_0000000_vector_algorithms/test.cpp
We were falling through to this.
Now that the "use the bitmap" and "couldn't use the bitmap" codepaths always return, we can positively test for "use the bitmap". This is a clarity improvement all by itself - it's easier to understand "if we can do cool thing, do it".
The assignment `_Use_bitmap = false;` is guarded by `_Try_vectorize && (STUFF)`. So when we skip using the bitmap, the later condition `if (_Try_vectorize)` is guaranteed to be active.
And silence warning C4127: conditional expression is constant.
I'm giving up the "bitmap" optimization for constexpr evaluation. Now we can mark `const bool _Try_vectorize` without harming perf.
This reverts commit 50a5599.
Avoid C4127 instead of suppressing
My experiment on having
|
This comment was marked as resolved.
This comment was marked as resolved.
It seems that we should fix The strategy may be like this: template <class>
constexpr bool _Is_std_char_traits_specialization = false;
template <class _CharT>
constexpr bool _Is_std_char_traits_specialization<char_traits<_CharT>> = _Is_EcharT<_CharT>; |
Yes, I think I can do this some time later (If you or someone else won't do it before me).
Good idea.
Also agree. |
I'm marking this PR as ready again. Turns out that STL/stl/inc/__msvc_string_view.hpp Lines 678 to 680 in 91e4255
Since it is compile-time error already, vectorization doesn't make this case any more broken. |
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
🧶 🐈⬛ 🎉 |
Resolves #4497