Avoid invalidating the CFG in MirPatch#100087
Merged
bors merged 1 commit intorust-lang:masterfrom Aug 4, 2022
Merged
Conversation
As a part of this change, we adjust MirPatch to not needlessly create unnecessary resume blocks.
Collaborator
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
JakobDegen
commented
Aug 3, 2022
| fn remove_nop_landing_pads(&self, body: &mut Body<'_>) { | ||
| debug!("body: {:#?}", body); | ||
|
|
||
| // make sure there's a single resume block |
Contributor
Author
There was a problem hiding this comment.
Note that the claim that this ensured that the given block was the only resume block was wrong wrt the previous implementation too.
Contributor
|
Thanks! @bors r+ rollup=never |
Collaborator
Collaborator
Collaborator
|
☀️ Test successful - checks-actions |
This was referenced Aug 4, 2022
Collaborator
|
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 |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 9, 2022
…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`
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As a part of this change, we adjust
MirPatchto not needlessly create unnecessary resume blocks.r? @tmiasko