[llvm-dev] LLVM Pass Managers

Philip Pfaffe via llvm-dev llvm-dev at lists.llvm.org
Thu Apr 19 09:14:44 PDT 2018


Hi Son,

PassManagerBuilder is used to populate legacy PassManagers.  That role is
taken over by PassBuilder for new-PM passes.

Cheers,
Philip

2018-04-18 13:40 GMT+02:00 Son Tuan VU <sontuan.vu119 at gmail.com>:

> Hi Philip,
>
> Thank you for your reply. So what would be the right way/API to write
> out-of-tree pass? I've been using *PassManagerBuilder*, which requires a
> callback refering to *legacy::PassManagerBase*, so I guess this will be
> no longer the good way to go?
>
> Son Tuan Vu
>
> On Tue, Apr 17, 2018 at 6:06 PM, Philip Pfaffe <philip.pfaffe at gmail.com>
> wrote:
>
>> Hi Son,
>>
>> I have an answer to your first question:
>>
>> 1, What are the differences between *LegacyPassManager* and *PassManager*?
>>> I see that *opt* uses the former most of the times while the latter is
>>> used via *PassBuilder* API when an user wants to build her own
>>> pipeline, but I have no idea why so. What to use and when to use it is not
>>> clear to me.
>>>
>> PassManager is the result of a long going effort to replace the default
>> pass manager of opt and clang. Here's the original RFC containing the
>> motivation: http://lists.llvm.org/pipermail/llvm-dev/2012-July/051643.
>> html
>>
>> LegacyPassManager is currently still the default, but we are really close
>> to switching over the the new one. Both opt and clang have switches to
>> enable the new one, by calling `opt -passes="...."` or `clang
>> -fexperimental-new-pass-manager`. PassBuilder is essentially a big
>> factory to produce PassManager and AnalysisManager objects for the passes
>> and analyses included in core LLVM. If you develop analyses and passes, I'd
>> suggest doing so against the new PM, especially if you plan on upstreaming
>> your work.
>>
>> Cheers,
>> Philip
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180419/13c5aa5d/attachment.html>


More information about the llvm-dev mailing list