Fix unreachable coverage generation for inlined functions#98868
Merged
bors merged 4 commits intorust-lang:masterfrom Jul 22, 2022
Merged
Fix unreachable coverage generation for inlined functions#98868bors merged 4 commits intorust-lang:masterfrom
bors merged 4 commits intorust-lang:masterfrom
Conversation
Collaborator
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
Contributor
|
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
Contributor
Author
Member
|
Thank you for diving into this -- sorry my test case wasn't especially reduced! |
|
I'm out of office so I can't look at this in detail, but thanks for taking care of this! I scanned the source code changes and didn't see anything that stood out, except for some double nested loops. Not necessarily bad but just something maybe to do a performance test against if Tyler agrees. |
tmiasko
commented
Jul 5, 2022
Collaborator
|
☔ The latest upstream changes (presumably #99014) made this pull request unmergeable. Please resolve the merge conflicts. |
To generate a function coverage we need at least one coverage counter, so a coverage from unreachable blocks is retained only when some live counters remain. The previous implementation incorrectly retained unreachable coverage, because it didn't account for the fact that those live counters can belong to another function due to inlining.
c8e80f9 to
62ab4b6
Compare
Contributor
|
Hi! Any update on this? |
Member
|
It's awaiting a review. |
Contributor
|
@rustbot assign @wesleywiser |
wesleywiser
approved these changes
Jul 21, 2022
Member
Collaborator
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Jul 21, 2022
…leywiser Fix unreachable coverage generation for inlined functions To generate a function coverage we need at least one coverage counter, so a coverage from unreachable blocks is retained only when some live counters remain. The previous implementation incorrectly retained unreachable coverage, because it didn't account for the fact that those live counters can belong to another function due to inlining. Fixes rust-lang#98833.
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Jul 22, 2022
…leywiser Fix unreachable coverage generation for inlined functions To generate a function coverage we need at least one coverage counter, so a coverage from unreachable blocks is retained only when some live counters remain. The previous implementation incorrectly retained unreachable coverage, because it didn't account for the fact that those live counters can belong to another function due to inlining. Fixes rust-lang#98833.
This was referenced Jul 22, 2022
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 22, 2022
Rollup of 6 pull requests Successful merges: - rust-lang#98174 (Rename `<*{mut,const} T>::as_{const,mut}` to `cast_`) - rust-lang#98868 (Fix unreachable coverage generation for inlined functions) - rust-lang#99393 (feat: omit suffixes in const generics (e.g. `1_i32`)) - rust-lang#99423 (Group CSS font rule) - rust-lang#99539 (Improve suggestions for returning binding) - rust-lang#99579 (Add same warning to Result::expect as Result::unwrap) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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.
To generate a function coverage we need at least one coverage counter,
so a coverage from unreachable blocks is retained only when some live
counters remain.
The previous implementation incorrectly retained unreachable coverage,
because it didn't account for the fact that those live counters can
belong to another function due to inlining.
Fixes #98833.