-
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
Fix unreachable coverage generation for inlined functions #98868
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
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. |
☔ 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
Hi! Any update on this? |
It's awaiting a review. |
@rustbot assign @wesleywiser |
…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.
…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.
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
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.