Skip to content

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Oct 8, 2025

InstSimplify clears CFG caches.

But it currently happens between ReferencePropagation and GVN, which both use dominators, a quite expensive computation.

r? @ghost

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 8, 2025
@cjgillot
Copy link
Contributor Author

cjgillot commented Oct 8, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 8, 2025
Perform InstSimplify before ReferencePropagation.
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 8, 2025
@rust-bors
Copy link

rust-bors bot commented Oct 8, 2025

☀️ Try build successful (CI)
Build commit: 75c7a24 (75c7a2454a649e4bda64b5a90b553dea954a406f, parent: 82224f6891c7e7aa0c6c865aa825100b3ea2d0fb)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (75c7a24): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@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)
- - 0
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 4
Improvements ✅
(primary)
-0.3% [-0.7%, -0.1%] 9
Improvements ✅
(secondary)
-0.4% [-1.0%, -0.0%] 13
All ❌✅ (primary) -0.3% [-0.7%, -0.1%] 9

Max RSS (memory usage)

Results (primary 1.5%, secondary -3.9%)

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

mean range count
Regressions ❌
(primary)
3.3% [1.9%, 4.6%] 3
Regressions ❌
(secondary)
1.4% [0.6%, 2.2%] 2
Improvements ✅
(primary)
-3.8% [-3.8%, -3.8%] 1
Improvements ✅
(secondary)
-4.6% [-7.3%, -1.8%] 14
All ❌✅ (primary) 1.5% [-3.8%, 4.6%] 4

Cycles

Results (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
Regressions ❌
(secondary)
3.3% [2.4%, 4.2%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-4.4%, -1.0%] 6
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%, 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.2% [0.0%, 0.4%] 11
Regressions ❌
(secondary)
0.3% [0.2%, 0.4%] 3
Improvements ✅
(primary)
-0.1% [-0.8%, -0.0%] 22
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 2
All ❌✅ (primary) 0.0% [-0.8%, 0.4%] 33

Bootstrap: 473.927s -> 474.203s (0.06%)
Artifact size: 388.42 MiB -> 388.06 MiB (-0.09%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 8, 2025
@cjgillot cjgillot marked this pull request as ready for review October 8, 2025 22:31
@rustbot
Copy link
Collaborator

rustbot commented Oct 8, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@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 8, 2025
@cjgillot
Copy link
Contributor Author

cjgillot commented Oct 8, 2025

r? compiler

// After simplifycfg, it allows us to discover new opportunities for peephole
// optimizations.
// optimizations. This invalidates CFG caches, so avoid putting between two SSA
// analyses.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you name the two SSA analyses? It's not obvious to someone who doesn't know this code well.

@nnethercote
Copy link
Contributor

Nice speed improvements. r=me with the comment adjusted.

@cjgillot
Copy link
Contributor Author

cjgillot commented Oct 9, 2025

@bors r=nnethercote

@bors
Copy link
Collaborator

bors commented Oct 9, 2025

📌 Commit c3432bb has been approved by nnethercote

It is now in the queue for this repository.

@bors bors 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 9, 2025
@bors
Copy link
Collaborator

bors commented Oct 9, 2025

⌛ Testing commit c3432bb with merge 0b278a5...

@bors
Copy link
Collaborator

bors commented Oct 9, 2025

☀️ Test successful - checks-actions
Approved by: nnethercote
Pushing 0b278a5 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 9, 2025
@bors bors merged commit 0b278a5 into rust-lang:master Oct 9, 2025
11 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 9, 2025
Copy link
Contributor

github-actions bot commented Oct 9, 2025

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 4b57d81 (parent) -> 0b278a5 (this PR)

Test differences

Show 2 test diffs

2 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 0b278a539440be291466ea463a9b6310eaf4d7bb --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. dist-x86_64-apple: 6615.1s -> 8687.0s (31.3%)
  2. aarch64-apple: 7054.2s -> 8822.8s (25.1%)
  3. dist-x86_64-musl: 7517.6s -> 8567.1s (14.0%)
  4. dist-apple-various: 4342.8s -> 4910.9s (13.1%)
  5. dist-aarch64-apple: 7770.5s -> 6861.1s (-11.7%)
  6. dist-powerpc64-linux: 5245.6s -> 5701.9s (8.7%)
  7. x86_64-mingw-2: 7542.4s -> 8111.0s (7.5%)
  8. pr-check-1: 1446.3s -> 1533.3s (6.0%)
  9. aarch64-gnu: 6570.1s -> 6184.4s (-5.9%)
  10. x86_64-gnu-debug: 6774.2s -> 6386.8s (-5.7%)
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.

@cjgillot cjgillot deleted the reorder-passes branch October 9, 2025 17:39
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0b278a5): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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)
- - 0
Regressions ❌
(secondary)
0.2% [0.1%, 0.7%] 6
Improvements ✅
(primary)
-0.3% [-0.5%, -0.1%] 6
Improvements ✅
(secondary)
-0.3% [-0.6%, -0.1%] 6
All ❌✅ (primary) -0.3% [-0.5%, -0.1%] 6

Max RSS (memory usage)

Results (primary -0.2%, secondary -3.1%)

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

mean range count
Regressions ❌
(primary)
3.1% [2.0%, 4.4%] 4
Regressions ❌
(secondary)
1.4% [0.7%, 2.8%] 3
Improvements ✅
(primary)
-3.5% [-5.1%, -2.3%] 4
Improvements ✅
(secondary)
-4.3% [-6.7%, -1.0%] 12
All ❌✅ (primary) -0.2% [-5.1%, 4.4%] 8

Cycles

Results (secondary 0.2%)

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)
3.5% [2.4%, 4.6%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.1% [-4.6%, -1.2%] 5
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%, 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.2% [0.0%, 0.4%] 11
Regressions ❌
(secondary)
0.2% [0.0%, 0.4%] 4
Improvements ✅
(primary)
-0.1% [-0.8%, -0.0%] 22
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 2
All ❌✅ (primary) 0.0% [-0.8%, 0.4%] 33

Bootstrap: 473.051s -> 473.191s (0.03%)
Artifact size: 388.38 MiB -> 388.07 MiB (-0.08%)

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. perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants