Skip to content

Optimize Cranelift with PGO - #163649

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
Kobzol:cranelift-pgo
Oct 4, 2026
Merged

rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
Kobzol:cranelift-pgo

Conversation

@Kobzol

@Kobzol Kobzol commented Oct 2, 2026

Copy link
Copy Markdown
Member

Opening for perf. experiments.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Oct 2, 2026
@Kobzol

Kobzol commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

@bors try jobs=dist-x86_64-linux @rust-timer queue backends=Llvm,Cranelift

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 2, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 2, 2026
Optimize Cranelift with PGO


try-job: dist-x86_64-linux
@rust-bors

rust-bors Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 65872f1 (65872f1ea564eab345f03ad14e54001032cffeb0)
Base parent: dba8825 (dba8825fe50879b22129271fb865944e384f7cce)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (65872f1): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never rustc-perf
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
2.2% [0.4%, 5.9%] 14
Regressions ❌
(secondary)
1.3% [0.3%, 4.7%] 102
Improvements ✅
(primary)
-4.1% [-10.6%, -0.3%] 72
Improvements ✅
(secondary)
-3.2% [-10.6%, -0.3%] 69
All ❌✅ (primary) -3.1% [-10.6%, 5.9%] 86

Max RSS (memory usage)

Results (primary -0.6%, secondary -0.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.8% [0.4%, 1.5%] 25
Regressions ❌
(secondary)
1.3% [0.4%, 4.9%] 84
Improvements ✅
(primary)
-1.0% [-2.2%, -0.4%] 88
Improvements ✅
(secondary)
-1.3% [-3.0%, -0.4%] 141
All ❌✅ (primary) -0.6% [-2.2%, 1.5%] 113

Cycles

Results (primary -1.2%, secondary -0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.9% [0.4%, 3.3%] 66
Regressions ❌
(secondary)
2.2% [0.4%, 16.9%] 120
Improvements ✅
(primary)
-2.4% [-8.7%, -0.4%] 120
Improvements ✅
(secondary)
-2.5% [-8.5%, -0.4%] 122
All ❌✅ (primary) -1.2% [-8.7%, 3.3%] 186

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 490.969s -> 492.497s (0.31%)
Artifact size: 408.65 MiB -> 409.36 MiB (0.17%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 2, 2026
@Kobzol

Kobzol commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

No changes on LLVM and nice wins for Cranelift. CI duration is extended by maybe 2-3 minutes, only for full builds, so that seems fine.

@Kobzol
Kobzol marked this pull request as ready for review October 2, 2026 15:23
@rustbot

rustbot commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

This PR modifies bootstrap.example.toml.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

This PR modifies src/bootstrap/src/core/config.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 2, 2026
@rustbot

rustbot commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Fallback group: @Mark-Simulacrum, @jieyouxu
  • @Mark-Simulacrum, @jieyouxu expanded to Mark-Simulacrum, jieyouxu
  • Random selection from Mark-Simulacrum, jieyouxu

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 1df9512 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 3, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 4, 2026
@rust-bors

rust-bors Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: Mark-Simulacrum
Duration: 3h 6m 34s
Pushing 56343b1 to main...

@rust-bors
rust-bors Bot merged commit 56343b1 into rust-lang:main Oct 4, 2026
16 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 1d9e680 (parent) -> 56343b1 (this PR)

Test differences

Show 1 test diff

Stage 2

  • [run-make] tests/run-make/compressed-debuginfo-zstd: ignore (ignored if LLVM wasn't build with zstd for ELF section compression or LLVM is not the default codegen backend) -> pass (J0)

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 56343b1a7d3fed3f349a5c2dc474f65b504f5221 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. test-x86_64-mingw-2: 1h 42m -> 2h 46m (+62.2%)
  2. dist-sparcv9-solaris: 1h 6m -> 1h 42m (+53.1%)
  3. dist-x86_64-msvc: 2h 1m -> 3h 3m (+51.6%)
  4. dist-x86_64-apple: 4h 33m -> 2h 14m (-51.0%)
  5. dist-powerpc64le-linux-gnu: 1h 9m -> 1h 40m (+44.5%)
  6. test-x86_64-gnu-gcc: 1h 36m -> 54m 54s (-43.0%)
  7. dist-x86_64-freebsd: 1h 3m -> 1h 29m (+41.7%)
  8. test-x86_64-msvc-ext3: 1h 57m -> 1h 8m (-41.1%)
  9. test-x86_64-gnu-nopt: 1h 49m -> 2h 34m (+40.3%)
  10. test-x86_64-msvc-2: 1h 52m -> 2h 35m (+39.0%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (56343b1): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (primary -3.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.6% [-3.6%, -3.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.6% [-3.6%, -3.6%] 1

Cycles

Results (primary 5.2%, secondary 2.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
5.2% [5.2%, 5.2%] 1
Regressions ❌
(secondary)
2.7% [2.3%, 3.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 5.2% [5.2%, 5.2%] 1

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 488.976s -> 488.752s (-0.05%)
Artifact size: 408.69 MiB -> 408.67 MiB (-0.00%)

@rustbot rustbot removed the perf-regression Performance regression. label Oct 4, 2026
@Kobzol
Kobzol deleted the cranelift-pgo branch October 4, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants