Skip to content

Rollup of 6 pull requests #144718

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 16 commits into from
Jul 31, 2025
Merged

Rollup of 6 pull requests #144718

merged 16 commits into from
Jul 31, 2025

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented Jul 31, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

beepster4096 and others added 16 commits July 25, 2025 13:19
This allows us to assume that coverage spans will only be discarded during
codegen in very unusual situations.
… r=oli-obk

Fix Box allocator drop elaboration

New version of rust-lang#131146.

Clearing Box's drop flag after running its destructor can cause it to skip dropping its allocator, so just don't. Its cleared by the drop ladder code afterwards already.

Unlike the last PR this also handles other types with destructors properly, in the event that we can have open drops on them in the future (by partial initialization or DerefMove or something).

Finally, I also added tests for the interaction with async drop here but I discovered rust-lang#143658, so one of the tests has a `knownbug` annotation. Not sure if it should be in this PR at all though.

Fixes rust-lang#131082

r? wesleywiser - prev. reviewer
…fleLapkin

Implement support for `become` and explicit tail call codegen for the LLVM backend

This PR implements codegen of explicit tail calls via `become` in `rustc_codegen_ssa` and support within the LLVM backend. Completes a task on (rust-lang#112788). This PR implements all the necessary bits to make explicit tail calls usable, other backends have received stubs for now and will ICE if you use `become` on them. I suspect there is some bikeshedding to be done on how we should go about implementing this for other backends, but it should be relatively straightforward for GCC after this is merged.

During development I also put together a POC bytecode VM based on tail call dispatch to test these changes out and analyze the codegen to make sure it generates expected assembly. That is available [here](https://github.com/xacrimon/tcvm).
coverage: Re-land "Enlarge empty spans during MIR instrumentation"

This allows us to assume that coverage spans will only be discarded during codegen in very unusual situations.

---

This seemingly-simple change has a rather messy history:
- rust-lang#140847
- rust-lang#141650
- rust-lang#144298
- rust-lang#144480

Since then, a number of related changes have landed that should make it reasonable to try again:
- rust-lang#144530
- rust-lang#144560
- rust-lang#144616

In particular, we have multiple fixes/mitigations, and a confirmed regression test for the original bug that is not triggered by re-landing the changes in this PR.
…fflelapkin

Only extract lang items once in codegen_fn_attrs

This one should be obvious. These two extraction points used to be far apart but now that they're refactored to be close it was rather obvious we're just doing double work....

r? ``@WaffleLapkin``

Buils on rust-lang#144655
…terized, r=compiler-errors

Move `rustc_middle::parameterized`

It doesn't need to be in `rustc_middle`.

r? `@compiler-errors`
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jul 31, 2025
@Zalathar
Copy link
Contributor Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Jul 31, 2025

📌 Commit 9c6a618 has been approved by Zalathar

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

bors commented Jul 31, 2025

⌛ Testing commit 9c6a618 with merge cc0a5b7...

@bors
Copy link
Collaborator

bors commented Jul 31, 2025

☀️ Test successful - checks-actions
Approved by: Zalathar
Pushing cc0a5b7 to master...

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#135975 Implement push_mut de3e33fdc1bfbdb0cb947912ff0859fe677a4054 (link)
#143672 Fix Box allocator drop elaboration e1ed8e286ae6c46948a78f9228d61c9d61917b2c (link)
#144232 Implement support for become and explicit tail call codeg… 22613ede6f0d2525afbdbb06257cd3abc5d5a02e (link)
#144663 coverage: Re-land "Enlarge empty spans during MIR instrumen… 0f39cf639e7b09ecbe2d8fe424c52a1df12a2a92 (link)
#144685 Only extract lang items once in codegen_fn_attrs 61d82f123698f60c4c1b999ada79abdbf7d784fd (link)
#144717 Move rustc_middle::parameterized f187546e3442f1ccab0a2c98ede874f688b45c8d (link)

previous master: 32e7a4b92b

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@Zalathar Zalathar deleted the rollup-76lrtf2 branch July 31, 2025 08:56
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 32e7a4b (parent) -> cc0a5b7 (this PR)

Test differences

Show 268 test diffs

Stage 1

  • [codegen] tests/codegen-llvm/become-musttail.rs: [missing] -> pass (J1)
  • [mir-opt] tests/mir-opt/box_conditional_drop_allocator.rs: [missing] -> pass (J1)
  • [ui] tests/ui/async-await/async-drop/async-drop-box-allocator.rs: [missing] -> pass (J1)
  • [ui] tests/ui/async-await/async-drop/async-drop-box.rs: [missing] -> pass (J1)
  • [ui] tests/ui/drop/box-conditional-drop-allocator.rs: [missing] -> pass (J1)
  • [ui] tests/ui/explicit-tail-calls/recursion-etc.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/async-await/async-drop/async-drop-box-allocator.rs: [missing] -> pass (J0)
  • [ui] tests/ui/async-await/async-drop/async-drop-box.rs: [missing] -> pass (J0)
  • [ui] tests/ui/drop/box-conditional-drop-allocator.rs: [missing] -> pass (J0)
  • [ui] tests/ui/explicit-tail-calls/recursion-etc.rs: [missing] -> pass (J0)
  • [mir-opt] tests/mir-opt/box_conditional_drop_allocator.rs: [missing] -> pass (J2)
  • [codegen] tests/codegen-llvm/become-musttail.rs: [missing] -> pass (J3)

Additionally, 256 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 cc0a5b73053c62a3df5f84b3ee85079c9b65fa87 --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-2: 4392.8s -> 7293.9s (66.0%)
  2. x86_64-apple-1: 9118.2s -> 6397.5s (-29.8%)
  3. aarch64-apple: 6311.0s -> 4450.5s (-29.5%)
  4. dist-apple-various: 4489.3s -> 5494.2s (22.4%)
  5. dist-x86_64-windows-gnullvm: 6076.0s -> 7234.0s (19.1%)
  6. dist-x86_64-apple: 12320.3s -> 10617.4s (-13.8%)
  7. dist-aarch64-msvc: 5718.7s -> 4976.2s (-13.0%)
  8. dist-aarch64-apple: 7855.6s -> 7047.3s (-10.3%)
  9. dist-x86_64-musl: 7209.6s -> 7843.9s (8.8%)
  10. dist-sparcv9-solaris: 4951.1s -> 5323.8s (7.5%)
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 (cc0a5b7): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -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
Improvements ✅
(primary)
-0.5% [-0.6%, -0.5%] 2
Improvements ✅
(secondary)
-0.3% [-1.0%, -0.1%] 8
All ❌✅ (primary) -0.5% [-0.6%, -0.5%] 2

Max RSS (memory usage)

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

Cycles

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

Binary size

Results (primary 0.1%, 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.1% [0.0%, 0.3%] 32
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 7
Improvements ✅
(primary)
-0.2% [-0.4%, -0.0%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-0.4%, 0.3%] 35

Bootstrap: 467.812s -> 468.739s (0.20%)
Artifact size: 376.72 MiB -> 376.79 MiB (0.02%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup 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. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants