[llvm-dev] Registering passes on a module

Matthieu Brucher via llvm-dev
Tue, 24 Jul 2018 07:02:35 -0000

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>