[llvm-dev] Registering passes on a module

Matthieu Brucher via llvm-dev
Sat, 21 Jul 2018 19:12:55 -0000

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>