diff options
author | macurtis-amd <macurtis@amd.com> | 2024-07-29 14:56:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-29 15:56:43 -0400 |
commit | 26e455bac0c44d75cb5d544c35e7c8326c91b4f3 (patch) | |
tree | f16efa643e032ccd8024d0193adc3eb6483bbe8e /llvm/lib/LTO/LTOBackend.cpp | |
parent | 2a612a1b343dcc0d3dd44df4866f6c6af5cc090f (diff) | |
download | llvm-26e455bac0c44d75cb5d544c35e7c8326c91b4f3.zip llvm-26e455bac0c44d75cb5d544c35e7c8326c91b4f3.tar.gz llvm-26e455bac0c44d75cb5d544c35e7c8326c91b4f3.tar.bz2 |
[lld][LTO] Teach LTO to print pipeline passes (#101018)
I found this useful while debugging code generation differences between
old and new offloading drivers.
No functional change (intended).
Diffstat (limited to 'llvm/lib/LTO/LTOBackend.cpp')
-rw-r--r-- | llvm/lib/LTO/LTOBackend.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp index d5d642f..effaed2 100644 --- a/llvm/lib/LTO/LTOBackend.cpp +++ b/llvm/lib/LTO/LTOBackend.cpp @@ -335,6 +335,16 @@ static void runNewPMPasses(const Config &Conf, Module &Mod, TargetMachine *TM, if (!Conf.DisableVerify) MPM.addPass(VerifierPass()); + if (PrintPipelinePasses) { + std::string PipelineStr; + raw_string_ostream OS(PipelineStr); + MPM.printPipeline(OS, [&PIC](StringRef ClassName) { + auto PassName = PIC.getPassNameForClassName(ClassName); + return PassName.empty() ? ClassName : PassName; + }); + outs() << "pipeline-passes: " << PipelineStr << '\n'; + } + MPM.run(Mod, MAM); } |