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

Alloc hir::Lit in an arena to remove the destructor from Expr #109588

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

Noratrieb
Copy link
Member

This allows allocating Exprs into a dropless arena, which is useful for using length prefixed thing slices in HIR, since these can only be allocated in the dropless arena and not in a typed arena.

@rustbot
Copy link
Collaborator

rustbot commented Mar 25, 2023

r? @lcnr

(rustbot has picked a reviewer for you, use r? to override)

@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 Mar 25, 2023
@Noratrieb
Copy link
Member Author

@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 Mar 25, 2023
@bors
Copy link
Collaborator

bors commented Mar 25, 2023

⌛ Trying commit 9985737 with merge a34861623e5b0d2dce2dc5e49e4c4a7e6737ddda...

};
}

static_assert_no_destructor!(Expr<'_>);
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure whether this is a useful thing to have, but I used to to make sure that my code was correct and didn't want to immediately delete it

Copy link
Member

Choose a reason for hiding this comment

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

maybe we should assert that all hir arena_types are dropless?

Copy link
Member Author

Choose a reason for hiding this comment

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

this is kinda what #109590 does actually

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, I'll just remove the assertion here, makes no sense to land, we should just land the other PR afterwards

@bors
Copy link
Collaborator

bors commented Mar 25, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 25, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 25, 2023

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@Noratrieb
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Mar 25, 2023

⌛ Trying commit a14e95ba5779f7334f8f3d1850ab23872ead4933 with merge d329a0a3cf1266923851345bd53ba5a5da70808c...

@bors
Copy link
Collaborator

bors commented Mar 25, 2023

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

1 similar comment
@bors
Copy link
Collaborator

bors commented Mar 25, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d329a0a3cf1266923851345bd53ba5a5da70808c): comparison URL.

Overall result: ❌✅ regressions and improvements - 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-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.6% [0.6%, 0.6%] 2
Regressions ❌
(secondary)
0.5% [0.3%, 0.6%] 4
Improvements ✅
(primary)
-0.7% [-1.1%, -0.4%] 5
Improvements ✅
(secondary)
-0.6% [-1.1%, -0.3%] 13
All ❌✅ (primary) -0.3% [-1.1%, 0.6%] 7

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.4% [2.6%, 4.6%] 9
Regressions ❌
(secondary)
3.0% [0.6%, 7.6%] 127
Improvements ✅
(primary)
-2.3% [-2.6%, -2.0%] 3
Improvements ✅
(secondary)
-1.9% [-3.8%, -0.7%] 5
All ❌✅ (primary) 2.0% [-2.6%, 4.6%] 12

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.3% [0.4%, 3.1%] 6
Improvements ✅
(primary)
-1.1% [-1.1%, -1.1%] 1
Improvements ✅
(secondary)
-2.1% [-3.0%, -0.5%] 3
All ❌✅ (primary) -1.1% [-1.1%, -1.1%] 1

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 25, 2023
@Noratrieb
Copy link
Member Author

It got generally a little faster, but max rss went up quite a bit for very literal heavy stress tests like deep-vector. Maybe LitKinds should be interned? Not sure whether this is worth worrying about though, the programs are really extreme and the absolute numbers are probably still pretty low.

@rust-log-analyzer

This comment has been minimized.

@Noratrieb
Copy link
Member Author

The follow up PR got rid of the regressions: #109590 (comment)

Oh wait, I misinterpreted this PR's relationship with the other one.

@Nilstrieb, do you want to land this by itself? Or should we just close it and I can review the other one I guess?

apparently these "regressions" are just noise (as usual) so I'll just merge this one on its own, it's a clear improvement.

@Noratrieb
Copy link
Member Author

@bors r=compiler-errors

@bors
Copy link
Collaborator

bors commented Apr 16, 2023

📌 Commit e616391a06c8187b92ab3d1effd23738abc90a9e has been approved by compiler-errors

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 Apr 16, 2023
@Noratrieb
Copy link
Member Author

