Page MenuHomePhabricator

Heat Coloring (2/3): Adding Heat Functionality to CFGPrinter

Authored by knaumov on Mar 31 2020, 12:27 PM.



This patch is the second in the sequence of three patches related to the following diff ( The first patch from the sequence that has introduced the structure for DOTFunction Information is found here - D76820. This patch introduces the heat coloring of the Control Flow Graph which is based on the relative "hotness" of each BB. All the functionality of this patch was developed and discussed in the preceding patches.

Diff Detail

Event Timeline

knaumov created this revision.Mar 31 2020, 12:27 PM
davidxl added inline comments.Mar 31 2020, 1:05 PM

The formatting (indentation) looks wrong. Apply clang-format to fix it.


For color blinded folks, using different box size or box boundary thickness may be a better choice. Is it possible to add that?


These two methods do not belong to this patch.

knaumov updated this revision to Diff 254281.Apr 1 2020, 1:08 PM

Answering @davidxl 's comments:

  • Fixed the introduction of getNumOfCalls methods.
  • Concerning the color-blind accessibility - from my research, I have found that the combination of blue and red and all of the intermediate colors are well perceived by the majority of types of color-blind people. I have not found a way to make edges of the boxes gradually bolder to reflect the gradation from cold to hot methods. If any such solutions were to be found, it would be great to implement them, but my suggestion is to do it as a separate future patch while the current series of patches introduces only necessary functionality.
  • Clang-Format: I have applied the clang-format on the said file and found out that not only my changes were formatted, but most of the original file as well. I have reverted the clang-format, as it makes the diff big and hard to follow. Of course, once I am going to be pushing the changes, I will apply clang-format over all the files that were altered by my patches.

For clang-format, you can use clang/tools/clang-format/ to format diff only:

davidxl accepted this revision.Apr 8 2020, 10:11 AM


This revision is now accepted and ready to land.Apr 8 2020, 10:11 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2020, 1:03 PM