-
Notifications
You must be signed in to change notification settings - Fork 13.3k
NLL: Walk the MIR only once for the "unused mut" lint #51660
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
Conversation
@bors try |
NLL: Walk the MIR only once for the "unused mut" lint Turns the quadratic loop gathering local variable assignments into a single MIR walk, and brings down the number of `super_mir` calls generated from `do_mir_borrowck` to the expected levels seen in `nll::replace_regions_in_mir` and `nll::compute_regions`, i.e. on clap: 1883 `super_mir` calls instead of 8011. The limited perf numbers I could gather on my machines look to be what we expected: `clap-check` seems to be gaining back a lot of the 7% we previously saw in `visit_mir`. Fixes #51641. r? @nikomatsakis
} | ||
|
||
match place_context { | ||
PlaceContext::Store | PlaceContext::Call => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should factor this out to share code with the find_assignments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
basically just make a fn that returns a bool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe share code with this function?
rust/src/librustc_mir/util/liveness.rs
Line 229 in 637fd2e
pub fn categorize<'tcx>(context: PlaceContext<'tcx>, mode: LivenessMode) -> Option<DefUse> { |
☀️ Test successful - status-travis |
@bors r+ |
📌 Commit 63a4e72 has been approved by |
⌛ Testing commit 63a4e72 with merge 16063f00f7b8a253cb2f15c4e405a402a997cb43... |
💔 Test failed - status-travis |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
@kennytm the failures look like CI network issues right ? |
NLL: Walk the MIR only once for the "unused mut" lint Turns the quadratic loop gathering local variable assignments into a single MIR walk, and brings down the number of `super_mir` calls generated from `do_mir_borrowck` to the expected levels seen in `nll::replace_regions_in_mir` and `nll::compute_regions`, i.e. on clap: 1883 `super_mir` calls instead of 8011. The limited perf numbers I could gather on my machines look to be what we expected: `clap-check` seems to be gaining back a lot of the 7% we previously saw in `visit_mir`. Fixes #51641. r? @nikomatsakis
☀️ Test successful - status-appveyor, status-travis |
Turns the quadratic loop gathering local variable assignments into a single MIR walk, and brings down the number of
super_mir
calls generated fromdo_mir_borrowck
to the expected levels seen innll::replace_regions_in_mir
andnll::compute_regions
, i.e. on clap: 1883super_mir
calls instead of 8011.The limited perf numbers I could gather on my machines look to be what we expected:
clap-check
seems to be gaining back a lot of the 7% we previously saw invisit_mir
.Fixes #51641.
r? @nikomatsakis