Skip to content
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

Rollup of 6 pull requests #105531

Merged
merged 16 commits into from
Dec 10, 2022
Merged

Rollup of 6 pull requests #105531

merged 16 commits into from
Dec 10, 2022

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

TaKO8Ki and others added 16 commits December 7, 2022 12:55
Ensure that heap allocation does not occur in a thread until std::thread
is ready. This fixes issues with custom allocators that call
std::thread::current(), since doing so prematurely initializes
THREAD_INFO and causes the following thread_info::set() to fail.
This will allow us to separate the act of calculating the offsets from
creating LLVM IR that performs the actions.
In order for LLVM to correctly generate debuginfo for msvc, we sometimes
need to spill arguments to the stack and perform some direct & indirect
offsets into the value. Previously, this code always performed those
actions, even when not required as LLVM would clean it up during
optimization.

However, when MIR inlining is enabled, this can cause problems as the
operations occur prior to the spilled value being initialized. To solve
this, we first calculate the necessary offsets using just the type which
is side-effect free and does not alter the LLVM IR. Then, if we are in a
situation which requires us to generate the LLVM IR (and this situation
only occurs for arguments, not local variables) then we perform the same
calculation again, this time generating the appropriate LLVM IR as we
go.
This migrates everything but the `mbe` and `proc_macro` modules. It also
contains a few cleanups and drive-by/accidental diagnostic improvements
which can be seen in the diff for the UI tests.
…r=davidtwco

Migrate parts of `rustc_expand` to session diagnostics

This migrates everything but the `mbe` and `proc_macro` modules. It also contains a few cleanups and drive-by/accidental diagnostic improvements which can be seen in the diff for the UI tests.
…fee1-dead

Point at LHS on binop type err if relevant
Remove unneeded field from `SwitchTargets`

This had a fixme already. The only change in behavior is that the mir dumps now no longer contains labels for the types of the integers on the edges of a switchint:

Before:
![image](https://user-images.githubusercontent.com/51179609/205467622-34401a68-dca6-43eb-915e-b9fda1988860.png)

After:
![image](https://user-images.githubusercontent.com/51179609/205467634-b5b2a259-9cb4-4843-845c-592c500f0f9c.png)

I don't think that's a problem though. The information is still available to a user that really cares by checking the type of `_2`, so it honestly feels like a bit of an improvement to me.

r? mir
…, r=cuviper

Avoid heap allocation when truncating thread names

Ensure that heap allocation does not occur in a thread until `std::thread` is ready. This fixes issues with custom allocators that call `std::thread::current()`, since doing so prematurely initializes `THREAD_INFO` and causes the following `thread_info::set()` to fail.
Consider `parent_count` for const param defaults

Fixes rust-lang#105257
…iasko

Fix invalid codegen during debuginfo lowering

In order for LLVM to correctly generate debuginfo for msvc, we sometimes need to spill arguments to the stack and perform some direct & indirect offsets into the value. Previously, this code always performed those actions, even when not required as LLVM would clean it up during optimization.

However, when MIR inlining is enabled, this can cause problems as the operations occur prior to the spilled value being initialized. To solve this, we first calculate the necessary offsets using just the type which is side-effect free and does not alter the LLVM IR. Then, if we are in a situation which requires us to generate the LLVM IR (and this situation only occurs for arguments, not local variables) then we perform the same calculation again, this time generating the appropriate LLVM IR as we go.

r? `@tmiasko` but feel free to reassign if you want 🙂

Fixes rust-lang#105386
@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Dec 10, 2022
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=6

@bors
Copy link
Contributor

bors commented Dec 10, 2022

📌 Commit ab50529 has been approved by matthiaskrgr

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 Dec 10, 2022
@bors
Copy link
Contributor

bors commented Dec 10, 2022

⌛ Testing commit ab50529 with merge 32da230...

@bors
Copy link
Contributor

bors commented Dec 10, 2022

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 32da230 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 10, 2022
@bors bors merged commit 32da230 into rust-lang:master Dec 10, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 10, 2022
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Perf Build Sha
#105482 1f5c64cefb3c2441e362ae5e044601a0a3ecfb23
#105410 08d5abc05f8aa9df07e0d029e4830b62e2bb49f4
#105239 effd3c0f24490fa3b76ed350a0e5b4deda75df4d
#105234 ab8b9f9f58088cf9bf064d5e09f690d45412a381
#105192 8bb5db1bfb3345ae3d84769f118836ea7ecec234
#104460 5e5560ae51bbabae7c5b25f030781b9267be33fa

previous master: a161a7b654

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

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (32da230): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

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

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.6% [3.6%, 3.6%] 1
Regressions ❌
(secondary)
2.8% [0.8%, 5.9%] 8
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
-1.8% [-3.3%, -1.0%] 5
All ❌✅ (primary) 0.3% [-3.0%, 3.6%] 2

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.6% [2.1%, 3.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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. T-rustdoc Relevant to the rustdoc 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