[PATCH] D129405: Addition of S_POGODATA field to PDB for better PGO analysis
Chandrasekar Balachandran via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 8 15:44:19 PDT 2022
cbalacha created this revision.
cbalacha added reviewers: LLVM, clang.
cbalacha added projects: clang, LLVM.
Herald added subscribers: wenlei, arphaman, hiraditya.
Herald added a project: All.
cbalacha requested review of this revision.
Herald added a subscriber: llvm-commits.
working on adding components to improve Profile Guided Optimization operations and am looking to propose a feature addition to the LLVM ASM Printer to allow S_POGODATA to be added to the PDB files to allow users who perform PGO to better understand its effects on a function level when looking at the PDB. This is what currently exists in the Microsoft Visual C++ compiler and I hope to enable clang to match the same on windows.
As per the publically available PDB GitHub info for Code View Info:microsoft-pdb/cvinfo.h at master · microsoft/microsoft-pdb · GitHub
S_POGODATA structure is defined by:
typedef struct POGOINFO {
unsigned short reclen; // Record length
unsigned short rectyp; // S_POGODATA
unsigned long invocations; // Number of times function was called
__int64 dynCount; // Dynamic instruction count
unsigned long numInstrs; // Static instruction count
unsigned long staInstLive; // Final static instruction count (post inlining)
} POGOINFO;
My hope is to update the CodeViewDebug::emitDebugInfoForFunction method to access the per function information and emit the record into the PDB.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D129405
Files:
llvm/include/llvm/CodeGen/AsmPrinter.h
llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
llvm/include/llvm/DebugInfo/CodeView/CodeViewSymbols.def
llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h
llvm/include/llvm/IR/FixedMetadataKinds.def
llvm/include/llvm/IR/Function.h
llvm/include/llvm/IR/MDBuilder.h
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp
llvm/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp
llvm/lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp
llvm/lib/IR/Function.cpp
llvm/lib/IR/MDBuilder.cpp
llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp
llvm/tools/llvm-pdbutil/MinimalSymbolDumper.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129405.443374.patch
Type: text/x-patch
Size: 16428 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220708/6a07413a/attachment.bin>
More information about the llvm-commits
mailing list