[PATCH] D40425: Extending CFGPrinter and CallPrinter with Heat Colors

Rodrigo Caetano Rocha via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 07:36:37 PST 2017


rcorcs updated this revision to Diff 124573.
rcorcs added a comment.

Changes regarding @davidxl comments.

About the edge labels:
The default is to show the branch probability of the edge.
If -cfg-raw-weights=true, then it either displays the old label if it can be acquired from the metadata, otherwise it displays the product of branch probability and the source BB's frequency.

For the last comment about computing the max. freq. based on the function level.
I completely agree that a function level max. freq. can be misleading.
I had originally written my CFGHeatPrinter plugin as a ModulePass, which I believe is better suited for this use case.
I would then compute the heat-ratio of each basic block, based on the basic block with the max. freq. on the module level.


Repository:
  rL LLVM

https://reviews.llvm.org/D40425

Files:
  include/llvm/Analysis/CFGPrinter.h
  include/llvm/Analysis/HeatUtils.h
  lib/Analysis/CFGPrinter.cpp
  lib/Analysis/CMakeLists.txt
  lib/Analysis/CallPrinter.cpp
  lib/Analysis/DomPrinter.cpp
  lib/Analysis/HeatUtils.cpp
  lib/Analysis/RegionPrinter.cpp
  lib/Transforms/Scalar/NewGVN.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40425.124573.patch
Type: text/x-patch
Size: 38804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171128/f7d1b58e/attachment.bin>


More information about the llvm-commits mailing list