[llvm-dev] Inliner in legacy pass manager

sushant gokhale via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 9 23:27:57 PST 2020


Hi,

So, does this mean that in legacy pass manager, when I run:
PM.add( someFunctionPass() )     // PM is modulePassManager
it creates FunctionPassManager, runs the function pass,destroys the
functionPassManager and returns control to modulePassManager?

Also, you have said that this wasn't the primary reason for the
introduction of the new pass manager. But then is this one of the reasons?

Regards
Sushant

On Tue, Nov 10, 2020 at 2:28 AM Michael Kruse <llvmdev at meinersbur.de> wrote:

> In the old pass manager a coarser-grain pass cannot depend on a
> fine-grain pass (or analysis). In this case, the coarser-grain is the
> Inliner (CallGraphSCCPass) and the finer a FunctionPass. The reason is
> that the finer-grain pass has its own "pass manager", i.e. it runs all
> the passes and analysis (in that pass manager) on one function, frees
> them, and continues with the next function until all functions in the
> module have been process and only then gives control back to the
> coarser-grain pass manger. That is, at this point, all the
> FunctionPass analyses has been and is not available anymore.
>
> There is a workaround for ModulePasses using FunctionPasses: The
> ModulePassManager would run the FunctionPass on the requested function
> (without the FunctionPassManager). But it will only hold the result
> for one Function; if you request the analysis for a different
> function, it will free the previous one.
>
> This is not the primary reason for the introduction of the new pass
> manager: The legacy pass manager could have been modified to not free
> all analyses, but like the NPM keep a global map of all analyses run
> so far that have not been invalidated yet.
>
> Michael
>
>
>
> Am Mo., 9. Nov. 2020 um 05:28 Uhr schrieb sushant gokhale via llvm-dev
> <llvm-dev at lists.llvm.org>:
> >
> > Hi,
> >
> > In following link:
> > https://www.youtube.com/watch?reload=9&v=6X12D46sRFw
> >
> > They have specified that the inliner can't use
> DomTree/LoopInfo/MemorySSA analysis.
> > 1. What's the reason for this?
> > 2. Why can't we do it using getAnalysisUsage() construct?
> > 3. Can inline use this information in the new Pass Manager?
> > 4. What all information can we derive from DomTree to be of help to
> inliner?
> >
> > Regards
> > Sushant
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201110/2dbf6b70/attachment.html>


More information about the llvm-dev mailing list