-
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
Avoid invalidating the CFG in MirPatch
#100087
Conversation
As a part of this change, we adjust MirPatch to not needlessly create unnecessary resume blocks.
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
@@ -83,9 +83,9 @@ impl RemoveNoopLandingPads { | |||
fn remove_nop_landing_pads(&self, body: &mut Body<'_>) { | |||
debug!("body: {:#?}", body); | |||
|
|||
// make sure there's a single resume block |
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.
Note that the claim that this ensured that the given block was the only resume block was wrong wrt the previous implementation too.
Thanks! @bors r+ rollup=never |
☀️ Test successful - checks-actions |
Finished benchmarking commit (3830eca): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesThis benchmark run did not return any relevant results for this metric. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
…tmiasko Add option to `mir::MutVisitor` to not invalidate CFG. This also applies that option to some uses of the visitor. I had considered a design more similar to rust-lang#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`
As a part of this change, we adjust
MirPatch
to not needlessly create unnecessary resume blocks.r? @tmiasko