[all-commits] [llvm/llvm-project] 71124a: Reland No.3: Add new hidden option -print-changed ...

jamieschmeiser via All-commits all-commits at lists.llvm.org
Thu Oct 1 10:39:43 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 71124a9dbdcc76cd5efec8c148001a3f808bd769
      https://github.com/llvm/llvm-project/commit/71124a9dbdcc76cd5efec8c148001a3f808bd769
  Author: Jamie Schmeiser <schmeise at ca.ibm.com>
  Date:   2020-10-01 (Thu, 01 Oct 2020)

  Changed paths:
    M llvm/include/llvm/Passes/StandardInstrumentations.h
    M llvm/lib/IR/LegacyPassManager.cpp
    M llvm/lib/Passes/StandardInstrumentations.cpp
    A llvm/test/Other/change-printer.ll

  Log Message:
  -----------
  Reland No.3: Add new hidden option -print-changed which only reports changes to IR

A new hidden option -print-changed is added along with code to support
printing the IR as it passes through the opt pipeline in the new pass
manager. Only those passes that change the IR are reported, with others
only having the banner reported, indicating that they did not change the
IR, were filtered out or ignored. Filtering of output via the
-filter-print-funcs is supported and a new supporting hidden option
-filter-passes is added. The latter takes a comma separated list of pass
names and filters the output to only show those passes in the list that
change the IR. The output can also be modified via the -print-module-scope
function.

The code introduces an abstract template base class that generalizes the
comparison of IRs that takes an IR representation as template parameter.
Derived classes provide overrides that provide an event based API
for generalized reporting of IRs as they are changed in the opt pipeline
through the new pass manager.

The first of several instantiations is provided that prints the IR
in a form similar to that produced by -print-after-all with the above
mentioned filtering capabilities. This version, and the others to
follow will be introduced at the upcoming developer's conference.

Reviewed By: aeubanks (Arthur Eubanks), yrouban (Yevgeny Rouban), ychen (Yuanfang Chen), MaskRay (Fangrui Song)

Differential Revision: https://reviews.llvm.org/D86360




More information about the All-commits mailing list