[llvm-dev] Registering passes on a module

Philip Pfaffe via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 23 01:34:40 PDT 2018


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>


More information about the llvm-dev mailing list