Skip to content

Only traverse reachable blocks in JumpThreading. #142546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2025

Conversation

cjgillot
Copy link
Contributor

Fixes #131451

We only compute loop headers for reachable blocks. We shouldn't try to perform an opt on unreachable blocks anyway.

@rustbot
Copy link
Collaborator

rustbot commented Jun 15, 2025

r? @fee1-dead

rustbot has assigned @fee1-dead.
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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 15, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 15, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member

@bors try @rust-timer queue

r=me after perf

@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 Jun 15, 2025
bors added a commit that referenced this pull request Jun 15, 2025
Only traverse reachable blocks in JumpThreading.

Fixes #131451

We only compute loop headers for reachable blocks. We shouldn't try to perform an opt on unreachable blocks anyway.
@bors
Copy link
Collaborator

bors commented Jun 15, 2025

⌛ Trying commit 89b079d with merge c07ba10...

@bors
Copy link
Collaborator

bors commented Jun 16, 2025

☀️ Try build successful - checks-actions
Build commit: c07ba10 (c07ba10880fe4ac22aea41eae091bfd8a66e66dc)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c07ba10): comparison URL.

Overall result: ❌ regressions - no action needed

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.

@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.6% [0.6%, 0.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.6% [0.6%, 0.6%] 1

Max RSS (memory usage)

Results (primary 0.2%, secondary 4.3%)

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

mean range count
Regressions ❌
(primary)
3.3% [2.4%, 4.8%] 4
Regressions ❌
(secondary)
4.3% [4.3%, 4.3%] 1
Improvements ✅
(primary)
-3.0% [-3.6%, -2.2%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [-3.6%, 4.8%] 8

Cycles

Results (secondary -2.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)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 2
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%, secondary 0.0%)

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

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.1%] 2
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
-0.0% [-0.0%, -0.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-0.0%, 0.1%] 3

Bootstrap: 755.712s -> 756.317s (0.08%)
Artifact size: 372.06 MiB -> 372.12 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 16, 2025
@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 16, 2025

📌 Commit 89b079d has been approved by compiler-errors

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

bors commented Jun 21, 2025

⌛ Testing commit 89b079d with merge d4e1159...

@bors
Copy link
Collaborator

bors commented Jun 21, 2025

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing d4e1159 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 21, 2025
@bors bors merged commit d4e1159 into rust-lang:master Jun 21, 2025
11 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 21, 2025
Copy link
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 ea34650 (parent) -> d4e1159 (this PR)

Test differences

Show 6 test diffs

Stage 1

  • [crashes] tests/crashes/131451.rs: pass -> [missing] (J0)
  • [ui] tests/ui/mir/unreachable-loop-jump-threading.rs: [missing] -> pass (J0)

Stage 2

  • [crashes] tests/crashes/131451.rs: ignore (ignored if rustc wasn't built with debug assertions) -> [missing] (J1)
  • [crashes] tests/crashes/131451.rs: pass -> [missing] (J2)
  • [ui] tests/ui/mir/unreachable-loop-jump-threading.rs: [missing] -> pass (J2)
  • [ui] tests/ui/mir/unreachable-loop-jump-threading.rs: [missing] -> ignore (ignored if rustc wasn't built with debug assertions) (J3)

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard d4e1159b8c97478778b09a4cc1c7adce5653b8bf --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: 8947.3s -> 7078.8s (-20.9%)
  2. x86_64-rust-for-linux: 2953.4s -> 2500.5s (-15.3%)
  3. x86_64-gnu-tools: 3747.8s -> 3253.4s (-13.2%)
  4. i686-gnu-1: 8090.1s -> 7180.3s (-11.2%)
  5. mingw-check-1: 1727.4s -> 1544.6s (-10.6%)
  6. x86_64-gnu-llvm-19-1: 3722.6s -> 3335.6s (-10.4%)
  7. i686-gnu-nopt-1: 7949.7s -> 7151.4s (-10.0%)
  8. dist-ohos-armv7: 4358.4s -> 3938.5s (-9.6%)
  9. dist-powerpc-linux: 5264.7s -> 4774.8s (-9.3%)
  10. x86_64-gnu-debug: 5911.3s -> 5380.9s (-9.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
Collaborator

Finished benchmarking commit (d4e1159): 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)
1.6% [0.3%, 2.9%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 2
All ❌✅ (primary) 1.6% [0.3%, 2.9%] 2

Max RSS (memory usage)

Results (primary -1.8%, secondary -3.6%)

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

mean range count
Regressions ❌
(primary)
2.3% [2.0%, 2.5%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.5% [-6.0%, -3.7%] 3
Improvements ✅
(secondary)
-3.6% [-3.6%, -3.6%] 1
All ❌✅ (primary) -1.8% [-6.0%, 2.5%] 5

Cycles

Results (primary 3.0%, secondary 2.8%)

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

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

Binary size

Results (primary 0.3%, secondary 0.0%)

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

mean range count
Regressions ❌
(primary)
0.4% [0.1%, 1.1%] 5
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) 0.3% [-0.2%, 1.1%] 6

Bootstrap: 691.091s -> 691.957s (0.13%)
Artifact size: 371.86 MiB -> 371.85 MiB (-0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Jun 21, 2025
@cjgillot cjgillot deleted the reachable-jump branch June 22, 2025 08:35
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.

ICE: jump threading: 2 != 1
7 participants