Commit Graph

1776 Commits

Author SHA1 Message Date
Louis Dionne
20c67c75ec [libc++] Produce summary reports in compare-benchmarks
This patch adds the ability to produce a summary report with a few KPIs
in the compare-benchmarks script. This is useful to regularly monitor
the progress of the library on these KPIs.

Example usage:

     compare-benchmarks libstdcxx.lnt llvm-20.lnt llvm-21.lnt main.lnt     \
         --series-names "GNU,LLVM 20,LLVM 21,LLVM main"                    \
         --format kpi                                                      \
         --noise-threshold 0.1                                             \
         --meta-candidate 'LLVM'

This would produce a short report showing the evolution of benchmarks
in the given LLVM releases as compared to a GNU baseline.
2025-12-12 16:33:18 -05:00
Aiden Grossman
36a95a5cb4 [libc++][Github] Bump Runner Version to v2.330.0 (#168753)
Bumps the runner version to keep things up to date (and prevent us from
falling below the support horizon).
2025-12-10 17:44:57 +00:00
Nikolas Klauser
b4194f0f5a [libc++] Fix module_std_compat.sh.cpp with new versions of clang-tidy (#170446)
clang-tidy doesn't run checks anymore in system headers by default in
new versions to reduce runtime. In this case it's problematic, since we
want to check system headers.
2025-12-04 17:09:51 -05:00
Louis Dionne
cd5ed7ca87 [libc++] Make CC and CXX environment variables mandatory in run-buildbot (#166875)
Previously, the bootstrapping-build job defined in run-buildbot required
the CC and CXX environment variables to be defined even though
run-buildbot documents these environment variables as being optional. It
also relied on ccache being available.

Refactor run-buildbot to make CC and CXX mandatory, and refactor various
places in the CI where we called run-buildbot without setting CC and
CXX. After this patch, all places that use run-buildbot are setting CC
and CXX before calling the script, which makes it easier to track what
compiler is used where. This also allows simplifying run-buildbot
itself.

Finally, this patch makes ccache optional for running the bootstrapping
build.
2025-12-02 08:58:00 -05:00
Louis Dionne
1d3384e5d4 [libc++] Update the Docker image hash in run-buildbot-container (#170165)
The current Docker image used by our CI is d6b22a347f, but we
forgot to synchronize the value in run-buildbot-container.
2025-12-01 15:17:44 -05:00
Volodymyr Turanskyy
a6643f27ec [libc++] Add support for picolibc and newlib in RUNTIMES_USE_LIBC (#147956)
This replaces detection of picolibc in libc++ (by checking for and
including picolibc.h) with using RUNTIMES_USE_LIBC build time option
intriduced in https://github.com/llvm/llvm-project/pull/134893
RUNTIMES_USE_LIBC is extended to accept picolibc and newlib.

Detection of picolibc via the header is kept as a deprecated feature to
avoid breaking builds.

libc++ is updated to use dedicated LIBCXX_LIBC_NEWLIB macro to check for
newlib specific conditions instead of less informative _NEWLIB_VERSION

---------

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2025-11-28 11:50:06 +00:00
David Spickett
ccd2c3e320 Revert "[libcxx][ci] Temporarily disable ARM jobs" (#169352)
Reverts llvm/llvm-project#169318

Our builders are back online. I see them picking up existing jobs.
2025-11-24 16:13:20 +00:00
David Spickett
840a43bbe3 [libcxx][ci] Temporarily disable ARM jobs (#169318)
Linaro is doing network maintenance and I don't have an estimated time
these will be back online.
2025-11-24 11:25:17 +00:00
Florian Mayer
226765b60c [NFC] [test] [libcxx] Fix invalid escape sequences (#168636)
```
>>> "_target-has-llvm-21 || target={{.+}}-apple-macosx{{26.[0-9](.\d+)?}}" == r"_target-has-llvm-21 || target={{.+}}-apple-macosx{{26.[0-9](.\\
d+)?}}"
<python-input-6>:1: SyntaxWarning: invalid escape sequence '\d'
True
>>> "_target-has-llvm-20 || target={{.+}}-apple-macosx{{15.[4-9](.\d+)?}}" == r"_target-has-llvm-20 || target={{.+}}-apple-macosx{{15.[4-9](.\\
d+)?}}"
<python-input-7>:1: SyntaxWarning: invalid escape sequence '\d'
True
>>> "_target-has-llvm-19 || target={{.+}}-apple-macosx{{15.[0-3](.\d+)?}}" == r"_target-has-llvm-19 || target={{.+}}-apple-macosx{{15.[0-3](.\\
d+)?}}"
<python-input-8>:1: SyntaxWarning: invalid escape sequence '\d'
True
>>> "_target-has-llvm-18 || target={{.+}}-apple-macosx{{14.[4-9](.\d+)?}}" == r"_target-has-llvm-18 || target={{.+}}-apple-macosx{{14.[4-9](.\\
d+)?}}"
<python-input-9>:1: SyntaxWarning: invalid escape sequence '\d'
True
```
2025-11-21 22:03:49 -08:00
Nikolas Klauser
75792d6077 [libc++] Fix header deprecations (#163356)
Currently, there are no diagnostics issued when including a deprecated
header, since the diagnostic is issued inside a system header. This
patch fixes that by using `#warning` instead, which also simplifies the
implementation of the deprecation warnings.
2025-11-18 16:05:53 +01:00
Louis Dionne
24c524d014 [libc++] Enable compiler-rt when performing a bootstrapping build (#167065)
Otherwise, we end up using whatever system-provided compiler runtime is
available, which doesn't work on macOS since compiler-rt is located
inside the toolchain path, which can't be found by default.

However, disable the tests for compiler-rt since those are linking
against the system C++ standard library while using the just-built
libc++ headers, which is non-sensical and leads to undefined references
on macOS.
2025-11-17 16:07:28 -05:00
Aiden Grossman
789ef89860 [libcxx] Install ninja in CI container from system repo (#168225)
To fix the TODO now that the ninja version available in the Ubuntu
repositories (1.11) is new enough.
2025-11-16 10:33:30 -08:00
Louis Dionne
bf07226c6d [libc++] Reorganize and fix the libc++ CI dockerfiles (#167530)
Instead of having one large Dockerfile building multiple images with
relatively confusing inheritance, explicitly have three standalone
Dockerfiles each building one image. Then, tie the three images together
using the docker-compose file which explicitly versions the base image
used by the Android and the Github Actions images.
2025-11-14 04:03:21 -05:00
Henrik G. Olsson
dbf77e4f5b [utils] revamp options controlling lit's output (#167192)
Lit has a number of options controlling the output, but they don't
compose very well. This breaks the existing options down into smaller,
orthogonal options, and makes the existing options aliases of the new
ones.

This introduces the following options:
  --test-output {off,failed,all}
  --print-result-after {off,failed,all}
  --diagnostic-level {error,warning,note}
  --terse-summary
  --no-terse-summary
  --progress-bar (mirroring --no-progress-bar)

--test-output and --print-result-after are not entirely orthogonal, as
'--test-output X' requires that --print-result-after is set to at least
X, and implicitly does so if it isn't already. Conversely,
'--print-result-after Y' requires that --test-output is at most Y, and
implicitly lowers if it is higher. This means that the following
invocations have different end results, as they are applied in order:
  '--test-output all --print-result-after off'
  '--print-result-after off --test-output all'

The following existing options are now aliases as follows:
  -q, --quiet
    '--diagnostic-level error --test-output off --terse-summary'
  -s, --succinct
    '--progress-bar --print-result-after failed'
  -v, --verbose
    '--test-output failed'
  -a, --show-all
    '--test-output all'

These where all completely separate options and would override each
other in ad-hoc ways, with no regard to the order they were given.

This fixes https://github.com/llvm/llvm-project/issues/106643 This is
based on the RFC

https://discourse.llvm.org/t/rfc-new-command-line-options-for-controlling-llvm-lit-output/
with the addition of --terse-summary, which was a behaviour of -q that
was not captured by the original RFC. This also diverges from the RFC in
that --debug is NOT folded into --diagnostic-level, because it can be
useful to debug any configuration, including those specifying
--diagnostic-level.

Example combination that is possible now but wasn't before:
'--diagnostic-level error --test-output all --progress-bar' Another use
case is aliases, where you can alias e.g:
  alias lit=llvm-lit --quiet
but still override the specified default options.
2025-11-12 15:34:21 -08:00
William Tran-Viet
389a23c538 [libc++] Implement P2988R12: std::optional<T&> (#155202)
Resolves #148131

- Unlock `std::optional<T&>` implementation
- Allow instantiations of `optional<T(&)(...)>` and `optional<T(&)[]>`
but disables `value_or()` and `optional::iterator` + all `iterator`
related functions
- Update documentation
- Update tests
2025-11-12 11:00:08 +08:00
Louis Dionne
7f818696e6 [libc++] Split features.py into multiple files (#167353)
The features.py file that performs detection of Lit features had grown
to be massive, so this patch splits it into smaller chunks which makes
it easier to keep things organized.
2025-11-11 11:39:37 -05:00
Louis Dionne
911d1c2a24 [libc++][NFC] Remove unused imports from generate_feature_test_macro_components.py (#159591) 2025-11-10 12:56:43 -05:00
Louis Dionne
825943e06f [libc++] Run macOS buildbot under xcrun (#167072)
This ensures that run-buildbot can find the appropriate build tools
without having to go through a bunch of hoops inside run-buildbot
itself. When we eventually run the bootstrapping build on macOS, it also
allows the bootstrapped Clang to find the SDK headers it requires.

This also allows simplifying run-buildbot a bunch since we should be
able to find build tools in the current $PATH.
2025-11-08 09:27:05 -10:00
Mark Danial
3361e40c32 [AIX] Enable libc++ bots on AIX (#166650)
Removing skip after confirming builds pass locally. Upgraded workers to
clang 20

Fixes #162516
2025-11-05 23:05:32 -05:00
Louis Dionne
3252e11da3 [libc++] Add availability markup for LLVM 19 and LLVM 20 (#140072)
An LLVM 19-aligned libc++ was released with macOS 15.4 (and corresponding OSes),
and LLVM-20 aligned with macOS 26.0. This patch adds availability markup to
reflect that.
2025-11-02 15:24:30 -10:00
Nikolas Klauser
2527b071ba [libc++] P2641R4: Checking if a union alternative is active (std::is_within_lifetime) (#165243)
<https://wg21.link/P2641R4>

Implements the C++26 function in `<type_traits>` [meta.const.eval] (and
the corresponding feature test macro `__cpp_lib_is_within_lifetime`)

```c++
template<class T>
  consteval bool is_within_lifetime(const T*) noexcept;
```

This is done with the `__builtin_is_within_lifetime` builtin added to
Clang 20 by #91895 / 2a07509c8d. This is
not (currently) available with GCC.

This implementation has provisions for LWG4138
<https://cplusplus.github.io/LWG/issue4138> where it is ill-formed to
instantiate `is_within_lifetime<T>` with a function type `T`.

Closes #105381

Co-authored-by: Mital Ashok <mital@mitalashok.co.uk>
2025-11-02 10:30:31 +01:00
Hui
c07440b887 [libc++] constexpr flat_multiset (#161016)
Fixes https://github.com/llvm/llvm-project/issues/128676
2025-11-01 08:51:35 +00:00
Nikolas Klauser
fc1f3f397e Revert "[libcxx] Define _LIBCPP_HAS_C8RTOMB_MBRTOC8 to true if compiling with clang" (#165268)
Reverts llvm/llvm-project#152724

The PR was merged with broken pre-commit CI.
2025-10-27 17:08:44 +01:00
Victor Campos
d522b1b300 [libcxx] Define _LIBCPP_HAS_C8RTOMB_MBRTOC8 to true if compiling with clang (#152724)
Define `_LIBCPP_HAS_C8RTOMB_MBRTOC8` to `1` if compiling with clang.

Some tests involving functionality from `uchar.h`/`cuchar` fail when the
platform or the supporting C library does not provide support for the
corresponding features. These have been xfailed.

This patch will enable the adoption of newer picolibc versions.
2025-10-24 09:36:31 +01:00
Louis Dionne
bffdf0b408 [libc++] Allow customizing trendline in visualize-historical script 2025-10-21 09:28:45 -04:00
Louis Dionne
fcb1a82811 [libc++] Fix off-by-one error in compare-benchmarks script
That led us to overwrite the data of the last row with the geomean.
2025-10-20 17:00:22 -04:00
Louis Dionne
9a74abcd51 [libc++] Fix bugs in geomean calculation 2025-10-17 17:22:03 -04:00
Louis Dionne
ab2ece03ae [libc++] Compute geomean in compare-benchmarks 2025-10-17 17:05:58 -04:00
Ed Maste
55bd6fb8db [libc++] Bump the FreeBSD builder to Clang 20 (#162564) 2025-10-15 14:45:56 +02:00
Aiden Grossman
d6b22a347f [Github] Bump Actions Runner to v2.329.0
Bump the runner version to keep things up to date and ensure we do not
run past the runner support time horizon.
2025-10-14 18:13:13 +00:00
Hristo Hristov
8a27b48122 [libc++][atomic] P2835R7: Expose std::atomic_ref's object address (#162236)
Implements https://wg21.link/P2835R7

Closes #118377

# References

- https://wg21.link/atomics.ref.generic.general
- https://wg21.link/atomics.ref.int
- https://wg21.link/atomics.ref.float
- https://wg21.link/atomics.ref.pointer

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
2025-10-13 20:27:02 +08:00
Louis Dionne
a47cb9b652 [libc++] Fix number of characters in skip reason on BuildKite 2025-10-10 12:26:07 -04:00
Nikolas Klauser
8ad5a21790 [libc++] Fix %{temp} replacements when running benchmarks 2025-10-10 12:08:26 +02:00
Louis Dionne
c8afc6a12d [libc++] Fix a few incorrect find-and-replace in the %{temp} change 2025-10-09 21:17:28 -04:00
Aiden Grossman
0c2913afc8 [libcxx] Use %{temp} instead of %T (#162323)
Based on review feedback in #160026.

This makes the substitution a lot more clear now that there is no
documentation around %T.

---------

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2025-10-09 16:52:42 -07:00
Louis Dionne
5ba3b52306 [libc++] Skip AIX build jobs until #162516 has been resolved (#162664) 2025-10-09 15:23:59 +00:00
Ed Maste
92266681bf [libc++] Add FreeBSD libc++ owner (#162561)
Fixes #160091
2025-10-09 09:55:27 -04:00
Louis Dionne
4f80c064eb [runtimes][NFC] Consistently declare main() functions in tests (#162548)
In the libc++ test suite, we consistently declare main() functions with
full parameters and explicitly return from the function. This helps code
that compiles the tests with -ffreestanding, where main() is not a
special function (with an implicit return and special mangling).

This patch fixes a few stray declarations, including in libunwind and
libc++abi.
2025-10-09 09:00:20 -04:00
Nikolas Klauser
1760206383 [libc++] Remove availability annotations that aren't required anymore (#161640)
Apple dropped support for some older platforms, so we can also remove
the annotations for them.
See https://developer.apple.com/support/xcode/ for the supported
versions.
2025-10-09 08:46:02 +02:00
Baranov Victor
496d0719a2 [libc++][CI] Use fully qualified names in docker images (NFC) (#162156)
Based on
https://github.com/llvm/llvm-project/pull/162007#issuecomment-3373161948,
we should avoid having short links in docker images.
2025-10-09 00:54:11 +03:00
Louis Dionne
885e7833b5 [libc++] Allow sorting by a few criteria in compare-benchmarks 2025-10-07 08:38:08 -04:00
Hristo Hristov
45c41247f8 [libc++][ranges] P3060R3: Add std::views::indices(n) (#146823)
Implements [P3060R3](https://wg21.link/P3060R3)

Closes #148175

# References

- https://github.com/cplusplus/draft/issues/7966
- https://github.com/cplusplus/draft/pull/8006
- https://wg21.link/customization.point.object
- https://wg21.link/range.iota.overview
- https://wg21.link/ranges.syn

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
Co-authored-by: A. Jiang <de34@live.cn>
2025-10-06 18:13:25 +03:00
Nikolas Klauser
66558d70dc [libc++] Fix <__algorithm/find.h> when using -flax-vector-conversions=none (#161362) 2025-10-02 10:05:26 +02:00
Louis Dionne
a9b8dfe7b5 [libc++] Add a script to find outliers and re-run candidates in LNT results
This allows selectively re-running benchmarks that are suspected to contain
a lot of noise.
2025-10-01 12:38:24 -04:00
Aiden Grossman
37e7ad184d [libcxx] Add local %T substitution
This patch adds a %T substitution directly into the libc++ test format.
This ensures that the libc++ test format will continue to work when we
remove support for %T in llvm lit.

Reviewers: #reviewers-libcxx, ldionne, philnik777

Pull Request: https://github.com/llvm/llvm-project/pull/160026
2025-09-26 15:48:02 -07:00
Louis Dionne
d636dc8358 [libc++] Support comparison of more than two data sets in compare-benchmarks 2025-09-26 11:27:15 -04:00
Louis Dionne
42dd9260db [libc++] Switch back to plotting on revlist order for visualize-historical
That provides vastly better plots.
2025-09-26 07:47:21 -04:00
Louis Dionne
2810a489d2 [libc++] Use pandas.DataFrame in compare-benchmarks
This opens the door to performing more advanced computations on the
data we're comparing.
2025-09-25 20:43:57 -04:00
Louis Dionne
62450ba905 [libc++] Improve handling of runtime errors inside SPEC benchmarks
Previously, we would report a successful run if the benchmark exited
with an error, and we would produce a timing for the benchmark. After
this patch, we consider an error in the benchmark to be a failed LIT
test and we don't produce any benchmark data for it.
2025-09-25 13:13:32 -04:00
Hristo Hristov
804b46bb45 [libc++][string] P3044R2: sub-string_view from string (#147095)
Implements [P3044R2](https://wg21.link/P3044R2)

Note: `substr.pass.cpp` is refactored to accommodate the test of
`basic_string_view`'s `subview` which is an alias of `substr` without
changing the test cases.

Closes #148140

# References

- https://github.com/cplusplus/draft/pull/7975
- https://wg21.link/string.substr
- https://wg21.link/string.view.ops

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
Co-authored-by: Nikolas Klauser <nikolasklauser@berlin.de>
2025-09-25 03:08:15 +03:00