[PATCH] D157913: [Coverage] Allow Clang coverage to be used with debug info correlation.

Zequan Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 13:30:34 PDT 2023

zequanwu added a comment.

In D157913#4646184 <https://reviews.llvm.org/D157913#4646184>, @ellis wrote:

> It looks like `debug-info-correlate-coverage.ll` was renamed twice. Is this intended?

I just moved `llvm/test/Instrumentation/InstrProfiling/debug-info-correlate-coverage.ll.` to `llvm/test/Instrumentation/InstrProfiling/debug-info-correlate-byte-coverage.ll` and created a new test file `llvm/test/Instrumentation/InstrProfiling/debug-info-correlate-clang-coverage.ll.`

Comment at: compiler-rt/lib/profile/InstrProfilingWriter.c:276-277
       __llvm_profile_get_num_counters(CountersBegin, CountersEnd);
-  const uint64_t NamesSize = DebugInfoCorrelate ? 0 : NamesEnd - NamesBegin;
+  const uint64_t NamesSize =
+      DebugInfoCorrelate && IRLevelProfile ? 0 : NamesEnd - NamesBegin;
ellis wrote:
> Can we remove changes to this file now that we are stripping the names section?
Reverted all changes in this file.

Comment at: llvm/lib/ProfileData/InstrProfCorrelator.cpp:423
+      }
+      return;
+    }
ellis wrote:
> I think this return should be on the line above to break out of the for loop early. Or did I miscount the brackets?
Removed that if. It's already checked inside `IsDIEOfCovName`.

Comment at: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:769
+  if (DebugInfoCorrelate && !ReferencedNames.empty()) {
+    MDNode *Node = *M->debug_compile_units_begin();
ellis wrote:
> Just so that I understand. Does this code run only for names of unused functions? Or will we store all function names with `CovFunctionNameAnnotation`?
Just the names of unused functions. All instrumented functions names will still be stored at the same place as before.

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list