1. 27 Feb, 2024 2 commits
    • Optimize `absl::Duration` division and modulo: Allow the compiler to inline… · bde089f9
      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
    • Fix typo in example code snippet. · 90ebb6fc
      PiperOrigin-RevId: 610672905
      Change-Id: I8e4ae98bb6e6421540a3073e3e6cb7de60fd32a9
      Abseil Team committed
  2. 26 Feb, 2024 1 commit
  3. 23 Feb, 2024 2 commits
  4. 22 Feb, 2024 2 commits
  5. 21 Feb, 2024 4 commits
  6. 20 Feb, 2024 5 commits
  7. 17 Feb, 2024 1 commit
    • PR #1625: absl::is_trivially_relocatable now respects assignment operators · 14b8a4ea
      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
  8. 16 Feb, 2024 2 commits
  9. 15 Feb, 2024 1 commit
  10. 14 Feb, 2024 3 commits
  11. 13 Feb, 2024 2 commits
    • PR #1412: Filter out `-Xarch_` flags from pkg-config files · 0a362eb2
      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
    • `demangle`: Add complexity guard to `ParseQRequiresExpr` · 4ea6e47c
      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. 12 Feb, 2024 2 commits
  13. 10 Feb, 2024 1 commit
  14. 09 Feb, 2024 3 commits
  15. 08 Feb, 2024 4 commits
  16. 07 Feb, 2024 5 commits