-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Single byte coverage with branch coverage #113115
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
Draft
chapuni
wants to merge
203
commits into
main
Choose a base branch
from
users/chapuni/cov/single/trunk
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+731
−737
Conversation
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
`SingleByteCoverage` is not per-region attribute at least. At the moment, this change moves it into `FunctionRecord`.
- Round `Counts` as 1/0 - Confirm both `ExecutionCount` and `AltExecutionCount` are in range.
This return a counter for each term in the expression replaced by ReplaceMap. At the moment, this doesn't update the Map, so Map is marked as `const`.
This aggregates the generation of branch counter pair as `ExecCnt` and `SkipCnt`, to aggregate `CounterExpr::subtract`. At the moment: - This change preserves the behavior of `llvm::EnableSingleByteCoverage`. Almost of SingleByteCoverage will be cleaned up by coming commits. - `getBranchCounterPair()` is not called in `llvm::EnableSingleByteCoverage`. I will implement the new behavior of SingleByteCoverage in it. - `IsCounterEqual(Out, Par)` is introduced instead of `Counter::operator==`. Tweaks would be required for the comparison for additional counters. - Braces around `assert()` is intentional. I will add a statement there. https://discourse.llvm.org/t/rfc-integrating-singlebytecoverage-with-branch-coverage/82492
`CounterPair` can hold `<uint32_t, uint32_t>` instead of current `unsigned`, to hold also the counter number of SkipPath. For now, this change provides the skeleton and only `CounterPair::first` is used. Each counter number can have `None` to suppress emitting counter increment. `second` is initialized as `None` by default, since most `Stmt*` don't have a pair of counters. This change also provides stubs for the verifyer. I'll provide the impl of verifier for `+Asserts` later. `markStmtAsUsed(bool, Stmt*)` may be used to inform that other side counter may not emitted. `markStmtMaybeUsed(S)` may be used for the `Stmt` and its inner will be excluded for emission in the case of skipping by constant folding. I put it into places where I found. `verifyCounterMap()` will check the coverage map the counter map and can be used to report inconsistency. These verifier methods shall be eliminated in `-Asserts`. https://discourse.llvm.org/t/rfc-integrating-singlebytecoverage-with-branch-coverage/82492
…/single/replace' and 'users/chapuni/cov/single/pair' into HEAD
`getBranchCounterPair()` allocates an additional Counter to SkipPath in `SingleByteCoverage`. `IsCounterEqual()` calculates the comparison with rewinding counter replacements. `NumRegionCounters` is updated to take additional counters in account. `incrementProfileCounter()` has a few additiona arguments. - `UseSkipPath=true`, to specify setting counters for SkipPath. It assumes `UseSkipPath=false` is used together. - `UseBoth` may be specified for marking another path. It introduces the same effect as issueing `markStmtAsUsed(!SkipPath, S)`. `llvm-cov` discovers counters in `FalseCount` to allocate `MaxCounterID` for empty profile data.
…cov/single/replace' into users/chapuni/cov/single/nextcount-base
…puni/cov/single/nextcount
Currently `first` is not None by default.
…/single/nextcount' into users/chapuni/cov/single/base
…ngle/condop' and 'users/chapuni/cov/single/if' into users/chapuni/cov/single/binop-base
…ingle/binop' and 'users/chapuni/cov/single/switch' into HEAD
…/cov/single/binop
…ingle/binop-base Conflicts: clang/lib/CodeGen/CoverageMappingGen.cpp
…ngle/condop' and 'users/chapuni/cov/single/if' into users/chapuni/cov/single/binop-base
…/cov/single/binop
…ingle/nextcount-base
…puni/cov/single/nextcount
…ingle/loop Conflicts: clang/lib/CodeGen/CoverageMappingGen.cpp
…ingle/condop Conflicts: clang/lib/CodeGen/CoverageMappingGen.cpp
…ingle/if Conflicts: clang/lib/CodeGen/CoverageMappingGen.cpp
…ngle/condop' and 'users/chapuni/cov/single/if' into users/chapuni/cov/single/binop-base
…/cov/single/binop
…single/trunk Conflicts: clang/lib/CodeGen/CoverageMappingGen.cpp
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.
https://discourse.llvm.org/t/rfc-integrating-singlebytecoverage-with-branch-coverage/82492
This is squashed view of my requests.
Preparations
--binary-counters
#120841getBranchCounterPair()
. NFC. #112702CounterPair
for RegionCounterMap. NFC. #112724Practical changes
BinLAnd
andBinLOr
#113113Other requests (not here)
obj2yaml --covmap
will come soon.CustomSection
#115707std::array
available #116059