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 #112877

Merged
merged 19 commits into from
Jun 21, 2023
Merged

Rollup of 6 pull requests #112877

merged 19 commits into from
Jun 21, 2023

Conversation

Noratrieb
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

gootorov and others added 19 commits June 18, 2023 06:09
They both match on a `WorkItem`. It's simpler to do it all in one place.
There's no need to store it in `Queries`. We can just use a local
variable, because it's always used shortly after it's produced.

The commit also removes the `tcx.analysis()` call in `ongoing_codegen`,
because it's easy to ensure that's done beforehand.

All this makes the dataflow within `run_compiler` easier to follow, at
the cost of making one test slightly more verbose, which I think is a
good tradeoff.
…olnay

Implement PartialOrd for `Vec`s over different allocators

It is already possible to `PartialEq` `Vec`s with different allocators, but that is not the case with `PartialOrd`.
Make closure_saved_names_of_captured_variables a query.

As we will start removing debuginfo during MIR optimizations, we need to keep them somewhere.
Add a fully fledged `Clause` type, rename old `Clause` to `ClauseKind`

Does two basic things before I put up a more delicate set of PRs (along the lines of rust-lang#112714, but hopefully much cleaner) that migrate existing usages of `ty::Predicate` to `ty::Clause` (`predicates_of`/`item_bounds`/`ParamEnv::caller_bounds`).

1. Rename `Clause` to `ClauseKind`, so it's parallel with `PredicateKind`.
2. Add a new `Clause` type which is parallel to `Predicate`.
    * This type exposes `Clause::kind(self) -> Binder<'tcx, ClauseKind<'tcx>>` which is parallel to `Predicate::kind` 😸

The new `Clause` type essentially acts as a newtype wrapper around `Predicate` that asserts that it is specifically a `PredicateKind::Clause`. Turns out from experimentation[^1] that this is not negative performance-wise, which is wonderful, since this a much simpler design than something that requires encoding the discriminant into the alignment bits of a predicate kind, or something else like that...

r? ``@lcnr`` or ``@oli-obk``

[^1]: rust-lang#112714 (comment)
…trieb

Syntactically accept `become` expressions (explicit tail calls experiment)

This adds `ast::ExprKind::Become`, implements parsing and properly gates the feature.

cc `@scottmcm`
… r=oli-obk

More codegen cleanups

Some additional cleanups I found while looking closely at this code, following up from rust-lang#112827.

r= `@oli-obk`
Add retag in MIR transform: `Adt` for `Unique` may contain a reference

Following rust-lang#112662 , `may_contain_reference` in `rustc_mir_transform::add_retag` underapproximates too much the types that require retagging.

r? ``@RalfJung``
@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. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative rollup A PR which is a rollup labels Jun 21, 2023
@Noratrieb
Copy link
Member Author

@bors r+ rollup=never p=6

@bors
Copy link
Contributor

bors commented Jun 21, 2023

📌 Commit 82e6a16 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 Jun 21, 2023
@bors
Copy link
Contributor

bors commented Jun 21, 2023

⌛ Testing commit 82e6a16 with merge 97bf23d...

@bors
Copy link
Contributor

bors commented Jun 21, 2023

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 21, 2023
@bors bors merged commit 97bf23d into rust-lang:master Jun 21, 2023
11 checks passed
@rustbot rustbot added this to the 1.72.0 milestone Jun 21, 2023
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Perf Build Sha
#112844 4099ef6bc6cb28277ddefa3ec21b0f17a7fd9481
#112830 a9da8883befb892f66e7faf7ecb553b84378645b
#112790 748e77ec03f8b71483e02ac52b1e1434024c74bb
#112772 dad8cbecbcae8b2207db82233331bda53cea712b
#112759 fdc73c5110e9da83a7911436fdcbdc565bd61bdb
#112632 93a4575ddfcc4b8aa1fc7890751849dd4424ffcf

previous master: 67da586efe

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 (97bf23d): 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.4% [0.4%, 0.4%] 4
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 2
Improvements ✅
(primary)
-2.9% [-2.9%, -2.9%] 1
Improvements ✅
(secondary)
-78.9% [-78.9%, -78.9%] 1
All ❌✅ (primary) -0.3% [-2.9%, 0.4%] 5

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)
1.2% [0.5%, 2.0%] 20
Regressions ❌
(secondary)
4.5% [4.5%, 4.5%] 1
Improvements ✅
(primary)
-1.5% [-2.5%, -0.5%] 2
Improvements ✅
(secondary)
-20.4% [-20.4%, -20.4%] 1
All ❌✅ (primary) 0.9% [-2.5%, 2.0%] 22

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

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.3% [0.0%, 0.9%] 110
Regressions ❌
(secondary)
0.6% [0.0%, 1.5%] 49
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.0%, 0.9%] 110

