This is an archive of the discontinued LLVM Phabricator instance.

[PGO] Add option to view CFG with profile after profile annotation
ClosedPublic

Authored by davidxl on Jan 20 2017, 1:36 PM.

Details

Summary

Currently there is no way to view CFG with profile annotation right after the PGO annotation phase. This patch adds the support.

The profile displayed is based on BFI + entry profile count. This will be the profile which the downstream components see. A followup patch will be created to display CFG with raw profile counts produced by PGOUse phase. The later will be useful to detect bugs/limitations in BFI.

Diff Detail

Repository
rL LLVM

Event Timeline

davidxl created this revision.Jan 20 2017, 1:36 PM
vsk added inline comments.Jan 20 2017, 7:52 PM
Transforms/Instrumentation/PGOInstrumentation.cpp
151 ↗(On Diff #85182)

Could you change the name of the flag to reference the fact that this enables filtering by function name? E.g 'pgo-inspect-func' or 'pgo-view-function'.

1218 ↗(On Diff #85182)

Does this have to be guarded by NDEBUG? It seems strange that the cl::opt will be visible + non-functional in release mode.

davidxl added inline comments.Jan 21 2017, 6:52 PM
Transforms/Instrumentation/PGOInstrumentation.cpp
151 ↗(On Diff #85182)

ok

1218 ↗(On Diff #85182)

this is currently true for BFI graph viewer. We may need to clean it up later (depending on the size impact to the release clang build).

davidxl updated this revision to Diff 85271.Jan 21 2017, 6:53 PM

Address review feedback

vsk accepted this revision.Jan 23 2017, 10:01 AM

LGTM.

This revision is now accepted and ready to land.Jan 23 2017, 10:01 AM
This revision was automatically updated to reflect the committed changes.