[llvm] [llvm-profdata] Reject merging single-byte-coverage with count profiles (PR #213177)

Ellis Hoag via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 1 10:14:38 PDT 2026


================
@@ -196,6 +198,11 @@ class InstrProfWriter {
           instrprof_error::unsupported_version,
           "cannot merge FunctionEntryOnly profiles and BB profiles together");
     }
+    if (static_cast<bool>((ProfileKind & InstrProfKind::SingleByteCoverage) ^
+                          (Other & InstrProfKind::SingleByteCoverage))) {
+      return make_error<InstrProfError>(
+          instrprof_error::coverage_count_mismatch);
+    }
----------------
ellishg wrote:

Now I'm wondering if we should use the existing `instrprof_error::unsupported_version` error type and add a custom string like we do for the other case in this function. It would be consistent and prevents the need to edit `InstrProf.{cpp,h}`

https://github.com/llvm/llvm-project/pull/213177


More information about the llvm-commits mailing list