diff options
author | Taewook Oh <twoh@fb.com> | 2019-08-15 17:47:44 +0000 |
---|---|---|
committer | Taewook Oh <twoh@fb.com> | 2019-08-15 17:47:44 +0000 |
commit | 213d8a9f1389eb565146e6323317ef436cb0da78 (patch) | |
tree | 099ba3e722e90730a8646d6385dba311f0ea71ee /llvm/lib/LTO/LTOBackend.cpp | |
parent | 7a210d65edc6d7fa4f8e828a9fc967e73f26b24d (diff) | |
download | llvm-213d8a9f1389eb565146e6323317ef436cb0da78.zip llvm-213d8a9f1389eb565146e6323317ef436cb0da78.tar.gz llvm-213d8a9f1389eb565146e6323317ef436cb0da78.tar.bz2 |
[NewPM][PassInstrumentation] IR printing support for (Thin)LTO
Summary: IR printing has not been correctly supported with (Thin)LTO if the new pass manager is enabled. Previously we only get outputs from backend(codegen) passes, as they are still under legacy pass manager even when the new pass manager is enabled. This patch addresses the issue and enables IR printing for optimization passes with new pass manager + (Thin)LTO setting.
Reviewers: fedor.sergeev, philip.pfaffe
Subscribers: mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, dang, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66253
llvm-svn: 369024
Diffstat (limited to 'llvm/lib/LTO/LTOBackend.cpp')
-rw-r--r-- | llvm/lib/LTO/LTOBackend.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp index 1f4ecf0..2761f83 100644 --- a/llvm/lib/LTO/LTOBackend.cpp +++ b/llvm/lib/LTO/LTOBackend.cpp @@ -28,6 +28,7 @@ #include "llvm/MC/SubtargetFeature.h" #include "llvm/Object/ModuleSymbolTable.h" #include "llvm/Passes/PassBuilder.h" +#include "llvm/Passes/StandardInstrumentations.h" #include "llvm/Support/Error.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" @@ -165,7 +166,10 @@ static void runNewPMPasses(Config &Conf, Module &Mod, TargetMachine *TM, PGOOptions::IRUse, PGOOptions::CSIRUse); } - PassBuilder PB(TM, PipelineTuningOptions(), PGOOpt); + PassInstrumentationCallbacks PIC; + StandardInstrumentations SI; + SI.registerCallbacks(PIC); + PassBuilder PB(TM, PipelineTuningOptions(),PGOOpt, &PIC); AAManager AA; // Parse a custom AA pipeline if asked to. |