This is an archive of the discontinued LLVM Phabricator instance.

Addition of S_POGODATA field to PDB for better PGO analysis
Needs ReviewPublic

Authored by cbalacha on Jul 8 2022, 3:44 PM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Restricted Project
Summary

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

Diff Detail

Event Timeline

cbalacha created this revision.Jul 8 2022, 3:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 8 2022, 3:44 PM
cbalacha requested review of this revision.Jul 8 2022, 3:44 PM
cbalacha edited the summary of this revision. (Show Details)Jul 8 2022, 3:45 PM
cbalacha edited the summary of this revision. (Show Details)Jul 22 2022, 2:48 PM
cbalacha updated this revision to Diff 474657.Nov 10 2022, 9:10 PM

Removed trailing white spaces from diff

cbalacha updated this revision to Diff 474659.Nov 10 2022, 9:29 PM

removed yet another trailing white space

cbalacha updated this revision to Diff 474672.Nov 10 2022, 11:47 PM

redo patch with latest code