[llvm-dev] Inliner in legacy pass manager

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 9 12:57:38 PST 2020


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


More information about the llvm-dev mailing list