-
Notifications
You must be signed in to change notification settings - Fork 13.4k
introduce dirty list to liveness, eliminate ins
vector
#51896
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 |
⌛ Trying commit 58ee87d with merge c27e6f7936761b7b1ff3b3db58ceb9d7fec0cf34... |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
☀️ Test successful - status-travis |
Perf is queued. |
(I'm updating the broken tests, those are nothing serious, just waiting for the build on my local machine) |
Perf URLs will be: |
cc #51819 |
☔ The latest upstream changes (presumably #51869) made this pull request unmergeable. Please resolve the merge conflicts. |
f140bca
to
3f6fe5f
Compare
Rebased. Perf results are ready and look good. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
3f6fe5f
to
73f8333
Compare
cc @rust-lang/compiler — this would be nice to land for NLL (it's a modest gain, but a useful one, and there are several other PRs building on this code). If anybody is able to review, would be appreciated. |
src/librustc_mir/util/liveness.rs
Outdated
// bits were not already present, then enqueue the predecessor | ||
// as dirty. | ||
for &pred_bb in &predecessors[bb] { | ||
if outs[pred_bb].union(&bits) { |
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 think there should be a comment indicating that union
returns true
if it changes anything. I don't normally associate that with the union operator.
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.
Yeah, those methods are undercommented. I'll add some comments. =)
src/librustc_mir/util/liveness.rs
Outdated
bits.overwrite(&outs[bb]); | ||
def_use[bb].apply(&mut bits); | ||
|
||
// add `bits` to the out set for each predecessor; if those |
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 add a remark that bits
now contains the state at the entry point the block (and has the value the previous ins
variable helt).
@@ -438,7 +432,6 @@ pub fn write_mir_fn<'a, 'tcx>( | |||
.collect(); | |||
writeln!(w, "{} {{{}}}", prefix, live.join(", ")) | |||
}; | |||
print(w, " ", &result.ins)?; |
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.
The removal of this is unfortunate. I don't know if anyone but me have used this for debugging though. It shouldn't be too hard to add code to compute ins
on demand if needed though.
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.
We already have the code to recompute it -- and in fact in the MIR dump, we include those results. I could update this code to match I suppose.
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.
(That is, in the NLL MIR dump)
r=me with the comments added |
@bors r=Zoxc I didn't modify the dumping code because I am running short of time. Easy enough to do in the future. |
📌 Commit 78ea952 has been approved by |
@bors p=1 Bumping priority as a number of NLL PRs are blocked on this, and NLL perf itself is pretty high priority and time sensitive. |
introduce dirty list to liveness, eliminate `ins` vector At least in my measurements, this seems to knock much of the liveness computation off the profile. r? @Zoxc cc @nnethercote
☀️ Test successful - status-appveyor, status-travis |
At least in my measurements, this seems to knock much of the liveness computation off the profile.
r? @Zoxc
cc @nnethercote