[llvm-profdata] Add intersect/exclude subcommands to aid differential code coverage analysis.
This patch adds llvm-profdata [intersect|exclude] subcommands to help with differential code coverage analysis.
- llvm-profdata intersect <base profdata> <test profdata> -o <output filename>
takes two profile data as input, and outputs their intersection as a file on a given path.
- llvm-profdata exclude <base profdata> <test profdata> -o <output filename>
takes two profile data as input (base and test profdata, respectively), reduces the the base profdata such that it excludes any data found in the test profdata, and outputs the resulting profile data as a file on a given path.
These commands can be useful when comparing two distinct code coverage data obtained from different sets of test cases. With these commands we can more easily identify code regions that are (i) commonly covered by different sets of test cases via llvm-profdata intersect, and (ii) only covered by certain set of test cases via llvm-profdata exclude.
It seems that we're adding all J's to ValueData, even if they don't intersect with existing values in ValueData. Is this what we really want?