[llvm-dev] LLVM Pass Managers

Philip Pfaffe via llvm-dev llvm-dev at lists.llvm.org
Tue Apr 17 09:06:55 PDT 2018


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/20180417/7e251243/attachment.html>


More information about the llvm-dev mailing list