-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
coverage: Clean up marker statements that aren't needed later #122542
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
d137432
to
49029e3
Compare
I’ve had the idea of doing this for a while, but I knew it couldn’t be done directly in InstrumentCoverage (because you can’t have nop statements that early), so I figured it would require its own separate clean pass. But then it occurred to me to look for existing cleanup passes to piggy-back on, and this seems like a perfect fit. |
Based on #114917 (comment) I suspect the But I think I'll leave things as-is in this PR, and then change the ignores in a follow-up PR, so that if anything goes wrong the changes won't be mixed together. |
8aa9f01
to
313b6a0
Compare
I ended up changing this after all. The new test now runs on any target, and uses |
This is now a prerequisite of #122860.
|
// These kinds of coverage statements are markers inserted during | ||
// MIR building, and are not needed after InstrumentCoverage. | ||
kind: CoverageKind::BlockMarker { .. } | CoverageKind::SpanMarker { .. }, |
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.
Please also add this to validation to ensure they never get reintroduced
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 added an appropriate check to CfgChecker
(diff).
This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras |
The only change to |
Oh, I guess |
Some of the marker statements used by coverage are added during MIR building for use by the InstrumentCoverage pass (during analysis), and are not needed afterwards.
@bors r+ rollup |
coverage: Clean up marker statements that aren't needed later Some of the marker statements used by coverage are added during MIR building for use by the InstrumentCoverage pass (during analysis), and are not needed afterwards. `@rustbot` label +A-code-coverage
coverage: Clean up marker statements that aren't needed later Some of the marker statements used by coverage are added during MIR building for use by the InstrumentCoverage pass (during analysis), and are not needed afterwards. ``@rustbot`` label +A-code-coverage
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#121619 (Experimental feature postfix match) - rust-lang#122370 (Gracefully handle `AnonConst` in `diagnostic_hir_wf_check()`) - rust-lang#122537 (interpret/allocation: fix aliasing issue in interpreter and refactor getters a bit) - rust-lang#122542 (coverage: Clean up marker statements that aren't needed later) - rust-lang#122800 (Add `NonNull::<[T]>::is_empty`.) - rust-lang#122820 (Stop using `<DefId as Ord>` in various diagnostic situations) - rust-lang#122847 (Suggest `RUST_MIN_STACK` workaround on overflow) - rust-lang#122855 (Fix Itanium mangling usizes) - rust-lang#122863 (add more ice tests ) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#122542 - Zalathar:cleanup, r=oli-obk coverage: Clean up marker statements that aren't needed later Some of the marker statements used by coverage are added during MIR building for use by the InstrumentCoverage pass (during analysis), and are not needed afterwards. ```@rustbot``` label +A-code-coverage
…ulacrum Clean up unnecessary headers/flags in coverage mir-opt tests During rust-lang#122542, I noticed that some of the headers and flags I had copied over from `tests/mir-opt/instrument_coverage.rs` were unnecessary. And while working to remove those, I noticed even more that could be removed or replaced.
…ulacrum Clean up unnecessary headers/flags in coverage mir-opt tests During rust-lang#122542, I noticed that some of the headers and flags I had copied over from `tests/mir-opt/instrument_coverage.rs` were unnecessary. And while working to remove those, I noticed even more that could be removed or replaced.
…ulacrum Clean up unnecessary headers/flags in coverage mir-opt tests During rust-lang#122542, I noticed that some of the headers and flags I had copied over from `tests/mir-opt/instrument_coverage.rs` were unnecessary. And while working to remove those, I noticed even more that could be removed or replaced.
Rollup merge of rust-lang#122995 - Zalathar:flags-mir-opt, r=Mark-Simulacrum Clean up unnecessary headers/flags in coverage mir-opt tests During rust-lang#122542, I noticed that some of the headers and flags I had copied over from `tests/mir-opt/instrument_coverage.rs` were unnecessary. And while working to remove those, I noticed even more that could be removed or replaced.
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#121619 (Experimental feature postfix match) - rust-lang#122370 (Gracefully handle `AnonConst` in `diagnostic_hir_wf_check()`) - rust-lang#122537 (interpret/allocation: fix aliasing issue in interpreter and refactor getters a bit) - rust-lang#122542 (coverage: Clean up marker statements that aren't needed later) - rust-lang#122800 (Add `NonNull::<[T]>::is_empty`.) - rust-lang#122820 (Stop using `<DefId as Ord>` in various diagnostic situations) - rust-lang#122847 (Suggest `RUST_MIN_STACK` workaround on overflow) - rust-lang#122855 (Fix Itanium mangling usizes) - rust-lang#122863 (add more ice tests ) r? `@ghost` `@rustbot` modify labels: rollup
Some of the marker statements used by coverage are added during MIR building for use by the InstrumentCoverage pass (during analysis), and are not needed afterwards.
@rustbot label +A-code-coverage