Skip to content

Commit 58b270b

Browse files
committed
Auto merge of #150080 - tgross35:update-builtins, r=tgross35
compiler-builtins subtree update Subtree update of `compiler-builtins` to rust-lang/compiler-builtins@8a3e35b. Created using https://github.com/rust-lang/josh-sync. r? `@ghost`
2 parents ec6f622 + a9fa80c commit 58b270b

File tree

41 files changed

+733
-257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+733
-257
lines changed

library/compiler-builtins/.github/workflows/main.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: CI
22
on:
3-
push: { branches: [master] }
3+
push: { branches: [main] }
44
pull_request:
55

66
concurrency:
@@ -89,7 +89,7 @@ jobs:
8989
- target: x86_64-unknown-linux-gnu
9090
os: ubuntu-24.04
9191
- target: x86_64-apple-darwin
92-
os: macos-13
92+
os: macos-15-intel
9393
- target: i686-pc-windows-msvc
9494
os: windows-2025
9595
- target: x86_64-pc-windows-msvc
@@ -239,6 +239,8 @@ jobs:
239239
include:
240240
- target: x86_64-unknown-linux-gnu
241241
os: ubuntu-24.04
242+
- target: aarch64-unknown-linux-gnu
243+
os: ubuntu-24.04-arm
242244
runs-on: ${{ matrix.os }}
243245
steps:
244246
- uses: actions/checkout@master
@@ -247,13 +249,13 @@ jobs:
247249
- name: Set up dependencies
248250
run: |
249251
sudo apt-get update
250-
sudo apt-get install -y valgrind gdb libc6-dbg # Needed for iai-callgrind
252+
sudo apt-get install -y valgrind gdb libc6-dbg # Needed for gungraun
251253
rustup update "$BENCHMARK_RUSTC" --no-self-update
252254
rustup default "$BENCHMARK_RUSTC"
253-
# Install the version of iai-callgrind-runner that is specified in Cargo.toml
254-
iai_version="$(cargo metadata --format-version=1 --features icount |
255-
jq -r '.packages[] | select(.name == "iai-callgrind").version')"
256-
cargo binstall -y iai-callgrind-runner --version "$iai_version"
255+
# Install the version of gungraun-runner that is specified in Cargo.toml
256+
gungraun_version="$(cargo metadata --format-version=1 --features icount |
257+
jq -r '.packages[] | select(.name == "gungraun").version')"
258+
cargo binstall -y gungraun-runner --version "$gungraun_version"
257259
sudo apt-get install valgrind
258260
- uses: Swatinem/rust-cache@v2
259261
with:

library/compiler-builtins/.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ permissions:
55
contents: write
66

77
on:
8-
push: { branches: [master] }
8+
push: { branches: [main] }
99

1010
jobs:
1111
release-plz:

library/compiler-builtins/.github/workflows/rustc-pull.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
zulip-stream-id: 219381
1818
zulip-topic: 'compiler-builtins subtree sync automation'
1919
zulip-bot-email: "[email protected]"
20-
pr-base-branch: master
20+
pr-base-branch: main
2121
branch-name: rustc-pull
2222
secrets:
2323
zulip-api-token: ${{ secrets.ZULIP_API_TOKEN }}

library/compiler-builtins/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ compiler-rt
99
# Benchmark cache
1010
baseline-*
1111
iai-home
12+
gungraun-home
1213

1314
# Temporary files
1415
*.bk

library/compiler-builtins/CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ cargo bench --no-default-features \
150150
```
151151

152152
There are also benchmarks that check instruction count behind the `icount`
153-
feature. These require [`iai-callgrind-runner`] (via Cargo) and [Valgrind]
154-
to be installed, which means these only run on limited platforms.
153+
feature. These require [`gungraun-runner`] (via Cargo) and [Valgrind] to be
154+
installed, which means these only run on limited platforms.
155155

156156
Instruction count benchmarks are run as part of CI to flag performance
157157
regresions.
@@ -163,7 +163,7 @@ cargo bench --no-default-features \
163163
--bench icount --bench mem_icount
164164
```
165165

166-
[`iai-callgrind-runner`]: https://crates.io/crates/iai-callgrind-runner
166+
[`gungraun-runner`]: https://crates.io/crates/gungraun-runner
167167
[Valgrind]: https://valgrind.org/
168168

169169
## Subtree synchronization

library/compiler-builtins/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,6 @@ codegen-units = 1
5151
lto = "fat"
5252

5353
[profile.bench]
54-
# Required for iai-callgrind
54+
# Required for gungraun
5555
debug = true
56+
strip = false

library/compiler-builtins/PUBLISHING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ It's not great, but it works for now. PRs to improve this process would be
55
greatly appreciated!
66

77
1. Make sure you've got a clean working tree and it's updated with the latest
8-
changes on `master`
8+
changes on `main`
99
2. Edit `Cargo.toml` to bump the version number
1010
3. Commit this change
1111
4. Run `git tag` to create a tag for this version

library/compiler-builtins/builtins-shim/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
[package]
1212
name = "compiler_builtins"
1313
version = "0.1.160"
14-
authors = ["Jorge Aparicio <[email protected]>"]
14+
authors = [
15+
"Alex Crichton <[email protected]>",
16+
"Amanieu d'Antras <[email protected]>",
17+
"Jorge Aparicio <[email protected]>",
18+
"Trevor Gross <[email protected]>",
19+
]
1520
description = "Compiler intrinsics used by the Rust compiler."
1621
repository = "https://github.com/rust-lang/compiler-builtins"
1722
license = "MIT AND Apache-2.0 WITH LLVM-exception AND (MIT OR Apache-2.0)"

