[PATCH] D29045: [PGO] Add option to dot-dump raw profile counts as computed by profile annotator

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 13:59:06 PST 2017


davidxl marked an inline comment as done.
davidxl added inline comments.


================
Comment at: lib/Transforms/Instrumentation/PGOInstrumentation.cpp:1240
+        (PGOViewFunction.empty() || F.getName().equals(PGOViewFunction))) {
+      ViewGraph(&Func, "PGORawCounts");
+    }
----------------
xur wrote:
> ViewGraph is interactive. Is WriteGraph better? 
> I tried the patch without specified the PGOViewFunction, it just pops too many windows at once.
make it display only there is one function specified. Also add function name in filenames.


================
Comment at: lib/Transforms/Instrumentation/PGOInstrumentation.cpp:1331
+    OS << Node->getName().str() << " : ";
+    UseBBInfo *BI = Graph->findBBInfo(Node);
+    if (BI->CountValid)
----------------
xur wrote:
> Check if BI is null. If the Node is not reachable from entry. We don't have a UseBBInfo.
Added check. How can that happen?


================
Comment at: lib/Transforms/Instrumentation/PGOInstrumentation.cpp:1332
+    UseBBInfo *BI = Graph->findBBInfo(Node);
+    if (BI->CountValid)
+      OS << BI->CountValue;
----------------
xur wrote:
> CountValid for the internal use. After count prorogation, all the reachable BBs should have a valid count. 
That is why unknown is displayed so that errors like this can be spotted.


https://reviews.llvm.org/D29045





More information about the llvm-commits mailing list