[PATCH] D84771: [llvm-profdata] Add intersect/exclude subcommands to aid differential code coverage analysis.

Matt Morehouse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 10:17:07 PDT 2020


morehouse added reviewers: vsk, wmi, davidxl.
morehouse added subscribers: vsk, davidxl, wmi.
morehouse added a comment.

Thanks, DK, this looks like approximately what we want.

@vsk, @wmi, @davidxl:  Would you be willing to take this patch once we clean it up?  The exclude operation is particularly useful for comparing coverage reports between fuzzing engines, or for checking new code coverage reached by a test case.



================
Comment at: llvm/lib/ProfileData/InstrProf.cpp:653
+    }
+    ValueData.insert(I, *J);
+  }
----------------
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?


================
Comment at: llvm/lib/ProfileData/InstrProf.cpp:754
+  for (uint32_t I = 0; I < ThisNumValueSites; I++)
+    ThisSiteRecords[I].intersect(OtherSiteRecords[I], Warn);
+}
----------------
This is nearly identical to `mergeValueProfData`.  Can we reuse some code?

And same for `uniqueValueProfData`.


================
Comment at: llvm/tools/llvm-profdata/llvm-profdata.cpp:956
+
+  return 0;
+}
----------------
This is nearly identical to `intersect_main`.  Can we reuse some code?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84771/new/

https://reviews.llvm.org/D84771



More information about the llvm-commits mailing list