Added flags to display only the hot nodes (nodes who have at least one a successor who doesn't end
in deopt or unreachable) in the CFGPrinter graph. Before displaying the graph, the first run of the
function isNodeHidden launches a check for every BB in the graph on a matter of being hidden.
Before answering, each node and its successors are being checked for ending in deopt or unreachable
and verified with the corresponding flags ("cfg-hide-unreachable-paths" and "cfg-hide-deoptimize-paths")
being turned on. If the leaf node is such as described before, it is marked to be not shown in the graph.
If any node has all of its successors not being shown, this node is automatically not shown as well. This
check uses post-order traversal to make sure that all of the successors already have been visited before
making the analysis for the said node.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM with the renaming addressed.
llvm/lib/Analysis/CFGPrinter.cpp | ||
---|---|---|
39–44 | Suggest renaming to HideUnreachablePaths, HideDeoptimizePaths. |
Comment Actions
Resolving @apilipenko 's suggestions
As I don't have commit access, can you please commit the change for me?
Comment Actions
Replying to @davidxl
This option is useful when you are analyzing only the "hot" paths on the CFG.
Using these flags you are getting rid of all the unnecessary paths in the graph (the ones that end in deopt or are unreachable)
Comment Actions
This is mostly for performance analysis. In our compiler we end up with many code paths resulting in deoptimization. These code paths are supposed to be cold and are not interesting when we are looking for the "fast path" performance. Filtering these has a nice effect of streamlining the CFG to the common path only.
Suggest renaming to HideUnreachablePaths, HideDeoptimizePaths.