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.
RFC at : https://discourse.llvm.org/t/rfc-addition-of-s-pogodata-field-to-pdb-for-better-pgo-analysis/63066