Noratrieb commented Apr 16, 2023

@bors r-
I wanted to remove an assertion

This allows allocating `Expr`s into a dropless arena, which is useful
for using length prefixed thing slices in HIR, since these can only be
allocated in the dropless arena and not in a typed arena. This is
something I'm working on.
@Noratrieb
Copy link
Member Author

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 16, 2023

📌 Commit 34ed5c3 has been approved by Nilstrieb

It is now in the queue for this repository.

@Noratrieb
Copy link
Member Author

@bors r=compiler-errors

@bors
Copy link
Collaborator

bors commented Apr 16, 2023

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Collaborator

bors commented Apr 16, 2023

📌 Commit 34ed5c3 has been approved by compiler-errors

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Apr 17, 2023

⌛ Testing commit 34ed5c3 with merge 53ac4f8...

@bors
Copy link
Collaborator

bors commented Apr 17, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing 53ac4f8 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 17, 2023
@bors bors merged commit 53ac4f8 into rust-lang:master Apr 17, 2023
@rustbot rustbot added this to the 1.71.0 milestone Apr 17, 2023
@Noratrieb Noratrieb deleted the dropless-expr branch April 17, 2023 08:39
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (53ac4f8): 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)
1.6% [0.7%, 2.7%] 4
Regressions ❌
(secondary)
6.3% [5.0%, 8.1%] 6
Improvements ✅
(primary)
-0.5% [-0.6%, -0.1%] 3
Improvements ✅
(secondary)
-0.6% [-2.4%, -0.3%] 21
All ❌✅ (primary) 0.7% [-0.6%, 2.7%] 7

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.5% [3.1%, 3.9%] 2
Regressions ❌
(secondary)
3.6% [2.6%, 5.3%] 13
Improvements ✅
(primary)
-3.5% [-3.6%, -3.4%] 2
Improvements ✅
(secondary)
-2.9% [-5.2%, -1.4%] 10
All ❌✅ (primary) 0.0% [-3.6%, 3.9%] 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)
- - 0
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.4% [-3.4%, -3.4%] 1
All ❌✅ (primary) - - 0

@rustbot rustbot added the perf-regression Performance regression. label Apr 17, 2023
@Noratrieb
Copy link
Member Author

This was green before the merge and this doesn't touch any type system stuff (which cranelift-codegen and keccak hit). Ran a cachegrind anyways

1,361,808,876  ???:<rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>

The only regression for keccak. Those noise levels are absolutely crazy. I'm not gonna mark it as triaged to make sure that it's triaged appropriately but yeah, no concern about this PR.

@nnethercote
Copy link
Contributor

Those noise levels are absolutely crazy.

Can you clarify? keccak has been very noisy at times in the past, but recently it's been stable.

Screenshot 2023-04-17 at 9 52 23 pm

@Noratrieb
Copy link
Member Author

Noratrieb commented Apr 17, 2023

Well, the 8% here (which has to be noise, given that this was neutral before and also doesn't touch anything related) is pretty high

@lqd
Copy link
Member

lqd commented Apr 17, 2023

Noise seems likely, starting from this PR's parent about MIR inlining. Things could be on the way down to the previous steady state, hopefully.

image

@rylev
Copy link
Member

rylev commented Apr 19, 2023

Screenshot 2023-04-19 at 10 16 20

Does look like something has made keccak noisy again. The bump starts with this PR but I suppose that could be due to the the previous change kicking off some bimodal behaivor.

@Noratrieb
Copy link
Member Author

@rylev it was very likely the parent of this PR, #109247
that change inlining which keccak is very sensitive to

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2023
Impl `Copy` for most HIR types

This simplifies the invocation of the `arena_types` macro and probably
makes working with HIR nicer in general.

Based on rust-lang#109588
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. 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.

None yet

10 participants