Uh oh!
There was an error while loading. Please reload this page.
Add option to mir::MutVisitor to not invalidate CFG. - #100089
Conversation
rustbot
commented
Aug 3, 2022
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
This comment has been minimized.
This comment has been minimized.
c5ba712 to
4265852CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
4265852 to
dd405feCompareJakobDegen
commented
Aug 7, 2022
Thanks for the suggestions! @rustbot ready |
Uh oh!
There was an error while loading. Please reload this page.
tmiasko
commented
Aug 8, 2022
At some point it might be worth adding a validation of cached information behind Looks good, thanks! @bors delegate+ |
bors
commented
Aug 8, 2022
✌️ @JakobDegen can now approve this pull request |
This also applies that option to some uses of the visitor
dd405fe to
7547084CompareJakobDegen
commented
Aug 9, 2022
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. |
JakobDegen
commented
Aug 9, 2022
@bors r=tmiasko rollup=never Potentially perf sensitive |
bors
commented
Aug 9, 2022
bors
commented
Aug 9, 2022
bors
commented
Aug 9, 2022
☀️ Test successful - checks-actions |
rust-timer
commented
Aug 9, 2022
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 |
rylev
commented
Aug 9, 2022
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 |
JakobDegen
commented
Aug 9, 2022
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. |
nnethercote
commented
Aug 9, 2022
I agree that this looks like noise. The code in and around |
JakobDegen
commented
Aug 9, 2022
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 |
lqd
commented
Aug 10, 2022
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