- 27 Feb, 2024 2 commits
-
-
Optimize `absl::Duration` division and modulo: Allow the compiler to inline `time_internal::IDivDuration`, by splitting the slow path to a separate function. With that change, the compiler can inline the fast path. This is specially important in the context of `Duration::operator%=`, because it allows proving that the return value is unused, therefore avoiding expensive multiplies and divides (e.g. `*q = num_hi / den_hi;`). ``` name old cpu/op new cpu/op delta BM_Duration_Modulo 23.1ns ± 0% 22.5ns ± 0% -2.42% (p=0.000 n=20+16) BM_Duration_Modulo_FastPath 7.05ns ± 0% 4.85ns ± 0% -31.17% (p=0.000 n=20+20) name old time/op new time/op delta BM_Duration_Modulo 23.1ns ± 0% 22.6ns ± 0% -2.43% (p=0.000 n=20+16) BM_Duration_Modulo_FastPath 7.06ns ± 0% 4.86ns ± 0% -31.18% (p=0.000 n=20+20) name old INSTRUCTIONS/op new INSTRUCTIONS/op delta BM_Duration_Modulo 188 ± 0% 178 ± 0% -5.32% (p=0.000 n=20+20) BM_Duration_Modulo_FastPath 84.0 ± 0% 62.0 ± 0% -26.19% (p=0.000 n=20+20) name old CYCLES/op new CYCLES/op delta BM_Duration_Modulo 73.8 ± 0% 72.1 ± 0% -2.27% (p=0.000 n=19+20) BM_Duration_Modulo_FastPath 22.5 ± 0% 15.5 ± 0% -31.13% (p=0.000 n=19+20) ``` Note: We don't need to expose `absl::time_internal::IDivDuration` at all given that we have a public `absl::IDivDuration`. PiperOrigin-RevId: 610710635 Change-Id: Ief7c3d5b1c000b397d931e9249edcaef96e7151e
Abseil Team committed -
PiperOrigin-RevId: 610672905 Change-Id: I8e4ae98bb6e6421540a3073e3e6cb7de60fd32a9
Abseil Team committed
-
- 26 Feb, 2024 1 commit
-
-
PiperOrigin-RevId: 610398878 Change-Id: Iec7570af855b61ad49faba1d29fdf41674a9bd50
Abseil Team committed
-
- 23 Feb, 2024 2 commits
-
-
The current version violates the Google C++ style guide - see https://google.github.io/styleguide/cppguide.html#Formatting_Looping_Branching. This code does not fit into the historical exception that "the curly braces for the controlled statement or the line breaks inside the curly braces may be omitted if as a result the entire statement appears on either a single line (in which case there is a space between the closing parenthesis and the controlled statement) or on two lines (in which case there is a line break after the closing parenthesis and there are no braces)." PiperOrigin-RevId: 609789188 Change-Id: Id7ae9596e454dac5581d19939564c07670077f92
Evan Brown committed -
Optimize `prepare_insert`, when resize happens. It removes single unnecessary probing before resize that is beneficial for small tables the most. PiperOrigin-RevId: 609547787 Change-Id: If6584919b4c93945ea078b1c1a9f57b355dce924
Vitaly Goldshteyn committed
-
- 22 Feb, 2024 2 commits
-
-
This resolves a couple of Clang Tidy performance warnings. PiperOrigin-RevId: 609394317 Change-Id: Ibebc7e3f7121355b8660284e18c110bb9171d61c
Abseil Team committed -
PiperOrigin-RevId: 609351346 Change-Id: I40f44d42efe65fd8ca1a441e69a0769c87938b20
Abseil Team committed
-
- 21 Feb, 2024 4 commits
-
-
PiperOrigin-RevId: 609064443 Change-Id: Ifaeb53ae2d50bcef1ef6f67e662173b59c3fb8a2
Abseil Team committed -
PiperOrigin-RevId: 609058024 Change-Id: I2f7cc2daf862e7e2d23acd6dd3fe85cb1945d5f0
Evan Brown committed -
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1618 I noticed while working on #1615 that `inlined_vector` could use the trivial relocatability trait here, too. Here the memcpy codepath already exists; we just have to opt in to using it. Merge 567a1dd9b6b3352f649e900b24834b59e39cfa14 into a7012a5b Merging this change closes #1618 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1618 from Quuxplusone:trivial-swap 567a1dd9b6b3352f649e900b24834b59e39cfa14 PiperOrigin-RevId: 609019296 Change-Id: I4055ab790245752179e405b490fcd479e7389726
Arthur O'Dwyer committed -
PiperOrigin-RevId: 608947694 Change-Id: Ie53a91c4d78dcb80c57227616b488ec64b23c588
Abseil Team committed
-
- 20 Feb, 2024 5 commits
-
-
PiperOrigin-RevId: 608770171 Change-Id: Icca54086037e42826c272f04374aeb33d060ace5
Abseil Team committed -
Motivation: the implementation becomes more complicated with small object optimization. PiperOrigin-RevId: 608742838 Change-Id: I55fc42321b1967f9c7bbee49817a2f2d4ee44b56
Evan Brown committed -
PiperOrigin-RevId: 608705933 Change-Id: I9c11d8d8b3d9057bdf215863210f450332cf56cb
Derek Mauro committed -
PiperOrigin-RevId: 608661989 Change-Id: Ibfd94f8b2d23fd232bf93904ed68e11a400b3644
Abseil Team committed -
This often indicates a bug from adding synchronization logic but not using it. PiperOrigin-RevId: 608600311 Change-Id: I48bc3ae18b1e9a00b5e2152f33b486cd6be324a1
Chris Kennelly committed
-
- 17 Feb, 2024 1 commit
-
-
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1625 Trivial relocatability also requires that the type not do anything weird with its assignment operator; update the type-trait to reflect this. (This is the definition used by BSL, Folly, HPX, Thrust, Parlay, Amadeus, and P1144.) This is important if we want to use `absl::is_trivially_relocatable` as a gate for memcpy optimizations in `inlined_vector::erase` and/or `inlined_vector::swap`, because in those cases relocation is used to replace part of a sequence involving assignment; the optimization requires an assignment operator that behaves value-semantically. Clang's builtin currently fails to check the assignment operator, so we stop using it entirely for now. We already refused to use it on Win32, Win64, and Apple, for various unrelated reasons. I'm working on giving Clang's builtin the behavior that would let us re-enable it here. Assume that any compiler providing both `__cpp_impl_trivially_relocatable` and a builtin `__is_trivially_relocatable(T)` will use the appropriate (P1144) definition for its builtin. Right now there's only one such compiler (the P1144 reference implementation, which forks Clang), so this is largely a moot point, but I'm being optimistic. Merge d943abdbabc1b7080aa5f0a2fff3e724135164dc into 34604d5b Merging this change closes #1625 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1625 from Quuxplusone:trivially-relocatable d943abdbabc1b7080aa5f0a2fff3e724135164dc PiperOrigin-RevId: 607977323 Change-Id: I6436a60326c6d1064bdd71ec2e15b86b7a29efd4
Arthur O'Dwyer committed
-
- 16 Feb, 2024 2 commits
-
-
It can be used instead of `MaskEmptyOrDeleted` in case of inserting to empty table. `MaskNonFull` requires less operations, in particular it eliminates `_mm_set1_epi8` and `_mm_cmpgt_epi8` operations. PiperOrigin-RevId: 607587394 Change-Id: Ia48f922d1ca6de38cc91e7ab0d608c45f8f2c446
Abseil Team committed -
These were described in https://github.com/itanium-cxx-abi/cxx-abi/pull/85 and implemented by LLVM. PiperOrigin-RevId: 607555558 Change-Id: I9991ac88c1fcf63b25b93d93977a83ca343cdb5d
Dino Radakovic committed
-
- 15 Feb, 2024 1 commit
-
-
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1617 The intrinsics used aren't available on `x86_64` processors while running in 32-bit mode. See: - list of 64-bit intrinsics (https://learn.microsoft.com/en-us/cpp/intrinsics/x64-amd64-intrinsics-list?view=msvc-170) - list of 32-bit intrinsics (https://learn.microsoft.com/en-us/cpp/intrinsics/x86-intrinsics-list?view=msvc-170) - list of predefined MSVC macros (https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170) The error message in question: ```console F:\dev\opentrack-depends\onnxruntime-build\msvc\_deps\abseil_cpp-src\absl/crc/internal/crc32_x86_arm_combined_simd.h(145,32): error C3861: '_mm_crc32_u64': identifier not found return static_cast<uint32_t>(_mm_crc32_u64(crc, v)); ^ F:\dev\opentrack-depends\onnxruntime-build\msvc\_deps\abseil_cpp-src\absl/crc/internal/crc32_x86_arm_combined_simd.h(193,50): error C3861: '_mm_cvtsi128_si64': identifier not found inline int64_t V128_Low64(const V128 l) { return _mm_cvtsi128_si64(l); } ``` Merge 06f5832108a2b01e0a900db51e1c870f7069a1f2 into 797501d1 Merging this change closes #1617 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1617 from sthalik:pr/fix-msvc-32-bit-avx 06f5832108a2b01e0a900db51e1c870f7069a1f2 PiperOrigin-RevId: 607483370 Change-Id: Id2a6f6dd33c2707fe7ffe134e7335916f3fb9da3
Stanislaw Halik committed
-
- 14 Feb, 2024 3 commits
-
-
PiperOrigin-RevId: 607095897 Change-Id: I077857f0b4c5cf8bbc62bfc8e51a20bb6845296c
Abseil Team committed -
Strings larger than 1 GiB on a platform with a 32-bit size_t could potentially overflow size_t in `CEscapedLength()`, resulting in an undersized allocation. The resulting write in `CEscapeAndAppendInternal()` would then write beyond the bounds of the output buffer. A second overflow, where the calculated escaped length is added to the size of the string being appended to, is also fixed. In both cases the program will now abort prior to the overflow. Credit goes to Ronald Crane (Zippenhop LLC) for reporting this issue. PiperOrigin-RevId: 607019573 Change-Id: I97bf246cde96102a793d2db49446cccae08abf59
Derek Mauro committed -
The optional single template argument for built-in types is not documented in LLVM's comments that list the grammar, but it is [intentionally implemented](https://github.com/llvm/llvm-project/commit/4bc4d51c18d5c087dfbdad1753c84bba8dbf3be0). PiperOrigin-RevId: 606843797 Change-Id: Ib5ef1983812e9ea68a39fe64b87b6ad6ce81b93c
Dino Radakovic committed
-
- 13 Feb, 2024 2 commits
-
-
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1412 In Clang, an `-Xarch_` compiler flag indicates that its successor only applies to the specified platform (e.g., `-Xarch_x86_64 -maes`). This is used in `absl/copts/AbseilConfigureCopts.cmake` to selectively enable hardware AES support on Apple platforms. However, when generating pkg-config files, those `-m` flags are filtered out, while the `-Xarch_` flags that precede them are left untouched. This led to the error reported in #1408. Fix that by filtering out each `-Xarch_` flag with its successor at once. Fixes #1408. Merge 89d20ab816b7cead56f05d5a6bc5146d1c4f4335 into 34604d5b Merging this change closes #1412 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1412 from ZhongRuoyu:xarch-pkgconfig 89d20ab816b7cead56f05d5a6bc5146d1c4f4335 PiperOrigin-RevId: 606730193 Change-Id: I3e177a56721acd3145fd03c64102741898afd2a5
Ruoyu Zhong committed -
This function copies the parser's state onto the stack in order to perform backtracking. Adding a complexity guard will ensure that it fails gracefully, instead of contributing to excessive consumption of stack space. PiperOrigin-RevId: 606720511 Change-Id: I2f6f03e5f8bc4cc571a4159ecfc2af6f3e00fa68
Dino Radakovic committed
-
- 12 Feb, 2024 2 commits
-
-
absl::kuint128max should be replaced with absl::Uint128Max() PiperOrigin-RevId: 606279299 Change-Id: Ib67b5431f14891f56bb706e62f183d0de75d335f
Derek Mauro committed -
This allows us to annotate nontrivial types that should be flagged as unused variables. Compilers otherwise ignore nontrivial variables as their constructors/destructors may be desired and intentional (for example, a scoped lock). PiperOrigin-RevId: 606266618 Change-Id: I64b5f6d32a3cec2f18e0aa9029905f5e836c11a9
Chris Kennelly committed
-
- 10 Feb, 2024 1 commit
-
-
For example, this covers the following: ``` template <typename T> requires std::integral<T> int foo(); ``` Refactor parsing of `Q <requires-clause expr>` into a single function that performs backtracking to avoid reimplementing `ParseTemplateArgs` in terms of nested if-else blocks. PiperOrigin-RevId: 605785418 Change-Id: I118998a75e050dcf46af125b613b690312fd3cbeDino Radakovic committed
-
- 09 Feb, 2024 3 commits
-
-
The Apple implementation gives false positives starting with Xcode 15. PiperOrigin-RevId: 605726702 Change-Id: I2e5e574eca08071d24e97304f005cf9c78230913
Abseil Team committed -
These clauses show up in other places that end up mangled as parts of function signatures (e.g. on template struct params). We'll handle those in a follow-up. PiperOrigin-RevId: 605694497 Change-Id: I1bfe4c0cfaa739fdd24548b1547482410c92b5a7
Dino Radakovic committed -
PiperOrigin-RevId: 605460827 Change-Id: I57007a7ad18829e7bfed27ba65871afbd227d012
Abseil Team committed
-
- 08 Feb, 2024 4 commits
-
-
`demangle`: Parse C++20-compatible template param declarations, except those with `requires` expressions Support for `requires` expressions will be added in a follow-up. PiperOrigin-RevId: 605418370 Change-Id: I2c84cdf0c4599e36683b3c94dcbb173ab4fc3ee8
Dino Radakovic committed -
This macro is used by a Google-internal service for automated refactoring. It is being released so that Google projects that use this service can also open-source their code that uses it. PiperOrigin-RevId: 605322286 Change-Id: I16babcc56c454e07461690a8bb58be5da72d283f
Derek Mauro committed -
PiperOrigin-RevId: 605288522 Change-Id: Id16ad96b9323c71bd60801a6c8c359f7ff3d320e
Abseil Team committed -
PiperOrigin-RevId: 605125821 Change-Id: I2ee260eaf283acafd80abfd2b7419a0e9f597a78
Matt Kulukundis committed
-
- 07 Feb, 2024 5 commits
-
-
Avoid hash computation and `Group::Match` in small tables copy and use `IterateOverFullSlots` for iterating for all tables. PiperOrigin-RevId: 605116090 Change-Id: Ia65c664421f7630225b00f1c45c636b4681121ce
Abseil Team committed -
Throughput of the 64 byte chunk loop inside `LowLevelHash` (or now in `LowLevelHashLenGt16`) gets limited by the loop carried dependency on `current_state`. By using 4 states instead of 2, we can reduce this duration by 1 cycle. On Skylake, it is reduced from 9 cycles to 8 cycles (12.5% faster asymptotically). To see the reduction in a simplified version of `LowLevelHash` implementation on Skylake: * Before: https://godbolt.org/z/Tcj9vsGax, llvm-mca (https://godbolt.org/z/3o78Msr63) shows 9 cycles / iteration. * After: https://godbolt.org/z/q4GM4EjPr, llvm-mca (https://godbolt.org/z/W5d1KEMzq) shows 8 cycles / iteration. * This CL is removing 1 xor (1 cycle) per iteration from the critical path. A block for 32 byte chunk is also added. Finally, just before returning, `Mix` is called 1 time instead of twice. PiperOrigin-RevId: 605090653 Change-Id: Ib7517ebb8bef7484066cd14cf41a943953e93377
Shahriar Rouf committed -
PiperOrigin-RevId: 605030710 Change-Id: Id273d0ff79ebff4f753a4ca9818e2b53661d6fee
Abseil Team committed -
`char_traits<>` implementation, recently removed from `libc++`. PiperOrigin-RevId: 605023824 Change-Id: Ia708c91c24625afc4504fa77e959f8ed1e025589
Bogdan Graur committed -
SwissTable provides support for heterogeneous lookup in associative containers through transparent Hash and Eq types. However, it is not possible for user types to provide additional specializations to allow their types to use this functionality. This CL brings ability for user types to specify their own transparent absl_container_hash and (optionally) absl_container_eq inner types to achieve the same functionality. PiperOrigin-RevId: 604994859 Change-Id: I302486d292c9a18b7d4c77033227008f5539e354
Dennis Kormalev committed
-