Unverified Commit 3d0a689e authored by Fangrui Song's avatar Fangrui Song Committed by GitHub
Browse files

[llvm-cov] Simplify and optimize MC/DC computation (#79727)

Update code from https://reviews.llvm.org/D138847

`buildTestVector` is a standard DFS (walking a reduced ordered binary
decision diagram). Avoid shouldCopyOffTestVectorFor{True,False}Path
complexity and redundant `Map[ID]` lookups.

`findIndependencePairs` unnecessarily uses four nested loops (n<=6) to
find independence pairs. Instead, enumerate the two execution vectors
and find the number of mismatches. This algorithm can be optimized using
the marking function technique described in _Efficient Test Coverage
Measurement for MC/DC,  2013_, but this may be overkill.
parent faf675ce
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment