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 8 pull requests #121345

Merged
merged 16 commits into from
Feb 20, 2024
Merged

Rollup of 8 pull requests #121345

merged 16 commits into from
Feb 20, 2024

Conversation

Noratrieb
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

reitermarkus and others added 16 commits February 17, 2024 21:58
This profile originally made sense when download-ci-llvm = if-unchanged
didn't exist and we had the bad tradeoff of "never modify or always
compile".

Thankfully, these grim times are over and we have discovered clean
water, so the only differentiator between the two profiles is the
codegen profile having LLVM assertions. Adding them doesn't cause that
much of a slowdown, <10% on UI tests from an unscientific benchmark.

It also had LLVM warnings when compiling, which makes sense for every
compiler contributor brave enough to compile LLVM.

The way I removed is by just issueing a nice error message. Given that
everyone with this profile should be a contributor and not someone like
a distro who is more upset when things break, this should be fine.
If it isn't, we can always fall back to just letting codegen mean
compiler.
…sertions)

The current complexities in `assert_unsafe_precondition` are delicately
balancing several concerns, among them compile times for the cases where
there are no debug assertions. This comes at a large runtime cost when
the assertions are enabled, making the debug assertion compiler a lot
slower, which is very annoying.

To avoid this, we always inline the check when building with debug
assertions.

Numbers (compiling stage1 library after touching core):
- master: 80s
- just adding `#[inline(always)]` to the `cfg(bootstrap)`
  `debug_assertions`: 67s
- this: 54s

So this seems like a good solution. I think we can still get
the same run-time perf improvements for other users too by
massaging this code further (see my other PR about adding
`#[rustc_no_mir_inline]`) but this is a simpler step that
solves the imminent problem of "holy shit my rustc is sooo slow".

Funny consequence: This now means compiling the standard library with
dbeug assertions makes it faster (than without, when using debug
assertions downstream)!
It is a clearer name because it communicates what the lint does
instead of the underlying mechanism it uses (const propagation).
resolve: Scale back unloading of speculatively loaded crates

Fixes rust-lang#120830 and fixes rust-lang#120909 while still unblocking rust-lang#117772.

I cannot reproduce https://github.com/parasyte/crash-rustc as an UI test for some reason, but I tested all the cases linked above manually.
…aethlin

Always inline check in `assert_unsafe_precondition` with cfg(debug_assertions)

The current complexities in `assert_unsafe_precondition` are delicately balancing several concerns, among them compile times for the cases where there are no debug assertions. This comes at a large runtime cost when the assertions are enabled, making the debug assertion compiler a lot slower, which is very annoying.

To avoid this, we always inline the check when building with debug assertions.

