[all-commits] [llvm/llvm-project] c8f0a7: [NewPM] Cleanup IR printing instrumentation
aeubanks via All-commits
all-commits at lists.llvm.org
Thu Apr 15 09:51:17 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c8f0a7c215ab4c08ed2f5ac53f080adbb54714ab
https://github.com/llvm/llvm-project/commit/c8f0a7c215ab4c08ed2f5ac53f080adbb54714ab
Author: Arthur Eubanks <aeubanks at google.com>
Date: 2021-04-15 (Thu, 15 Apr 2021)
Changed paths:
M clang/test/CodeGen/sanitizer-module-constructor.c
M clang/test/Misc/printer.c
M llvm/include/llvm/Analysis/LoopInfo.h
M llvm/include/llvm/Analysis/LoopInfoImpl.h
M llvm/lib/Analysis/LoopInfo.cpp
M llvm/lib/Passes/StandardInstrumentations.cpp
M llvm/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp
M llvm/test/Other/ChangePrinters/print-changed-diff.ll
M llvm/test/Other/change-printer.ll
M llvm/test/Other/loop-deletion-printer.ll
M llvm/test/Other/loop-pass-printer.ll
M llvm/test/Other/module-pass-printer.ll
M llvm/test/Other/opt-bisect-new-pass-manager.ll
M llvm/test/Other/print-module-scope.ll
M llvm/test/Other/scc-deleted-printer.ll
M llvm/test/Other/scc-pass-printer.ll
M llvm/test/ThinLTO/X86/printer.ll
Log Message:
-----------
[NewPM] Cleanup IR printing instrumentation
Being lazy with printing the banner seems hard to reason with, we should print it
unconditionally first (it could also lead to duplicate banners if we
have multiple functions in -filter-print-funcs).
The printIR() functions were doing too many things. I separated out the
call from PrintPassInstrumentation since we were essentially doing two
completely separate things in printIR() from different callers.
There were multiple ways to generate the name of some IR. That's all
been moved to getIRName(). The printing of the IR name was also
inconsistent, now it's always "IR Dump on $foo" where "$foo" is the
name. For a function, it's the function name. For a loop, it's what's
printed by Loop::print(), which is more detailed. For an SCC, it's the
list of functions in parentheses. For a module it's "[module]", to
differentiate between a possible SCC with a function called "module".
To preserve D74814, we have to check if we're going to print anything at
all first. This is unfortunate, but I would consider this a special
case that shouldn't be handled in the core logic.
Reviewed By: jamieschmeiser
Differential Revision: https://reviews.llvm.org/D100231
More information about the All-commits
mailing list