-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add option to mir::MutVisitor
to not invalidate CFG.
#100089
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
This comment has been minimized.
This comment has been minimized.
c5ba712
to
4265852
Compare
4265852
to
dd405fe
Compare
Thanks for the suggestions! @rustbot ready |
At some point it might be worth adding a validation of cached information behind Looks good, thanks! @bors delegate+ |
✌️ @JakobDegen can now approve this pull request |
This also applies that option to some uses of the visitor
dd405fe
to
7547084
Compare
Yes, definitely. At some point I want to add stateful analyses in the pass manager, at which point we'll definitely need this, so I'm kind of putting it off until then. |
@bors r=tmiasko rollup=never Potentially perf sensitive |
☀️ Test successful - checks-actions |
Finished benchmarking commit (cc4dd6f): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Footnotes |
This is a small enough regression that I don't think we need to investigate it deeply. I ran cachgrind diff, and I didn't see anything that really stood out to me although I can't say I understand this part of the code base deeply.
It seems there's more calls in type unification, but I don't see how this change would impact that. Let me know if you have any ideas. Until then, I'm marking this as triaged. @rustbot label +perf-regression-triaged |
This is definitely noise. This PR is doing strictly less work than before, I was possibly expecting an improvement, but don't see how this could cause a slowdown. |
I agree that this looks like noise. The code in and around |
Oh interesting. That makes sense actually, keccak is pretty heavy on the MIR infrastructure so that's one of the ones I would've expected to disproportionately benefit from this |
keccak has been kinda noisy recently, right ? The significance thresholding didn't find this 5% regression relevant either. |
This also applies that option to some uses of the visitor. I had considered a design more similar to #100087 in which we detect if the CFG needs to be invalidated, but that is more difficult with the visitor API and so I decided against it. Another alternative to this design is to offer an API for "saving" and "restoring" CFG caches across arbitrary code. Such an API is more general, and so we may eventually want it anyway, but it seems overkill for this use case.
r? @tmiasko