[PATCH] D86362: Allow graph writer to render DOT nodes using HTML.

Jamie Schmeiser via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 11:41:11 PDT 2020


jamieschmeiser added a comment.

I originally queried DTraits once and saved the result but clang-tidy complained about it (without a useful message) so I changed it to call it multiple times, which satisfied clang-tidy.  I personally prefer the previous code where it only queried it once...

I am in the process of contributing several change printers that only report when a pass actually changes the IR and these changes are for the final change printer.  Unfortunately, the commits are best presented in series, starting with https://reviews.llvm.org/D86360.  They build on each other, so as changes from reviews are made to the first in the series, the changes bubble up the chain and I was afraid of a lot of churn in the PRs.  I will post them and indicate the order and try to keep them current.

The changes in this PR, in particular, are for the final one in the chain of commits, but are independent, which is why I posted them separately.  To give context of what they are for, I have created a change reporter which creates a small website with links for each pass that changes the IR.  Each link shows the CFG in dot format (similar to -dot-cfg) except that instead of just showing the CFG with instructions, it shows the change that was made by the pass.  The instructions that were added are shown in green, those that are deleted are shown in red and those that are common are shown in black.  So, for example, if an optimization removes a basic block, the removed block, the arrow to it and the branch instruction to the removed block will be shown in red with the new arrow and branch instruction shown in green underneath the old branch (red) instruction.  This greatly simplifies identifying and understanding changes made by a pass.  In order to add the colour to the text showing the instructions, the DOT commands have to be in HTML-like format and the changes in this PR will put the output in HTML format under option control from DTraits.

These new options will be introduced in my tutorial "Understanding Changes made by a Pass in the Opt Pipeline." which will be given at the upcoming developers conference.  I will be covering existing options (print-before/after-all, etc) and then presenting the new change printers and filters which only report when the pass actually changes the IR, in their various forms.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86362/new/

https://reviews.llvm.org/D86362



More information about the llvm-commits mailing list