[compiler-rt] [llvm] [InstrProf] Add debuginfod correlation support (PR #106606)

Zequan Wu via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 29 16:49:10 PDT 2024


================
@@ -113,11 +115,36 @@ InstrProfCorrelator::get(StringRef Filename, ProfCorrelatorKind FileKind) {
     return get(std::move(*BufferOrErr), FileKind);
   }
   if (FileKind == BINARY) {
-    auto BufferOrErr = errorOrToExpected(MemoryBuffer::getFile(Filename));
-    if (auto Err = BufferOrErr.takeError())
-      return std::move(Err);
+    if (!Filename.empty()) {
+      auto BufferOrErr = errorOrToExpected(MemoryBuffer::getFile(Filename));
+      if (auto Err = BufferOrErr.takeError())
+        return std::move(Err);
+      return get(std::move(*BufferOrErr), FileKind);
+    } else if (BIDFetcher) {
+      if (BIs->size() > 1)
+        return make_error<InstrProfError>(
+            instrprof_error::unable_to_correlate_profile,
+            "unsupported profile binary correlation when there are multiple "
+            "build IDs in a binary");
----------------
ZequanWu wrote:

IIUC, `BIs` is a vector of build IDs read from a raw profile. "in a binary" -> "in a raw profile". 

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


More information about the llvm-commits mailing list