[all-commits] [llvm/llvm-project] 816761: Add new choices dot-cfg and dot-cfg-quiet to print...

jamieschmeiser via All-commits all-commits at lists.llvm.org
Tue Nov 2 09:06:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 816761f04484bc7096755e8351a1ff46a3594398
      https://github.com/llvm/llvm-project/commit/816761f04484bc7096755e8351a1ff46a3594398
  Author: Jamie Schmeiser <schmeise at ca.ibm.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M llvm/include/llvm/Passes/StandardInstrumentations.h
    M llvm/include/llvm/Support/DOTGraphTraits.h
    M llvm/include/llvm/Support/GraphWriter.h
    M llvm/lib/Passes/StandardInstrumentations.cpp
    A llvm/test/Other/ChangePrinters/DotCfg/lit.local.cfg
    A llvm/test/Other/ChangePrinters/DotCfg/print-changed-dot-cfg.ll

  Log Message:
  -----------
  Add new choices dot-cfg and dot-cfg-quiet to print-changed.

Summary:
Add new options -print-changed=[dot-cfg | dot-cfg-quiet] which create
a website of DOT files showing colourized changes as the IR is changed
by passes in the new pass manager pipeline.

A new change reporter is introduced that creates a website of changes made
by passes in the opt pipeline that change the IR. The hidden option
-dot-cfg-dir=<dir> specifies a directory (defaulting to "./") into which the
website will be created.

A file passes.html is created that contains a list of all the passes that
act on the IR. Those that do not change the IR are listed as omitted
because of no change, ignored or filtered out (using -filter-print-func
and -filter-passes) or not listed in quiet mode. Those that
do change the IR are listed as a link to a DOT file which contains a
CFG depiction of the IR (ala -dot-cfg) except that the instructions,
basic blocks and links that are only in the IR before the pass (ie, removed)
and those that are only in the IR after the pass (ie, added) are shown in
red and green, respectively, while the aspects of the CFG that do not change
are shown in black. Additional hidden options
-dot-cfg-before-color=<dot named color>,
-dot-cfg-after-color=<dot named color> and
-dot-cfg-common-color=<dot named color> are defined that allow the
customization of the colors used in colorizing the CFG.
-change-printer-dot-path=<path to dot exe> is also added.

Author: Jamie Schmeiser <schmeise at ca.ibm.com>
Reviewed By: aeubanks (Arthur Eubanks)
Differential Revision: https://reviews.llvm.org/D87202




More information about the All-commits mailing list