Bootstrap: 657.896s -> 657.151s (-0.11%)

@rustbot rustbot added the perf-regression Performance regression. label Jun 21, 2023
@Kobzol
Copy link
Contributor

Kobzol commented Jun 21, 2023

@rust-timer build a9da8883befb892f66e7faf7ecb553b84378645b

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a9da8883befb892f66e7faf7ecb553b84378645b): 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)
1.0% [0.7%, 1.3%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.3% [-3.3%, -3.3%] 1
All ❌✅ (primary) 1.0% [0.7%, 1.3%] 2

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: 657.896s -> 656.742s (-0.18%)

@Kobzol
Copy link
Contributor

Kobzol commented Jun 21, 2023

@rust-timer build fdc73c5110e9da83a7911436fdcbdc565bd61bdb

@rust-timer

This comment has been minimized.

@Noratrieb Noratrieb deleted the rollup-5g5hegl branch June 21, 2023 15:10
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fdc73c5110e9da83a7911436fdcbdc565bd61bdb): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

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.4% [0.3%, 0.4%] 5
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 2
Improvements ✅
(primary)
-2.8% [-2.8%, -2.8%] 1
Improvements ✅
(secondary)
-78.9% [-78.9%, -78.9%] 1
All ❌✅ (primary) -0.2% [-2.8%, 0.4%] 6

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)
1.2% [0.5%, 1.7%] 20
Regressions ❌
(secondary)
4.5% [4.5%, 4.5%] 1
Improvements ✅
(primary)
-2.0% [-3.3%, -0.5%] 3
Improvements ✅
(secondary)
-11.6% [-20.5%, -2.7%] 2
All ❌✅ (primary) 0.7% [-3.3%, 1.7%] 23

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

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.3% [0.0%, 0.9%] 110
Regressions ❌
(secondary)
0.6% [0.0%, 1.5%] 49
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.0%, 0.9%] 110

Bootstrap: 657.896s -> 658.601s (0.11%)

@Noratrieb
Copy link
Member Author

@cjgillot awesome accidental optimization work :3

@Mark-Simulacrum Mark-Simulacrum added the perf-regression-triaged The performance regression has been triaged. label Jun 27, 2023
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 30, 2023
Rollup of 6 pull requests

Successful merges:

 - rust-lang#112632 (Implement PartialOrd for `Vec`s over different allocators)
 - rust-lang#112759 (Make closure_saved_names_of_captured_variables a query. )
 - rust-lang#112772 (Add a fully fledged `Clause` type, rename old `Clause` to `ClauseKind`)
 - rust-lang#112790 (Syntactically accept `become` expressions (explicit tail calls experiment))
 - rust-lang#112830 (More codegen cleanups)
 - rust-lang#112844 (Add retag in MIR transform: `Adt` for `Unique` may contain a reference)

r? `@ghost`
`@rustbot` modify labels: rollup
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. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative
Projects
None yet
Development

Successfully merging this pull request may close these issues.