[PATCH] D115693: [Try2][InstrProf] Attach debug info to counters

Ellis Hoag via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 13 19:36:22 PST 2021


ellis created this revision.
Herald added subscribers: ormris, wenlei, hiraditya.
ellis edited the summary of this revision.
ellis added reviewers: kyulee, alanphipps, MaskRay, wenlei, davidxl.
ellis updated this revision to Diff 394121.
ellis added a comment.
ellis published this revision for review.
Herald added projects: clang, Sanitizers, LLVM.
Herald added subscribers: llvm-commits, Sanitizers, cfe-commits.

Require linux to run test.


Add the llvm flag `-debug-info-correlate` to attach debug info to instrumentation counters so we can correlate raw profile data to their functions. Raw profiles are dumped as `.proflite` files. The next diff enables `llvm-profdata` to consume `.proflite` and debug info files to produce a normal `.profdata` profile.

Part of the "lightweight instrumentation" work: https://groups.google.com/g/llvm-dev/c/r03Z6JoN7d4

The original diff https://reviews.llvm.org/D114565 was reverted because of the `Instrumentation/InstrProfiling/debug-info-correlate.ll` test, which is fixed in this commit.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115693

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  compiler-rt/include/profile/InstrProfData.inc
  compiler-rt/lib/profile/InstrProfiling.c
  compiler-rt/lib/profile/InstrProfilingMerge.c
  compiler-rt/lib/profile/InstrProfilingWriter.c
  llvm/include/llvm/ProfileData/InstrProf.h
  llvm/include/llvm/ProfileData/InstrProfData.inc
  llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
  llvm/lib/ProfileData/InstrProf.cpp
  llvm/lib/ProfileData/InstrProfWriter.cpp
  llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
  llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  llvm/test/Instrumentation/InstrProfiling/debug-info-correlate.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115693.394121.patch
Type: text/x-patch
Size: 22332 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211214/9be92a5e/attachment.bin>


More information about the llvm-commits mailing list