{{ message }}
fix #6294 missing bytesize check for safe vectorization with LLVM#1
Closed
mgovers wants to merge 1 commit into
Closed
fix #6294 missing bytesize check for safe vectorization with LLVM#1mgovers wants to merge 1 commit into
mgovers wants to merge 1 commit into
Conversation
… LLVM Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes microsoft#6294
Here's my attempt at excluding odd-sized and large-sized structs from the vectorization in
xutility. I have tried to follow all the conventions used elsewhere as much as possible, in particular:_Equal_memcmp_is_safeas the currentmainimplementation of_Vector_alg_in_find_is_safewas not tested in the first place. I still opted to add a couple more tests than for_Vector_alg_in_search_is_safeto at the very least show that there's vectorization for MSVC and not only for Clang_Vector_alg_in_search_is_safealready had a similar check as what was needed here, I re-used that one (had to move it outside the#ifdefstatement, though)_VECTORIZED_FIND,static_assert(false, "unexpected size");,_vectorized(and_Nx <= 8 && (_Nx & (_Nx - 1)) == 0to see if there were other cases that I missed. I believe (and hope) I got them all (at least inalgorithmandxutility).MINMAX-like things, because they are independently explicitly guarded where they are used.Additional remarks/open questions
<xutility>: std::find no longer compiles with structs with defaulted equality comparison with Clang-CL microsoft/STL#6294 ?For performance-sensitive code (e.g. containers and algorithms) you may wish to write and/or run benchmarks, and the STL team will likely run any benchmarks we do have in our PR process.)