[llvm-dev] LLVM Pass Managers

Son Tuan VU via llvm-dev llvm-dev at lists.llvm.org
Tue Apr 17 08:55:11 PDT 2018


Hello all,

I have 2 separate questions:

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.

2, I've asked this question once but have had no answer, so I'm gonna
revive it here: in *opt*, the *verify-each* mode is only activated when we
provide a pass name or a pipeline (list of pass names).  I guess this is
intended, but I expect that *verify-each* to insert *Verifier* to the whole
pipeline after each optimization pass, even when I pass -O1/2/3/s/z to *opt*.
And I assume others do expect the same thing.

The 2nd question lead me to another idea: if we really want to make
*verify-each* to work on any pipeline (not only user-provided ones), and
we'll soon have a *debugify-each* option, should we refactor the code to
have a *apply-after-each=pass-name* option that automatically inserts
*pass-name
*to the pipeline after each optimization pass?  We can even replace
*print-after-all* option with *apply-after-each=PrintModulePassWrapper *for
example?

Thank you all,

Son Tuan Vu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180417/9be9daca/attachment.html>


More information about the llvm-dev mailing list