-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.metaissueIssue to collect references to a group of similar or related issues.Issue to collect references to a group of similar or related issues.performance
Description
There are quite a few algorithms which can be vectorized, or one should at least look into doing so. This issue lists all the algorithms which I think can be vectorized (and a few that shouldn't be with explanations).
To be vectorized:
-
find(already done partially by forwarding to{w,}memchr) -
find_end -
find_first_of(possibly not worth it, since clang does it automatically in some cases) -
adjacent_find -
mismatch- [libc++] Vectorize mismatch #73255 -
search(not checked whether it actually makes sense) -
search_n -
remove(requires efficient compressstore) -
remove_copy(requires efficient compressstore) -
unique(might require efficient compressstore) -
unique_copy(might require efficient compresstore) -
is_sorted_until -
includes -
min_element -
max_element -
minmax(range overload): Should first be checked whether it can be rewritten to allow auto-vectorization - [libc++] Optimize ranges::minmax #87335 -
minmax_element- Vectorize minmax_element. #112397 -
lexicographical_compare: Should usemismatchfor the actual vectorization, but only forward to it if it's known to vectorize -
lexicographical_compare_three_way: same aslexicographical_compare -
replace_ifautovectorized since [LV] Support generating masks for switch terminators. #99808
Should be checked whether they can be vectorized:
-
set_union -
set_intersection -
set_difference -
set_symmetric_difference -
merge -
rotateis usingmemmovewhen possible, but may make sense to optimize for small ranges
Shouldn't be vectorized:
contains: forwards tofind, which should be vectorized insteadcount: is auto-vectorizedequal: Already forwards tomemcmpfor trivially equality comparable types and doesn't seem worth it for floatsfold(and friends): is auto-vectorizedcopy(and friends): can be forwarded tomemmoveswap_ranges: is auto-vectorizedreplace(and friends): is auto-vectorizedfill(and friends): is auto-vectorizedreverse_copy: is auto-vectorizedrotate_copy: is forwarded to twomemmovecalls if possibleshift_left/shift_right: is forwarded tomemmoveif possibleis_sorted: forwards tois_sorted_until, which should be vectorized insteadmin,max(range overload): is auto-vectorizedreverse: auto-vectorized since [SCEV] Support addrec in right hand side in howManyLessThans #92560
dtcxzyw, frederick-vs-ja, mrdaybird and ldionne
Metadata
Metadata
Assignees
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.metaissueIssue to collect references to a group of similar or related issues.Issue to collect references to a group of similar or related issues.performance