| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Use hash value checks optimizations consistently There are couple of optimizations of __hash_table::find which are applicable to other places like __hash_table::__node_insert_unique_prepare and __hash_table::__emplace_unique_key_args. for (__nd = __nd->__next_; __nd != nullptr && (__nd->__hash() == __hash // ^^^^^^^^^^^^^^^^^^^^^^ // (1) || std::__constrain_hash(__nd->__hash(), __bc) == __chash); __nd = __nd->__next_) { if ((__nd->__hash() == __hash) // ^^^^^^^^^^^^^^^^^^^^^^^^^^ // (2) && key_eq()(__nd->__upcast()->__value_, __k)) return iterator(__nd, this); } (1): We can avoid expensive modulo operations from std::__constrain_hash if hashes matched. This one is from commit 6a411472e3c4. (2): We can avoid key_eq calls if hashes didn't match. Commit: 318d35a7bca6c4e5. Both of them are applicable for insert and emplace methods. Results of unordered_set_operations benchmark: Comparing /tmp/main to /tmp/hashtable-hash-value-optimization Benchmark Time CPU Time Old Time New CPU Old CPU New ------------------------------------------------------------------------------------------------------------------------------------------------------ BM_Hash/uint32_random_std_hash/1024 -0.0127 -0.0127 1511 1492 1508 1489 BM_Hash/uint32_random_custom_hash/1024 +0.0012 +0.0013 1370 1371 1367 1369 BM_Hash/uint32_top_std_hash/1024 -0.0027 -0.0028 1502 1497 1498 1494 BM_Hash/uint32_top_custom_hash/1024 +0.0033 +0.0032 1368 1373 1365 1370 BM_InsertValue/unordered_set_uint32/1024 +0.0267 +0.0266 36421 37392 36350 37318 BM_InsertValue/unordered_set_uint32_sorted/1024 +0.0230 +0.0229 28247 28897 28193 28837 BM_InsertValue/unordered_set_top_bits_uint32/1024 +0.0492 +0.0491 31012 32539 30952 32472 BM_InsertValueRehash/unordered_set_top_bits_uint32/1024 +0.0523 +0.0520 62905 66197 62780 66043 BM_InsertValue/unordered_set_string/1024 -0.0252 -0.0253 300762 293189 299805 292221 BM_InsertValueRehash/unordered_set_string/1024 -0.0932 -0.0920 332924 301882 331276 300810 BM_InsertValue/unordered_set_prefixed_string/1024 -0.0578 -0.0577 314239 296072 313222 295137 BM_InsertValueRehash/unordered_set_prefixed_string/1024 -0.0986 -0.0985 336091 302950 334982 301995 BM_Find/unordered_set_random_uint64/1024 -0.1416 -0.1417 16075 13798 16041 13769 BM_FindRehash/unordered_set_random_uint64/1024 -0.0105 -0.0105 5900 5838 5889 5827 BM_Find/unordered_set_sorted_uint64/1024 +0.0014 +0.0014 2813 2817 2807 2811 BM_FindRehash/unordered_set_sorted_uint64/1024 -0.0247 -0.0249 5863 5718 5851 5706 BM_Find/unordered_set_sorted_uint128/1024 +0.0113 +0.0112 15570 15746 15539 15713 BM_FindRehash/unordered_set_sorted_uint128/1024 +0.0438 +0.0441 6917 7220 6902 7206 BM_Find/unordered_set_sorted_uint32/1024 -0.0020 -0.0020 3098 3091 3092 3085 BM_FindRehash/unordered_set_sorted_uint32/1024 +0.0570 +0.0569 5377 5684 5368 5673 BM_Find/unordered_set_sorted_large_uint64/1024 +0.0081 +0.0081 3594 3623 3587 3616 BM_FindRehash/unordered_set_sorted_large_uint64/1024 -0.0542 -0.0540 6154 5820 6140 5808 BM_Find/unordered_set_top_bits_uint64/1024 -0.0061 -0.0061 10440 10377 10417 10353 BM_FindRehash/unordered_set_top_bits_uint64/1024 +0.0131 +0.0128 5852 5928 5840 5914 BM_Find/unordered_set_string/1024 -0.0352 -0.0349 189037 182384 188389 181809 BM_FindRehash/unordered_set_string/1024 -0.0309 -0.0311 180718 175142 180141 174532 BM_Find/unordered_set_prefixed_string/1024 -0.0559 -0.0557 190853 180177 190251 179659 BM_FindRehash/unordered_set_prefixed_string/1024 -0.0563 -0.0561 182396 172136 181797 171602 BM_Rehash/unordered_set_string_arg/1024 -0.0244 -0.0241 27052 26393 26989 26339 BM_Rehash/unordered_set_int_arg/1024 -0.0410 -0.0410 19582 18779 19539 18738 BM_InsertDuplicate/unordered_set_int/1024 +0.0023 +0.0025 12168 12196 12142 12173 BM_InsertDuplicate/unordered_set_string/1024 -0.0505 -0.0504 189238 179683 188648 179133 BM_InsertDuplicate/unordered_set_prefixed_string/1024 -0.0989 -0.0987 198893 179222 198263 178702 BM_EmplaceDuplicate/unordered_set_int/1024 -0.0175 -0.0173 12674 12452 12646 12427 BM_EmplaceDuplicate/unordered_set_string/1024 -0.0559 -0.0557 190104 179481 189492 178934 BM_EmplaceDuplicate/unordered_set_prefixed_string/1024 -0.1111 -0.1110 201233 178870 200608 178341 BM_InsertDuplicate/unordered_set_int_insert_arg/1024 -0.0747 -0.0745 12993 12022 12964 11997 BM_InsertDuplicate/unordered_set_string_insert_arg/1024 -0.0584 -0.0583 191489 180311 190864 179731 BM_EmplaceDuplicate/unordered_set_int_insert_arg/1024 -0.0807 -0.0804 35946 33047 35866 32982 BM_EmplaceDuplicate/unordered_set_string_arg/1024 -0.0312 -0.0310 321623 311601 320559 310637 OVERALL_GEOMEAN -0.0276 -0.0275 0 0 0 0 Time differences looks more like noise to me. But if we want to have this optimizations in find, we probably want them in insert and emplace as well. Reviewed By: #libc, Mordante Differential Revision: https://reviews.llvm.org/D140779 | 2 年前 | |
[libc++][hardening] Remove hardening from release notes, undeprecate safe mode This patch effectively maintains the status quo, making sure that the safe mode keeps working the same way as before. Hardening will target the next major release, allowing it to go through RFC and for the implementation to stabilize and mature. Differential Revision: https://reviews.llvm.org/D159171 | 2 年前 | |
[libc++][hardening] Remove hardening from release notes, undeprecate safe mode This patch effectively maintains the status quo, making sure that the safe mode keeps working the same way as before. Hardening will target the next major release, allowing it to go through RFC and for the implementation to stabilize and mature. Differential Revision: https://reviews.llvm.org/D159171 | 2 年前 | |
Bump version to 17.0.6 | 2 年前 | |
[libc++] Remove symbols for a std::allocator_arg & friends from the dylib This patch removes the symbols defined in the library for std::allocator_arg, std::defer_lock, std::try_to_lock, std::adopt_lock, and std::piecewise_construct. Those were defined in the library because we provided them in C++03 as an extension, and in C++03 it was impossible to define them as constexpr variables, like in the spec. This is technically an ABI break since we are removing symbols from the library. However, in practice, only programs compiled in C++03 mode who take the address of those objects (or pass them as a reference) will have an undefined ref to those symbols. In practice, this is expected to be rare. First, those are C++11 features that we happen to provide in C++03, and only the C++03 definition can potentially lead to code referencing the dylib definition. So any code that is using these objects but compiling in C++11 mode (as they should) is not at risk. Second, all uses of these types in the library is done by passing those types by value to a function that can get inlined. Since they are empty types, the compiler won't generate an undefined reference if passed by value, since there's nothing to pass anyway. Long story short, the risk for code actually containing an undefined reference to one of these types is rather small (but non-zero). I also couldn't find any app on the App Store that referenced these symbols, which supports my impression that this won't be an issue in practice. Differential Revision: https://reviews.llvm.org/D145587 | 3 年前 | |
[libc++][modules] Fixes exporting named declarations. @ChuanqiXu noticed std::atomic was not properly exported in the std module. Investigation showed other named declarations were not exported either. This fixes the issue. Depends on D156550 Reviewed By: #libc, philnik Differential Revision: https://reviews.llvm.org/D156592 (cherry picked from commit e57f6f709ed2ebef7852bebb47baaf202962b4ee) | 2 年前 | |
[libc++] Fix GNU/Hurd build GNU/Hurd does have clock_gettime, it just doesn't define _POSIX_TIMERS because its support for timers is not complete. Reviewed By: #libc, Mordante Differential Revision: https://reviews.llvm.org/D158584 (cherry picked from commit 1cfcc36812ff7857567f7c729c22ae0e2be0fb3a) | 2 年前 | |
[libc++] Use correct size for deallocation of arrays in shared_ptr (#68233) Fixes #68051. Current implementation passes the number of _AlignedStorage objects when it calls to allocate and the number of **bytes** on deallocate. This only applies to allocations that allocate control block and the storage together, i.e. make_shared and allocate_shared. Found by ASan under Clang combined with -fsized-deallocation. (cherry picked from commit f722db02d359e29ca001b78197ee1a275f8c3d7c) | 2 年前 | |
eliminate python SyntaxWarnings from check-all output. src_dir/clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py:28: SyntaxWarning: invalid escape sequence '\*' self.implementationContent += """ src_dir/llvm/utils/lit/lit/TestRunner.py:205: SyntaxWarning: invalid escape sequence '\c' """ src_dir/llvm/utils/lit/lit/TestRunner.py:1561: SyntaxWarning: invalid escape sequence '\s' match = _caching_re_compile("^\s*%else\s*(%{)?").search(ln) src_dir/libcxx/utils/libcxx/test/format.py:64: SyntaxWarning: invalid escape sequence '\s' for output in re.split('[$]\s*":"\s*"RUN: at line \d+"', fullOutput): src_dir/libcxx/utils/libcxx/test/params.py:121: SyntaxWarning: invalid escape sequence '\+' AddSubstitution("%{cxx_std}", re.sub("\+", "x", std)), src_dir/libcxx/utils/libcxx/test/params.py:214: SyntaxWarning: invalid escape sequence '\+' AddFeature("stdlib=libc++") if re.match(".+-libc\+\+", stdlib) else None, src_dir/compiler-rt/test/lit.common.cfg.py:800: SyntaxWarning: invalid escape sequence '\$' "-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec" src_dir/compiler-rt/test/lit.common.cfg.py:809: SyntaxWarning: invalid escape sequence '\$' "-Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix, src_dir/compiler-rt/test/lit.common.cfg.py:817: SyntaxWarning: invalid escape sequence '\$' "-Wl,-R\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix, src_dir/llvm/test/lit.cfg.py:275: SyntaxWarning: invalid escape sequence '\d' match = re.search("release (\d+)\.(\d+)", ptxas_out) | 2 年前 | |
[libc++] Fix thread annotations on shared_mutex and shared_timed_mutex Based on the comment in https://reviews.llvm.org/D54290#4418958, these attributes need to be on the top-level functions in order to work properly. Also, add tests. Fixes http://llvm.org/PR57035. Differential Revision: https://reviews.llvm.org/D154354 | 2 年前 | |
[libc++] Fix template parameter naming and enforce it through readability-identifier-naming Reviewed By: #libc, Mordante Spies: Mordante, aheejin, libcxx-commits Differential Revision: https://reviews.llvm.org/D156059 | 2 年前 | |
[libcxx] Fix .gitignore to not exclude test directories We have several test directories whose names end in .spec. Ensure we don't accidentally ignore them by removing a section of the .gitignore that's irrelevant for libc++. Differential Revision: https://reviews.llvm.org/D69195 | 6 年前 | |
[libc++][hardening] Remove hardening from release notes, undeprecate safe mode This patch effectively maintains the status quo, making sure that the safe mode keeps working the same way as before. Hardening will target the next major release, allowing it to go through RFC and for the implementation to stabilize and mature. Differential Revision: https://reviews.llvm.org/D159171 | 2 年前 | |
[libcxx] Add mdspan/extents This patch adds std::extents. extents is one of the core classes used by std::mdspan. It describes a multi-dimensional index space with a mix of compile time and runtime sizes. Furthermore, it is templated on the index type used to describe the multi-dimensional index space. The class is designed to be highly optimizable in performance critical code sections, and is fully useable in constant expressions contexts. Testing of this class tends to be somewhat combinatorical, due to the large number of possible corner cases involved in situations where we have both runtime and compile time extents. To add to this, the class is designed to be interoperable (in particular constructible) from arguments which only need to be convertible to the index_type, but are otherwise arbitrary user types. For a larger discussion on the design of this class refer to: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html Co-authored-by: Damien L-G <dalg24@gmail.com> Reviewed By: ldionne, #libc Spies: libcxx-commits, H-G-Hristov, tschuett, philnik, arichardson, Mordante, crtrott Differential Revision: https://reviews.llvm.org/D148067 | 3 年前 | |
Fix typos throughout the license files that somehow I and my reviewers all missed! Thanks to Alex Bradbury for pointing this out, and the fact that I never added the intended legacy anchor to the developer policy. Add that anchor too. With hope, this will cause the links to all resolve successfully. llvm-svn: 351731 | 7 年前 | |
[libc++] Disallow volatile types in std::allocator LWG 2447 is marked as Complete, but there is no static_assert to reject volatile types in std::allocator. See the discussion at https://reviews.llvm.org/D108856. Add static_assert in std::allocator to disallow volatile types. Since this is an implementation choice, mark the binding test as libc++ only. Remove tests that use containers backed by std::allocator that test the container when used with a volatile type. Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D109056 | 4 年前 | |
Attempt to upgrade compiler used by appveyor builds llvm-svn: 357632 | 7 年前 | |
[libc++] Re-apply "Always build c++experimental.a"" This re-applies bb939931a1ad, which had been reverted by 09cebfb978de because it broke Chromium. The issues seen by Chromium should be addressed by 1d0f79558ca4. Differential Revision: https://reviews.llvm.org/D128927 | 3 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 6 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 7 年前 | ||
| 4 年前 | ||
| 7 年前 | ||
| 3 年前 |