-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
[WIP] Working expression optimization, and some improvements to branch-level source coverage #78040
[WIP] Working expression optimization, and some improvements to branch-level source coverage #78040
Commits on Oct 21, 2020
-
Injecting expressions in place of counters where helpful
Starting with implementing the Graph traits for the BasicCoverageBlock graph.
Configuration menu - View commit details
-
Copy full SHA for 51e07b8 - Browse repository at this point
Copy the full SHA 51e07b8View commit details -
Removed most TODO comments and OBE lines
Most of these TODO comments were reminders to remove commented out lines that were saved but replaced with an alternative implementation. Now that the new BCB graph is implemented and tests still pass, it should be safe to remove the older attempts.
Configuration menu - View commit details
-
Copy full SHA for ea64143 - Browse repository at this point
Copy the full SHA ea64143View commit details -
Expression optimization is nearly working
I need to change how I determine if a target from a SwitchInt exits the loop or not, but this almost worked (and did successfully compile and create the right coverage). It just didn't select the right targets for the optimized expressions.
Configuration menu - View commit details
-
Copy full SHA for dcb4b24 - Browse repository at this point
Copy the full SHA dcb4b24View commit details -
Configuration menu - View commit details
-
Copy full SHA for aa9747d - Browse repository at this point
Copy the full SHA aa9747dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d78047 - Browse repository at this point
Copy the full SHA 6d78047View commit details -
Still not fully optimized to remove unneeded expressions, or expressions that complicate the MIR a bit without really improving coverage or efficiency. Getting some coverage results that don't seem right: * In three tests, the last line of the function (last brace) is counted twice. * In simple_match, the { let z; match is counted zero times (and used to be uncovered) but how would a developer ever get non-zero coverage for this code?
Configuration menu - View commit details
-
Copy full SHA for bce5815 - Browse repository at this point
Copy the full SHA bce5815View commit details -
Fixed coverage issues that I didn't like.
* Avoid adding coverage to unreachable blocks. * Special case for Goto at the end of the body. Make it non-reportable.
Configuration menu - View commit details
-
Copy full SHA for 3aef9e0 - Browse repository at this point
Copy the full SHA 3aef9e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 756b920 - Browse repository at this point
Copy the full SHA 756b920View commit details -
Don't automatically add counters to BCBs without CoverageSpans
They may still get counters but only if there are dependencies from other BCBs that have spans, I think. At least one test, "various_conditions.rs", seems to have simplified counters as a result of this change, for whatever reason.
Configuration menu - View commit details
-
Copy full SHA for cc00eb0 - Browse repository at this point
Copy the full SHA cc00eb0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 736ddb9 - Browse repository at this point
Copy the full SHA 736ddb9View commit details -
Make CodeRegions optional for Counters too
I relized the "hack" with GapRegions was completely unnecessary. It is possible to inject counters (`llvm.instrprof.increment` intrinsic calls without corresponding code regions in the coverage map. An expression can still uses these counter values, solving the problem I thought I needed GapRegions for.
Configuration menu - View commit details
-
Copy full SHA for 6436892 - Browse repository at this point
Copy the full SHA 6436892View commit details -
instrument_coverage.rs -> instrument_coverage/mod.rs
Just moved the file, before refactoring into multiple files in the new compiler/rustc_mir/src/transform/instrument_coverage/ directory.
Configuration menu - View commit details
-
Copy full SHA for b052391 - Browse repository at this point
Copy the full SHA b052391View commit details -
Completed most of the refactoring, except make_bcb_counters()
Still working on make_bcb_counters() refacoring to split it into separate functions.
Configuration menu - View commit details
-
Copy full SHA for c564a3f - Browse repository at this point
Copy the full SHA c564a3fView commit details -
Apparently there were a few recent changes affecting tests
I should have re-tested for these, in the last PR. Here are those updates.
Configuration menu - View commit details
-
Copy full SHA for 1296fe3 - Browse repository at this point
Copy the full SHA 1296fe3View commit details -
Fixed four bugs found while compiling a larger set of real world crates
Compiling with coverage, with the expression optimization, now works on the json5format crate and its dependencies.
Configuration menu - View commit details
-
Copy full SHA for 334bbbe - Browse repository at this point
Copy the full SHA 334bbbeView commit details -
Refactored debug features from mod.rs to debug.rs
Also removed the SIMPLIFY_EXPRESSIONS option, which added complexity without tangible benefits.
Configuration menu - View commit details
-
Copy full SHA for 4ee5cec - Browse repository at this point
Copy the full SHA 4ee5cecView commit details
Commits on Oct 22, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 31a0b6b - Browse repository at this point
Copy the full SHA 31a0b6bView commit details -
Refactored make_bcb_counters() into several smaller functions
It could be refactored even further, if that's preferred/requested, but its much better than it was ;-).
Configuration menu - View commit details
-
Copy full SHA for 17c1f14 - Browse repository at this point
Copy the full SHA 17c1f14View commit details