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 10 pull requests #103562

Merged
merged 20 commits into from
Oct 26, 2022
Merged

Rollup of 10 pull requests #103562

merged 20 commits into from
Oct 26, 2022

Conversation

Dylan-DPC
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

saethlin and others added 20 commits October 20, 2022 00:30
This allows porting uses of span_suggestions() to diagnostic structs.

Doesn't work for multipart_suggestions() because the rank would be
reversed - the struct would specify multiple spans, each of which has
multiple possible replacements, while multipart_suggestions() creates
multiple possible replacements, each with multiple spans.
Its usage was removed in 5e624bf and 093b075, so we do not need to
keep it around any longer. According to [preliminary
input](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Find.20.60rustc_driver.60.20dependent.20projects.3F/near/304490764),
we do not need to worry about any deprecation cycle for this API and can
just straight up remove it.

Migration instructions for remaining clients
--------------------------------------------

Change from

```rust

extern crate rustc_driver;

fn main() {
    rustc_driver::set_sigpipe_handler();
    // ...
```

to

```rust

fn main() {
    // ...
```
…bank

suggest type annotation for local statement initialed by ref expression

In a local statement with a type declaration, if a ref expression is used on the right side and not used on the left side, in addition to removing the `&` and `&mut` on the right side, we can add them on the left side alternatively
Fixes rust-lang#102892
…vidtwco

Diagnostic derives: allow specifying multiple alternative suggestions

This allows porting `span_suggestions()` to diagnostic structs.

Doesn't work for `multipart_suggestions()` because the rank would be reversed - the struct would specify multiple spans, each of which has multiple possible replacements, while `multipart_suggestions()` creates multiple possible replacements, each with multiple spans.
Use a faster allocation size check in slice::from_raw_parts

I've been perusing through the codegen changes that result from turning on the standard library debug assertions. The previous check in here uses saturating arithmetic, which in my experience sometimes makes LLVM just fail to optimize things around the saturating operation.

Here is a demo of the codegen difference: https://godbolt.org/z/WMEqrjajW
Before:
```asm
example::len_check_old:
        mov     rax, rdi
        mov     ecx, 3
        mul     rcx
        setno   cl
        test    rax, rax
        setns   al
        and     al, cl
        ret

example::len_check_old:
        mov     rax, rdi
        mov     ecx, 8
        mul     rcx
        setno   cl
        test    rax, rax
        setns   al
        and     al, cl
        ret
```
After:
```asm
example::len_check_new:
        movabs  rax, 3074457345618258603
        cmp     rdi, rax
        setb    al
        ret

example::len_check_new:
        shr     rdi, 60
        sete    al
        ret
```

Running rustc-perf locally, this looks like up to a 4.5% improvement when `debug-assertions-std = true`.

Thanks ```@LegionMammal978``` (I think that's you?) for turning my idea into a much cleaner implementation.

r? ```@thomcc```
…llot

Name the `impl Trait` in region bound suggestions

Slightly more descriptive message
…enkov

Workaround unstable stmt_expr_attributes for method receiver expressions

Fixes rust-lang#103244

cc ``@Mark-Simulacrum`` ``@ehuss``
…-diag, r=davidtwco

Remove extra type error after missing semicolon error

Fixes rust-lang#103425
rustc_middle: Rearrange resolver outputs structures slightly

Addresses rust-lang#98106 (comment).
I also haven't seen the motivation for moving `cstore` from its old place, so I moved it back in this PR.
r? ```@cjgillot```
Use &self instead of &mut self for cast methods

r? ``@oli-obk``
…, r=tmiasko

Remove `rustc_driver::set_sigpipe_handler()`

Its usage was removed in rust-lang#102587 and rust-lang#103495, so we do not need to keep it around any longer. According to [preliminary input](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Find.20.60rustc_driver.60.20dependent.20projects.3F/near/304490764), we do not need to worry about any deprecation cycle for this explicitly unstable API, and can just straight up remove it.

PR that added `set_sigpipe_handler`: rust-lang#49606

Tracking issue for `unix_sigpipe`: rust-lang#97889

Migration instructions for any remaining clients
---

Change from

```rust
#![feature(rustc_private)]

extern crate rustc_driver;

fn main() {
    rustc_driver::set_sigpipe_handler();
    // ...
```

to

```rust
#![feature(unix_sigpipe)]

#[unix_sigpipe = "sig_dfl"]
fn main() {
    // ...
```

``@rustbot`` labels +T-compiler
…=compiler-errors

Pinning tests for some `macro_rules!` errors discussed in the lang meeting

r? ``@nikomatsakis``

Mind just stamping these, since they were useful for the meeting discussion today?
@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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 Oct 26, 2022
@Dylan-DPC
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Oct 26, 2022

📌 Commit 703fb66 has been approved by Dylan-DPC

It is now in the queue for this repository.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 26, 2022
@bors
Copy link
Contributor

bors commented Oct 26, 2022

⌛ Testing commit 703fb66 with merge 629a414...

@bors
Copy link
Contributor

bors commented Oct 26, 2022

☀️ Test successful - checks-actions
Approved by: Dylan-DPC
Pushing 629a414 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 26, 2022
@bors bors merged commit 629a414 into rust-lang:master Oct 26, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 26, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (629a414): comparison URL.

Overall result: ❌ regressions - 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.

mean1 range count2
Regressions ❌
(primary)
0.3% [0.2%, 0.4%] 43
Regressions ❌
(secondary)
0.5% [0.2%, 1.2%] 25
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.2%, 0.4%] 43

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.

mean1 range count2
Regressions ❌
(primary)
3.6% [0.0%, 7.3%] 4
Regressions ❌
(secondary)
1.7% [1.7%, 1.7%] 1
Improvements ✅
(primary)
-1.9% [-2.5%, -1.2%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.8% [-2.5%, 7.3%] 6

Cycles

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

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@rustbot rustbot added the perf-regression Performance regression. label Oct 26, 2022
@pnkfelix
Copy link
Member

Visiting for weekly perf triage

  • all of the primary regressions (which seem small) are all in incr-patched scenarios. Most are also check builds, though there is some debug and opt mixed in as well.
  • hard to tell from the list of rolled up PR's which one(s) would be to blame here
  • w.r.t. the secondary benchmarks, the main contributor (in terms of the max regression observed) is deeply-nested-multi, which regressed by 0.74--1.2% depending on the scenario.
    • (In this case, the 1.2% regression is to a full build, not an incremental one.)
  • In any case, the sheer number of impacted benchmarks is large enough that this warrants further review.

Not marking as triaged. I'll try to dig into it later. (but right now I'm trying to finish the triage report in time to get it into TWIR.)

@pnkfelix
Copy link
Member

@rust-timer build 6c0fad93db5043ee93f7f771460b5e576941b464

@rust-timer
Copy link
Collaborator

Queued 6c0fad93db5043ee93f7f771460b5e576941b464 with parent d49e7e7, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6c0fad93db5043ee93f7f771460b5e576941b464): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

Instruction count

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

mean1 range count2
Regressions ❌
(primary)
0.3% [0.2%, 0.4%] 38
Regressions ❌
(secondary)
0.3% [0.2%, 0.6%] 18
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.2%, 0.4%] 38

Max RSS (memory usage)

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

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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.8% [3.5%, 4.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 28, 2022
pietroalbini added a commit to ferrocene/sphinx-shared-resources that referenced this pull request Mar 22, 2023
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. 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. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.