25 Commits

Author SHA1 Message Date
Brad Smith
55632404bd
[benchmark] Sync a few commits from upstream to help with CPU count (#126410)
Try to use the _SC_NPROCESSORS_ONLN sysconf elsewhere
(cherry picked from commit edb1e76d8cb080a396c7c992e5d4023e1a777bd1)

Replace usage of deprecated sysctl on macOS
(cherry picked from commit faaa266d33ff203e28b31dd31be9f90c29f28d04)

Retrieve the number of online CPUs on OpenBSD and NetBSD
(cherry picked from commit 41e81b1ca4bbb41d234f2d0f2c56591db78ebb83)

Update error message now that /proc/cpuinfo is no longer in use
(cherry picked from commit c35af58b61daa111c93924e0e7b65022871fadac)

Fix runtime crash when parsing /proc/cpuinfo fails
(cherry picked from commit 39be87d3004ff9ff4cdf736651af80c3d15e2497)

another reversal of something that breaks on wasm
(cherry picked from commit 44507bc91ff9a23ad8ad4120cfc6b0d9bd27e2ca)
2025-02-10 00:06:25 -05:00
Brad Smith
fbe470c1b2
[benchmark] Get number of CPUs with sysconf() on Linux (#125603)
(cherry picked from commit c24774dc4f4402c3ad150363321cc972ed2669e7)
2025-02-03 22:43:43 -05:00
Brad Smith
3eb795cd0f
[benchmark] Fix OpenBSD build (#97269)
(cherry picked from commit f3ec7b8820ca8136c4e1dad4552608b51b47831a)
2024-07-01 17:11:21 -04:00
Fanbo Meng
4d34b3295f
[SystemZ][z/OS] Remove COMPILER_IBMXL macro for z/OS (#87493)
This copies the change made in google benchmark
(70916cbf71)
to remove COMPILER_IBMXL for z/OS.
2024-04-03 09:44:59 -04:00
Jordan Rupprecht
cc7544e230
[benchmark] Delete WORKSPACE bzl files (#84013)
As like 48d868493fa74025e7768afacdbbbd3ea9c82468, `WORKSPACE` is another
bazel-specific file that is unused. LLVM's bazel configuration is
entirely in `utils/bazel`.
2024-03-05 13:31:57 -06:00
Mircea Trofin
a5b797172c
Reapply "Update Benchmark (#83488)" (#83916)
This reverts commit aec6a04b8e99b42eca431fc0b56947937d3a14c2.

(google/benchmark still at hash 1576991177ba97a4b2ff6c45950f1fa6e9aa678c as it was in #83488. Also reapplied same extra local diffs)

Verified locally.
2024-03-04 14:11:30 -08:00
Mircea Trofin
aec6a04b8e Revert "Update Benchmark (#83488)"
This reverts commit 2e93ee6a2389cc65faf9739cd7a6c438d5e05a9e.

buildbot failures, e.g.
`/third-party/benchmark/cmake/pthread_affinity.cpp`
2024-03-04 13:33:58 -08:00
Mircea Trofin
2e93ee6a23
Update Benchmark (#83488)
Addresses the `third-party/benchmark` part of #81859 (by happening to remove `requirements.txt`)
2024-03-04 12:59:36 -08:00
Alexandre Ganea
92f91dde69 [third-party] Silence warning on benchmark when building with Clang ToT
fixes:
```
[7409/7446] Building CXX object third-party\benchmark\src\CMakeFiles\benchmark.dir\benchmark.cc.obj
C:\git\llvm-project\third-party\benchmark\src\benchmark.cc(172,17): warning: offset of on non-standard-layout type 'State' [-Winvalid-offsetof]
  172 |   static_assert(offsetof(State, error_occurred_) <=
      |                 ^               ~~~~~~~~~~~~~~~
C:\git\llvm_package_18.0.0\build64_stage0\lib\clang\18\include\__stddef_offsetof.h(11,24): note: expanded from macro 'offsetof'
   11 | #define offsetof(t, d) __builtin_offsetof(t, d)
      |                        ^                     ~
1 warning generated.
```
2024-01-17 07:23:56 -05:00
Abhina Sree
70e67253d6
[System][z/OS] Fix per-thread timing error on z/OS (#76947)
This patch calls ProcessCPUUsage() for z/OS because we do not support CLOCK_THREAD_CPUTIME_ID. This copies the change made to google benchmark here
e3824e7503
2024-01-05 07:57:07 -05:00
Abhina Sree
892862246e
[SystemZ][z/OS] define HOST_NAME_MAX for z/OS (#76093)
This applies the same change made in google benchmark to define HOST_NAME_MAX
for z/OS 7b52bf7346
2023-12-20 14:29:24 -05:00
Fangrui Song
678e3ee123 [lldb] Fix duplicate word typos; NFC
Those fixes were taken from https://reviews.llvm.org/D137338
2023-09-01 21:32:24 -07:00
Tobias Hieta
f98ee40f4b
[NFC][Py Reformat] Reformat python files in the rest of the dirs
This is an ongoing series of commits that are reformatting our
Python code. This catches the last of the python files to
reformat. Since they where so few I bunched them together.

Reformatting is done with `black`.

If you end up having problems merging this commit because you
have made changes to a python file, the best way to handle that
is to run git checkout --ours <yourfile> and then reformat it
with black.

If you run into any problems, post to discourse about it and
we will try to help.

RFC Thread below:

https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style

Reviewed By: jhenderson, #libc, Mordante, sivachandra

Differential Revision: https://reviews.llvm.org/D150784
2023-05-25 11:17:05 +02:00
John Ericson
e941b031d3 Revert "[cmake] Use CMAKE_INSTALL_LIBDIR too"
This reverts commit f7a33090a91015836497c75f173775392ab0304d.

Unfortunately this causes a number of failures that didn't show up in my
local build.
2022-08-18 22:46:32 -04:00
John Ericson
f7a33090a9 [cmake] Use CMAKE_INSTALL_LIBDIR too
We held off on this before as `LLVM_LIBDIR_SUFFIX` conflicted with it.
Now we return this.

`LLVM_LIBDIR_SUFFIX` is kept as a deprecated way to set
`CMAKE_INSTALL_LIBDIR`. The other `*_LIBDIR_SUFFIX` are just removed
entirely.

I imagine this is too potentially-breaking to make LLVM 15. That's fine.
I have a more minimal version of this in the disto (NixOS) patches for
LLVM 15 (like previous versions). This more expansive version I will
test harder after the release is cut.

Reviewed By: sebastian-ne, ldionne, #libc, #libc_abi

Differential Revision: https://reviews.llvm.org/D130586
2022-08-18 15:33:35 -04:00
Aaron Ballman
a31e2859a8 Silence MSVC codecvt deprecation warnings
This silences warnings about use of deprecated codecvt functionality
after the switch to build with C++17.
2022-08-15 08:38:07 -04:00
Kazu Hirata
7006d34ce7 Ensure newlines at the end of files (NFC) 2021-12-26 08:51:06 -08:00
Mircea Trofin
48d868493f [benchmark] Delete BUILD files
Bazel support is through utils/bazel, and the BUILD files in `benchmark`
just complicate downstream integrates for bazel based builds.

Differential Revision: https://reviews.llvm.org/D115733
2021-12-14 08:13:21 -08:00
Mircea Trofin
a290770fa8 [benchmark] Pull latest; disable -Werror
Pulled the latest (b000672), which adds an option to disable -Werror,
which caused issues previously (see for instance
https://reviews.llvm.org/D112012)

Applied https://github.com/google/benchmark/pull/1305 to unblock, as
this issue is causing downstream buildbot failures.

The only change is in llvm/CMakeLists.txt, where we set
BENCHMARK_ENABLE_WERROR to have the same value as LLVM_ENABLE_WERROR.

This patch also introduces a convenience script to pull benchmark from
upstream.

Differential Revision: https://reviews.llvm.org/D115684
2021-12-13 17:09:38 -08:00
Martin Storsjö
0b20c96fd6 [benchmark] Reapply fix for -Wcovered-switch-default warning
This reapplies a fix from 948ce4e6edec6ad3cdf1911fc3e8e9569140d4ff,
whichn't originally submitted upstream. I has now been merged upstream
though, in https://github.com/google/benchmark/pull/1302.

When benchmarks were unified in
5dda2efde574d3a200d04c371f561a77ee9f4aff, it lost this change,
but it also lost another local modification, where benchmark's
CMakeLists.txt was modified to comment out adding -Werror.
(This change was part of the original import in
0addd170ab0880941fa4089c2717f3f3a0e4e25a.)

As the benchmark library is built automatically by default, when
building all of LLVM (contrary to the copy in libcxx, which wasn't
built by default), building it with -Werror by default is very brittle.

This fixes building LLVM with MinGW. (It wasn't broken in MSVC
mode, as the benchmark library doesn't add -Werror or anything
equivalent in MSVC mode, and it's unclear if this warning is
enabled in that mode at all.)

Differential Revision: https://reviews.llvm.org/D115434
2021-12-09 21:39:29 +02:00
Mircea Trofin
5dda2efde5 Re-Reland "[benchmarks] Move libcxx's fork of google/benchmark and llvm/utils'"
This reverts commit b2fbd45d2395f1f6ef39db72b7156724fc101e40. D114922
fixed the reason of the 2nd revert.

This patch also re-applies 39e9f5d3685f3cfca0df072928ad96d973704dff.

Differential Revision: https://reviews.llvm.org/D112012
2021-12-07 17:10:41 -08:00
Mircea Trofin
b2fbd45d23 Revert "Reland "[benchmarks] Move libcxx's fork of google/benchmark and llvm/utils'"""
This reverts commit 1ee32055ea1dd4db70d1939cbd4f5105c2dce160.

We hit additional bot failures; in particular, Fuchsia's seems to be
related to how CMakeLists are ingested, see https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8830380874445931681/overview
2021-11-16 16:35:06 -08:00
Mircea Trofin
1ee32055ea Reland "[benchmarks] Move libcxx's fork of google/benchmark and llvm/utils'""
This reverts commit e7568b68da8a216dc22cdc1c6d8903c94096c846 and relands
c6f7b720ecfa6db40c648eb05e319f8a817110e9.

The culprit was: missed that libc also had a dependency on one of the
copies of `google-benchmark`

Also opportunistically fixed indentation from prev. change.

Differential Revision: https://reviews.llvm.org/D112012
2021-11-16 10:33:31 -08:00
Mircea Trofin
e7568b68da Revert "[benchmarks] Move libcxx's fork of google/benchmark and llvm/utils'"
This reverts commit c6f7b720ecfa6db40c648eb05e319f8a817110e9.

Some buildbots are failing, will investigate and reland.
Example:
  https://lab.llvm.org/buildbot#builders/138/builds/14067
  https://lab.llvm.org/buildbot#builders/73/builds/20159
2021-11-16 09:28:50 -08:00
Mircea Trofin
c6f7b720ec [benchmarks] Move libcxx's fork of google/benchmark and llvm/utils'
under third-party

This change:
- moves the libcxx copy of `google/benchmark` to
`third-party/benchmkark`
- points the 2 uses of the library (libcxx and llvm/utils) to this copy

We picked the licxx copy because it is the most up to date.

Differential Revision: https://reviews.llvm.org/D112012
2021-11-16 09:16:11 -08:00