Numbers (compiling stage1 library after touching core):
- master: 80s
- just adding `#[inline(always)]` to the `cfg(bootstrap)` `debug_assertions` (equivalent to a bootstrap bump (uhh, i just realized that i was on a slightly outdated master so this bump might have happened already), (rust-lang#121112)): 67s
- this: 54s

So this seems like a good solution. I think we can still get the same run-time perf improvements for other users too by massaging this code further (see my other PR about adding `#[rustc_no_mir_inline]` rust-lang#121114) but this is a simpler step that solves the imminent problem of "holy shit my rustc is sooo slow".

Funny consequence: This now means compiling the standard library with dbeug assertions makes it faster (than without, when using debug assertions downstream)!

r? ```@saethlin``` (or anyone else if someone wants to review this)

fixes rust-lang#121110, supposedly
…s, r=dtolnay

Implement `NonZero` traits generically.

Tracking issue: rust-lang#120257

r? ````@dtolnay````
…y789

Remove the "codegen" profile from bootstrap

This profile originally made sense when download-ci-llvm = if-unchanged didn't exist and we had the bad tradeoff of "never modify or always compile".

Thankfully, these grim times are over and we have discovered clean water, so the only differentiator between the two profiles is the codegen profile having LLVM assertions. Adding them doesn't cause that much of a slowdown, <10% on UI tests from an unscientific benchmark.

It also had LLVM warnings when compiling, which makes sense for every compiler contributor brave enough to compile LLVM.

The way I removed is by just issueing a nice error message. Given that everyone with this profile should be a contributor and not someone like a distro who is more upset when things break, this should be fine. If it isn't, we can always fall back to just letting codegen mean compiler.
…-obk

Rename `ConstPropLint` to `KnownPanicsLint`

`OverflowLint` is a clearer name because it communicates what the lint does instead of the underlying mechanism it uses (const propagation) which should be of secondary concern.

`OverflowLint` isn't the most accurate name because the lint looks for other errors as well such as division by zero not just overflows, but I couldn't think of another equally succinct name.

As a part of this change. I've also added/updated some of the comments.

cc ```@RalfJung``` ```@oli-obk``` for visibility in case you go looking for the lint using the old name.

Edit:

Changed the name from `OverflowLint` to `KnownPanicsLint`
…strieb

target: Revert default to the medium code model on LoongArch targets

This reverts commit 35dad14.

Fixes rust-lang#121289
Remove `RefMutL` hack in `proc_macro::bridge`

From what I can tell, rust-lang#52812 is now fixed, so there is no longer any need to keep this hack around.
…safe_code, r=Nilstrieb

Trigger `unsafe_code` lint on invocations of `global_asm`

`unsafe_code` already warns about things that don't involve the `unsafe` keyword, e.g. `#[no_mangle]`. This makes it warn on `core::arch::global_asm` too.

Fixes rust-lang#103078
@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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 Feb 20, 2024
@Noratrieb
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Feb 20, 2024

📌 Commit d61adbf has been approved by Nilstrieb

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 Feb 20, 2024
@bors
Copy link
Contributor

bors commented Feb 20, 2024

⌛ Testing commit d61adbf with merge bb59453...

@bors
Copy link
Contributor

bors commented Feb 20, 2024

☀️ Test successful - checks-actions
Approved by: Nilstrieb
Pushing bb59453 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 20, 2024
@bors bors merged commit bb59453 into rust-lang:master Feb 20, 2024
12 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 20, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#121167 resolve: Scale back unloading of speculatively loaded crates 05eabfac1de10cf3c4fe7cd5f7570d7822045a86 (link)
#121196 Always inline check in assert_unsafe_precondition with cf… a405cc6de711814cbf1b07c8d99a922b22528489 (link)
#121241 Implement NonZero traits generically. e0ce28d4309768d7ac6596b8442df5335263d9e0 (link)
#121278 Remove the "codegen" profile from bootstrap 5288c1219ddb3b23d68fe9d6c6c1a067c8bfe571 (link)
#121286 Rename ConstPropLint to KnownPanicsLint 52959b140a6e58b89f04416ee61fdc6c873ac209 (link)
#121291 target: Revert default to the medium code model on LoongArc… 6db8721718f7751614a07cfcc3c0924ce0df03a1 (link)
#121302 Remove RefMutL hack in proc_macro::bridge f9324d0fd6c1fe874fbc5a91d5f701c34b8df051 (link)
#121318 Trigger unsafe_code lint on invocations of global_asm 856cafdf8110dc9ba1a74b6a6f43588b809ece6d (link)

previous master: 2b43e75c98

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 (bb59453): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

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

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.6% [0.4%, 1.1%] 9
Regressions ❌
(secondary)
1.7% [1.7%, 1.7%] 1
Improvements ✅
(primary)
-0.4% [-0.8%, -0.2%] 6
Improvements ✅
(secondary)
-0.8% [-2.1%, -0.3%] 17
All ❌✅ (primary) 0.2% [-0.8%, 1.1%] 15

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)
2.7% [2.2%, 3.7%] 3
Regressions ❌
(secondary)
2.6% [0.9%, 3.4%] 4
Improvements ✅
(primary)
-8.7% [-8.7%, -8.7%] 1
Improvements ✅
(secondary)
-2.8% [-4.9%, -0.6%] 2
All ❌✅ (primary) -0.2% [-8.7%, 3.7%] 4

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

Binary size

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.1% [0.1%, 0.1%] 3
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 3
Improvements ✅
(primary)
-0.2% [-0.6%, -0.0%] 15
Improvements ✅
(secondary)
-1.1% [-1.1%, -1.1%] 3
All ❌✅ (primary) -0.2% [-0.6%, 0.1%] 18

Bootstrap: 641.255s -> 639.883s (-0.21%)
Artifact size: 308.58 MiB -> 308.63 MiB (0.02%)

@rustbot rustbot added the perf-regression Performance regression. label Feb 20, 2024
@rylev
Copy link
Member

rylev commented Feb 27, 2024

@rust-timer build a405cc6

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a405cc6): comparison URL.

Overall result: no relevant changes - no action needed

Instruction count

This benchmark run did not return any relevant results for this metric.

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)
- - 0
Regressions ❌
(secondary)
3.9% [2.8%, 5.0%] 2
Improvements ✅
(primary)
-4.2% [-4.2%, -4.2%] 1
Improvements ✅
(secondary)
-2.1% [-2.1%, -2.1%] 1
All ❌✅ (primary) -4.2% [-4.2%, -4.2%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 641.255s -> 641.548s (0.05%)
Artifact size: 308.58 MiB -> 308.56 MiB (-0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. 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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.