Matthieu Brucher via llvm-dev
2018-Jul-21 19:12 UTC
[llvm-dev] Registering passes on a module
Hi all, I'm trying to build passes with the PassBuilder to optimize the result of MCJIT (I assume, this is a requirement for performance). So I do this: llvm::PassBuilder passBuilder; llvm::ModulePassManager modulePassManager passBuilder.buildPerModuleDefaultPipeline(llvm::PassBuilder::OptimizationLevel::O3); llvm::ModuleAnalysisManager moduleAnalysisManager; passBuilder.registerModuleAnalyses(moduleAnalysisManager); modulePassManager.run(*module, moduleAnalysisManager); with module being a pointer to an LLVM module. Unfortunately, the moduleAnalysisManager has only the module passes, but not the function ones that are wrapped with the proxy class. Is there anything I missed or a up-to-date tutorial on this? I couldn't find an answer on Stackoverflow (where a similar question was asked). Cheers, Matthieu -- Quantitative analyst, Ph.D. Blog: http://blog.audio-tk.com/ LinkedIn: http://www.linkedin.com/in/matthieubrucher -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180721/7bc5c3c5/attachment.html>
Philip Pfaffe via llvm-dev
2018-Jul-23 08:34 UTC
[llvm-dev] Registering passes on a module
Hi Matthieu, You need to set up the different types of AnalysisManagers as well, just as you did with ModuleAM. Then, you need to cross register them with each other by calling `passBuilder.crossRegisterProxies`. Cheers, Philip On Sat, Jul 21, 2018 at 9:13 PM Matthieu Brucher via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi all, > > I'm trying to build passes with the PassBuilder to optimize the result of > MCJIT (I assume, this is a requirement for performance). > > So I do this: > llvm::PassBuilder passBuilder; > llvm::ModulePassManager modulePassManager > passBuilder.buildPerModuleDefaultPipeline(llvm::PassBuilder::OptimizationLevel::O3); > llvm::ModuleAnalysisManager moduleAnalysisManager; > passBuilder.registerModuleAnalyses(moduleAnalysisManager); > modulePassManager.run(*module, moduleAnalysisManager); > > with module being a pointer to an LLVM module. > Unfortunately, the moduleAnalysisManager has only the module passes, but > not the function ones that are wrapped with the proxy class. Is there > anything I missed or a up-to-date tutorial on this? > I couldn't find an answer on Stackoverflow (where a similar question was > asked). > > Cheers, > > Matthieu > -- > Quantitative analyst, Ph.D. > Blog: http://blog.audio-tk.com/ > LinkedIn: http://www.linkedin.com/in/matthieubrucher > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180723/4bffb6c7/attachment.html>
Matthieu Brucher via llvm-dev
2018-Jul-24 07:02 UTC
[llvm-dev] Registering passes on a module
Thanks a lot! It seems that there is only one piece of code describing this online, and it's part of clang! Cheers, Matthieu Le lun. 23 juil. 2018 à 09:34, Philip Pfaffe <philip.pfaffe at gmail.com> a écrit :> Hi Matthieu, > > You need to set up the different types of AnalysisManagers as well, just > as you did with ModuleAM. Then, you need to cross register them with each > other by calling `passBuilder.crossRegisterProxies`. > > Cheers, > Philip > > On Sat, Jul 21, 2018 at 9:13 PM Matthieu Brucher via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Hi all, >> >> I'm trying to build passes with the PassBuilder to optimize the result of >> MCJIT (I assume, this is a requirement for performance). >> >> So I do this: >> llvm::PassBuilder passBuilder; >> llvm::ModulePassManager modulePassManager >> passBuilder.buildPerModuleDefaultPipeline(llvm::PassBuilder::OptimizationLevel::O3); >> llvm::ModuleAnalysisManager moduleAnalysisManager; >> passBuilder.registerModuleAnalyses(moduleAnalysisManager); >> modulePassManager.run(*module, moduleAnalysisManager); >> >> with module being a pointer to an LLVM module. >> Unfortunately, the moduleAnalysisManager has only the module passes, but >> not the function ones that are wrapped with the proxy class. Is there >> anything I missed or a up-to-date tutorial on this? >> I couldn't find an answer on Stackoverflow (where a similar question was >> asked). >> >> Cheers, >> >> Matthieu >> -- >> Quantitative analyst, Ph.D. >> Blog: http://blog.audio-tk.com/ >> LinkedIn: http://www.linkedin.com/in/matthieubrucher >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> >-- Quantitative analyst, Ph.D. Blog: http://blog.audio-tk.com/ LinkedIn: http://www.linkedin.com/in/matthieubrucher -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180724/9078f274/attachment.html>
Seemingly Similar Threads
- Function optimization pass
- Run llvm pass from standalone project
- RFC: Getting ProfileSummaryInfo and BlockFrequencyInfo from various types of passes under the new pass manager
- RFC: Pass Execution Instrumentation interface
- RFC: Getting ProfileSummaryInfo and BlockFrequencyInfo from various types of passes under the new pass manager