Skip to content

MIR inliner maintains unused var_debug_info #142890

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 2 commits into from
Jul 4, 2025

Conversation

kornelski
Copy link
Contributor

Only full debuginfo level promises variable-level debug information, but the MIR inline pass needlessly preserved the local variable debug info for the limited level too.

@rustbot
Copy link
Collaborator

rustbot commented Jun 22, 2025

r? @saethlin

rustbot has assigned @saethlin.
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 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 22, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@mati865
Copy link
Member

mati865 commented Jun 23, 2025

@bors2 try @rust-timer queue

@rust-bors
Copy link

rust-bors bot commented Jun 23, 2025

⌛ Trying commit 8c3a8f8 with merge b8965fd

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jun 23, 2025
MIR inliner maintains unused var_debug_info

Only `full` debuginfo level promises variable-level debug information, but the MIR inline pass needlessly preserved the local variable debug info for the `limited` level too.
@rust-bors
Copy link

rust-bors bot commented Jun 23, 2025

☀️ Try build successful (CI)
Build commit: b8965fd (b8965fdc8fbcbc0a9c8de4899202d47eb3ea7043, parent: 58d5e1169056f31553ecf680b009a5770eb0e859)

@Kobzol
Copy link
Member

Kobzol commented Jun 23, 2025

@rust-timer build b8965fd

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b8965fd): 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)
3.8% [2.7%, 4.9%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.4% [-1.4%, -1.4%] 1
Improvements ✅
(secondary)
-1.4% [-1.4%, -1.4%] 1
All ❌✅ (primary) 2.1% [-1.4%, 4.9%] 3

Max RSS (memory usage)

Results (primary 4.3%, secondary 2.5%)

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

mean range count
Regressions ❌
(primary)
4.3% [4.3%, 4.3%] 1
Regressions ❌
(secondary)
2.5% [1.6%, 3.2%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 4.3% [4.3%, 4.3%] 1

Cycles

Results (primary 3.8%)

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

mean range count
Regressions ❌
(primary)
3.8% [2.9%, 4.7%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.8% [2.9%, 4.7%] 2

Binary size

Results (primary 1.3%)

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

mean range count
Regressions ❌
(primary)
1.3% [1.1%, 1.4%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.3% [1.1%, 1.4%] 2

Bootstrap: 688.673s -> 690.365s (0.25%)
Artifact size: 371.94 MiB -> 371.93 MiB (-0.00%)

@rust-log-analyzer

This comment has been minimized.

//@ [NONE]compile-flags: -O -C debuginfo=0
//@ [LIMITED]compile-flags: -O -C debuginfo=1

#[inline(always)]
Copy link
Member

Choose a reason for hiding this comment

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

FYI, this doesn't mean anything beyond #[inline] to the MIR inliner.

@saethlin
Copy link
Member

saethlin commented Jul 3, 2025

Looks good. Thanks for bearing with our slow review process.

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 3, 2025

📌 Commit c9ef116 has been approved by saethlin

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

bors commented Jul 3, 2025

⌛ Testing commit c9ef116 with merge 837c5dd...

@bors
Copy link
Collaborator

bors commented Jul 4, 2025

☀️ Test successful - checks-actions
Approved by: saethlin
Pushing 837c5dd to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 4, 2025
@bors bors merged commit 837c5dd into rust-lang:master Jul 4, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 4, 2025
Copy link
Contributor

github-actions bot commented Jul 4, 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 da58c05 (parent) -> 837c5dd (this PR)

Test differences

Show 10 test diffs

Stage 1

  • [mir-opt] tests/mir-opt/inline_var_debug_info_kept.rs#FULL: [missing] -> pass (J0)
  • [mir-opt] tests/mir-opt/inline_var_debug_info_kept.rs#LIMITED: [missing] -> pass (J0)
  • [mir-opt] tests/mir-opt/inline_var_debug_info_kept.rs#NONE: [missing] -> pass (J0)
  • [mir-opt] tests/mir-opt/inline_var_debug_info_kept.rs#PRESERVE: [missing] -> pass (J0)

Stage 2

  • [mir-opt] tests/mir-opt/inline_var_debug_info_kept.rs#FULL: [missing] -> pass (J1)
  • [mir-opt] tests/mir-opt/inline_var_debug_info_kept.rs#LIMITED: [missing] -> pass (J1)
  • [mir-opt] tests/mir-opt/inline_var_debug_info_kept.rs#NONE: [missing] -> pass (J1)
  • [mir-opt] tests/mir-opt/inline_var_debug_info_kept.rs#PRESERVE: [missing] -> pass (J1)

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

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 837c5dd7de03aa97190593aef4e70d53e1bb574b --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. x86_64-apple-1: 10898.6s -> 6968.0s (-36.1%)
  2. dist-apple-various: 7932.5s -> 6392.3s (-19.4%)
  3. x86_64-apple-2: 5528.6s -> 4853.5s (-12.2%)
  4. dist-arm-linux-gnueabi: 4668.4s -> 5066.4s (8.5%)
  5. x86_64-gnu-llvm-19-3: 6388.5s -> 6920.0s (8.3%)
  6. x86_64-mingw-2: 7160.7s -> 7632.9s (6.6%)
  7. tidy: 74.4s -> 70.0s (-5.9%)
  8. x86_64-msvc-ext2: 5804.4s -> 5493.8s (-5.4%)
  9. dist-aarch64-apple: 5705.2s -> 5405.2s (-5.3%)
  10. x86_64-gnu-llvm-19-1: 3426.5s -> 3268.4s (-4.6%)
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 (837c5dd): 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.8% [1.8%, 1.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.9% [-2.9%, -2.9%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.6% [-2.9%, 1.8%] 2

Max RSS (memory usage)

Results (secondary 0.4%)

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

Cycles

Results (primary -0.4%, secondary -2.6%)

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

mean range count
Regressions ❌
(primary)
2.1% [2.1%, 2.1%] 1
Regressions ❌
(secondary)
0.6% [0.4%, 0.7%] 2
Improvements ✅
(primary)
-2.9% [-2.9%, -2.9%] 1
Improvements ✅
(secondary)
-4.2% [-6.8%, -1.5%] 4
All ❌✅ (primary) -0.4% [-2.9%, 2.1%] 2

Binary size

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

Bootstrap: 462.222s -> 462.019s (-0.04%)
Artifact size: 372.18 MiB -> 372.15 MiB (-0.01%)

@kornelski kornelski deleted the unused-var-debug branch July 4, 2025 15:46
@panstromek
Copy link
Contributor

perf triage:

clap_derive improvement is bimodal noise. ripgrep regression doesn't make sense to me. We either do less work or the same amount of work here (not sure which debuginfo option we use for this benchmark). Wall time has no relevant changes, though, so I assume it's spurious.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Jul 7, 2025
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. perf-regression-triaged The performance regression has been triaged. 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.

10 participants