This is an archive of the discontinued LLVM Phabricator instance.

Add options to dump PGO counts in text.
ClosedPublic

Authored by hjyamauchi on Sep 12 2017, 3:34 PM.

Details

Summary

Added text options to -pgo-view-counts and -pgo-view-raw-counts that dump block frequency and branch probability info in text.

This is useful when the graph is very large and complex (the dot command crashes, lines/edges too close to tell apart, hard to navigate without textual search) or simply when text is preferred.

Event Timeline

hjyamauchi created this revision.Sep 12 2017, 3:34 PM
davidxl added inline comments.Sep 12 2017, 3:53 PM
lib/Transforms/Instrumentation/PGOInstrumentation.cpp
184

To share most of the code, I think it is better to make PGOViewRawCounts an enum type option, just like:

ViewBlockFreqPropagationDAG

By doing so, we can do:

-pgo-view-raw-counts=graph --> dump dot graph
-pgo-view-raw-counts=text --> dump text

similarly for the other option.

Addressed the comment.

hjyamauchi edited the summary of this revision. (Show Details)Sep 12 2017, 5:43 PM
hjyamauchi marked an inline comment as done.Sep 12 2017, 5:57 PM
davidxl accepted this revision.Sep 12 2017, 6:36 PM

lgtm

This revision is now accepted and ready to land.Sep 12 2017, 6:36 PM
hjyamauchi closed this revision.Sep 13 2017, 10:21 AM