[PATCH] D81775: [COFF] Add .llvm.call-graph-profile and `--coff-cg-profile` dumpping

Zequan Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 16:34:14 PDT 2020


zequanwu created this revision.
Herald added subscribers: llvm-commits, rupprecht, MaskRay, hiraditya.
Herald added a reviewer: jhenderson.
Herald added a project: LLVM.
zequanwu edited the summary of this revision.
zequanwu added inline comments.


================
Comment at: llvm/lib/MC/MCParser/COFFAsmParser.cpp:336
+
+  // Only store non-temporary symbols.
+  if (!FromSym->isTemporary() && !ToSym->isTemporary())
----------------
Only store non-temporary symbols pairs.

In ELF, temporary symbols are also stored. I don't get the point of doing that. As I know, temporary symbols will not show up in object file. So, there is no reason to store temporary symbols.


================
Comment at: llvm/tools/llvm-readobj/llvm-readobj.cpp:349-352
+  cl::opt<bool> ELFCGProfile("elf-cg-profile", cl::desc("Display callgraph profile section"));
+
+// --coff-cg-profile
+  cl::opt<bool> COFFCGProfile("coff-cg-profile", cl::desc("Display callgraph profile section"));
----------------
Probably, these two should be combined into one option `--cg-profile`.


Add `.cg_profile` directive to COFF assembly. The format is the same as `.cg_profile` in ELF assembly.

Add `--coff-cg-profile` to dump contents of `.llvm.call-graph-profile`. The dumping format is the same as ELF.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81775

Files:
  llvm/include/llvm/MC/MCWinCOFFStreamer.h
  llvm/lib/MC/MCParser/COFFAsmParser.cpp
  llvm/lib/MC/MCWinCOFFStreamer.cpp
  llvm/lib/MC/WinCOFFObjectWriter.cpp
  llvm/test/MC/AsmParser/directive_cgprofile.s
  llvm/test/MC/COFF/cgprofile.s
  llvm/tools/llvm-readobj/COFFDumper.cpp
  llvm/tools/llvm-readobj/llvm-readobj.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81775.270540.patch
Type: text/x-patch
Size: 14779 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200612/d24ef51c/attachment-0001.bin>


More information about the llvm-commits mailing list