[llvm-dev] Repeated application of optimization passes

serge guelton via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 6 05:17:42 PST 2015


On Fri, Nov 06, 2015 at 11:58:22AM +0000, Russell Wallace via llvm-dev wrote:
> Within the LLVM pass manager infrastructure, suppose we have two
> transformation passes, pass A makes some improvements, then pass B does
> likewise, but this creates opportunities for pass A to create further
> improvements (e.g. suppose B was function inlining) so it's desirable to
> run A again.
> 
> How does the LLVM pass manager currently deal with this?

Some passes are already applied repeatedly by the passmanager, just add
them twice when relevant.

for instance in lib/Transforms/IPO/PassManagerBuilder.cpp,
PassManagerBuilder::populateModulePassManager

MPM.add(createGVNPass(...)) is called twice (conditionnaly)

Hope it helps,




More information about the llvm-dev mailing list