library/compiler-builtins/builtins-test/Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "builtins-test"
33
version = "0.1.0"
4-
authors = ["Alex Crichton <[email protected]>"]
54
edition = "2024"
65
publish = false
76
license = "MIT AND Apache-2.0 WITH LLVM-exception AND (MIT OR Apache-2.0)"
@@ -14,7 +13,7 @@ rand_xoshiro = "0.7"
1413
# To compare float builtins against
1514
rustc_apfloat = "0.2.3"
1615
# Really a dev dependency, but dev dependencies can't be optional
17-
iai-callgrind = { version = "0.15.2", optional = true }
16+
gungraun = { version = "0.17.0", optional = true }
1817

1918
[dependencies.compiler_builtins]
2019
path = "../builtins-shim"
@@ -46,8 +45,8 @@ no-sys-f16-f64-convert = []
4645
# Skip tests that rely on f16 symbols being available on the system
4746
no-sys-f16 = ["no-sys-f16-f64-convert"]
4847

49-
# Enable icount benchmarks (requires iai-callgrind and valgrind)
50-
icount = ["dep:iai-callgrind"]
48+
# Enable icount benchmarks (requires gungraun-runner and valgrind locally)
49+
icount = ["dep:gungraun"]
5150

5251
# Enable report generation without bringing in more dependencies by default
5352
benchmarking-reports = ["criterion/plotters", "criterion/html_reports"]

library/compiler-builtins/builtins-test/benches/mem_icount.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
//! Benchmarks that use Callgrind (via `iai_callgrind`) to report instruction count metrics. This
1+
//! Benchmarks that use Callgrind (via `gungraun`) to report instruction count metrics. This
22
//! is stable enough to be tested in CI.
33
44
use std::hint::black_box;
55
use std::{ops, slice};
66

77
use compiler_builtins::mem::{memcmp, memcpy, memmove, memset};
8-
use iai_callgrind::{library_benchmark, library_benchmark_group, main};
8+
use gungraun::{library_benchmark, library_benchmark_group, main};
99

1010
const PAGE_SIZE: usize = 0x1000; // 4 kiB
1111
const MAX_ALIGN: usize = 512; // assume we may use avx512 operations one day
@@ -108,7 +108,7 @@ mod mcpy {
108108
],
109109
setup = setup,
110110
)]
111-
fn bench((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) {
111+
fn bench_cpy((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) {
112112
unsafe {
113113
black_box(memcpy(
114114
black_box(dst.as_mut_ptr()),
@@ -118,7 +118,7 @@ mod mcpy {
118118
}
119119
}
120120

121-
library_benchmark_group!(name = memcpy; benchmarks = bench);
121+
library_benchmark_group!(name = memcpy; benchmarks = bench_cpy);
122122
}
123123

124124
mod mset {
@@ -157,7 +157,7 @@ mod mset {
157157
],
158158
setup = setup,
159159
)]
160-
fn bench((len, mut dst): (usize, AlignedSlice)) {
160+
fn bench_set((len, mut dst): (usize, AlignedSlice)) {
161161
unsafe {
162162
black_box(memset(
163163
black_box(dst.as_mut_ptr()),
@@ -167,7 +167,7 @@ mod mset {
167167
}
168168
}
169169

170-
library_benchmark_group!(name = memset; benchmarks = bench);
170+
library_benchmark_group!(name = memset; benchmarks = bench_set);
171171
}
172172

173173
mod mcmp {
@@ -225,7 +225,7 @@ mod mcmp {
225225
],
226226
setup = setup
227227
)]
228-
fn bench((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) {
228+
fn bench_cmp((len, mut dst, src): (usize, AlignedSlice, AlignedSlice)) {
229229
unsafe {
230230
black_box(memcmp(
231231
black_box(dst.as_mut_ptr()),
@@ -235,7 +235,7 @@ mod mcmp {
235235
}
236236
}
237237

238-
library_benchmark_group!(name = memcmp; benchmarks = bench);
238+
library_benchmark_group!(name = memcmp; benchmarks = bench_cmp);
239239
}
240240

241241
mod mmove {
@@ -384,7 +384,7 @@ mod mmove {
384384
],
385385
setup = setup_forward
386386
)]
387-
fn forward((len, spread, mut buf): (usize, usize, AlignedSlice)) {
387+
fn forward_move((len, spread, mut buf): (usize, usize, AlignedSlice)) {
388388
// Test moving from the start of the buffer toward the end
389389
unsafe {
390390
black_box(memmove(
@@ -478,7 +478,7 @@ mod mmove {
478478
],
479479
setup = setup_backward
480480
)]
481-
fn backward((len, spread, mut buf): (usize, usize, AlignedSlice)) {
481+
fn backward_move((len, spread, mut buf): (usize, usize, AlignedSlice)) {
482482
// Test moving from the end of the buffer toward the start
483483
unsafe {
484484
black_box(memmove(
@@ -489,7 +489,7 @@ mod mmove {
489489
}
490490
}
491491

492-
library_benchmark_group!(name = memmove; benchmarks = forward, backward);
492+
library_benchmark_group!(name = memmove; benchmarks = forward_move, backward_move);
493493
}
494494

495495
use mcmp::memcmp;

0 commit comments

Comments
 (0)