[llvm-dev] Repeated application of optimization passes

Mehdi Amini via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 6 07:50:07 PST 2015


> On Nov 6, 2015, at 5:32 AM, Russell Wallace via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> I don't suppose there's any way to find out whether the second iteration did anything? That is, suppose you have a module and you run some passes over it - if something changed, further iterations might be fruitful, but if nothing changed then further iterations definitely won't do anything so you can stop. In principle one could make a copy of the module beforehand and then compare, but being a large complex data structure, it probably doesn't provide equality comparison by value?

What you’re looking for is a dynamic pass pipeline, which the current pass manager can’t support. But I believe the new pass manager will be able to at least express this.

— 
Mehdi


> 
> On Fri, Nov 6, 2015 at 1:17 PM, serge guelton <sguelton at quarkslab.com <mailto:sguelton at quarkslab.com>> wrote:
> 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,
> 
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://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/20151106/563df117/attachment.html>


More information about the llvm-dev mailing list