[libcxx-commits] [libcxx] [libc++] Simplify and optimize the run-benchmarks script (PR #181382)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Feb 13 08:32:25 PST 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r origin/main...HEAD libcxx/test/benchmarks/spec.gen.py
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- spec.gen.py	2026-02-13 16:15:01.000000 +0000
+++ spec.gen.py	2026-02-13 16:31:53.261757 +0000
@@ -29,12 +29,13 @@
 spec_dir = pathlib.Path((test_dir / 'spec_dir.subs').open().read().strip())
 
 # Setup the configuration file. We need to force the usage of C++17 since
 # SPEC doesn't compile with newer standards.
 test_dir.mkdir(parents=True, exist_ok=True)
-spec_config = test_dir / 'spec-config.cfg'
-spec_config.write_text(f"""
+spec_config = test_dir / "spec-config.cfg"
+spec_config.write_text(
+    f"""
 default:
     ignore_errors        = 1
     iterations           = 1
     label                = spec-stdlib
     log_line_width       = 4096
@@ -49,11 +50,12 @@
     CC                   = cc -O3 -std=c18 -Wno-implicit-function-declaration
     CXX                  = {cxx} {compile_flags} {flags} {link_flags} -std=c++17 -w # we don't care about warnings in SPEC
     CC_VERSION_OPTION    = --version
     CXX_VERSION_OPTION   = --version
     EXTRA_PORTABILITY    = -DSPEC_NO_CXX17_SPECIAL_MATH_FUNCTIONS # because libc++ doesn't implement the special math functions yet
-""")
+"""
+)
 
 # Build the list of benchmarks. We take all intrate and fprate benchmarks that contain C++ and
 # discard the ones that contain Fortran, since this test suite isn't set up to build Fortran code.
 spec_benchmarks = set()
 no_fortran = set()

``````````

</details>


https://github.com/llvm/llvm-project/pull/181382


More information about the libcxx-commits mailing list