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

Make push_outlives_components into a TypeVisitor #127438

Merged
merged 2 commits into from
Jul 8, 2024

Conversation

compiler-errors
Copy link
Member

This involves removing the visited: &mut SsoHashSet<GenericArg<'tcx>> that is being passed around the VerifyBoundCx. The fact that we were using it when decomposing different type tests seems sketchy, so I don't think, though it may technically result in us registering more redundant outlives components 🤷

I did end up deleting some of the comments that referred back to RFC 1214 during this refactor. I can add them back if you think they were useful.

r? lcnr

@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. labels Jul 6, 2024
Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some nits and suggestions

compiler/rustc_type_ir/src/outlives.rs Outdated Show resolved Hide resolved
// OutlivesProjectionComponents. Continue walking
// through and constrain Pi.
let mut subcomponents = smallvec![];
compute_alias_components_recursive(self.tcx, ty, &mut subcomponents);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you inline this function? It's very subtle that it uses a separate visitor/cache, so I would like to make this very explicit

Copy link
Member Author

@compiler-errors compiler-errors Jul 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's being called in two places -- here, and in rustc_infer. That would require us to expose the outlives visitor there to replicate this behavior, or are you asking to just inline this one callsite? that seems weird imo

compiler/rustc_type_ir/src/outlives.rs Outdated Show resolved Hide resolved
compiler/rustc_type_ir/src/outlives.rs Outdated Show resolved Hide resolved
@lcnr
Copy link
Contributor

lcnr commented Jul 7, 2024

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 7, 2024
@bors
Copy link
Contributor

bors commented Jul 7, 2024

⌛ Trying commit 447dc44 with merge a1a2f19...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 7, 2024
…itor, r=<try>

Make `push_outlives_components` into a `TypeVisitor`

This involves removing the `visited: &mut SsoHashSet<GenericArg<'tcx>>` that is being passed around the `VerifyBoundCx`. The fact that we were using it when decomposing different type tests seems sketchy, so I don't think, though it may technically result in us registering more redundant outlives components 🤷

I did end up deleting some of the comments that referred back to RFC 1214 during this refactor. I can add them back if you think they were useful.

r? lcnr
@bors
Copy link
Contributor

bors commented Jul 7, 2024

☀️ Try build successful - checks-actions
Build commit: a1a2f19 (a1a2f193b85c6ae2d3d6c1660baffcda2d45bd41)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a1a2f19): comparison URL.

Overall result: ❌✅ regressions and improvements - no 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.

@bors rollup=never
@rustbot label: -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.

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

Max RSS (memory usage)

Results (primary -2.8%, secondary -1.2%)

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.5% [0.5%, 0.5%] 1
Improvements ✅
(primary)
-2.8% [-2.8%, -2.8%] 1
Improvements ✅
(secondary)
-1.5% [-2.7%, -0.6%] 5
All ❌✅ (primary) -2.8% [-2.8%, -2.8%] 1

Cycles

Results (secondary 0.4%)

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.6% [0.4%, 0.9%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.4%] 1
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 699.372s -> 699.027s (-0.05%)
Artifact size: 328.43 MiB -> 328.45 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 7, 2024
@lcnr
Copy link
Contributor

lcnr commented Jul 7, 2024

r=me after handling my comments in some way :3

@compiler-errors compiler-errors force-pushed the compute-outlives-visitor branch from 447dc44 to c895985 Compare July 7, 2024 15:23
@lcnr
Copy link
Contributor

lcnr commented Jul 8, 2024

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Jul 8, 2024

📌 Commit c895985 has been approved by lcnr

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

bors commented Jul 8, 2024

⌛ Testing commit c895985 with merge 59a4f02...

@bors
Copy link
Contributor

bors commented Jul 8, 2024

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 59a4f02 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 8, 2024
@bors bors merged commit 59a4f02 into rust-lang:master Jul 8, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 8, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (59a4f02): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

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

Cycles

Results (secondary -2.0%)

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

Binary size

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

Bootstrap: 700.455s -> 701.456s (0.14%)
Artifact size: 328.61 MiB -> 328.71 MiB (0.03%)

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. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants