On Mon, Nov 29, 2010 at 1:17 AM, Duncan Sands <baldrick at free.fr> wrote:> Hi David, > > > Interesting -- LLVM does perform on the fly cleanups during inlining > > transformation -- this will make summary update precise. One thing I > notice from > > the debug pass dump is that the 'deduce function attribute' pass happens > before > > the clean up -- Is it intended? > > you are correct. This is due to a limitation of the pass manager: it would > clearly be better to run the function attributes pass after the > per-function > passes that follow the inliner, but currently if you try what happens is > that > first the inliner and on the fly cleanups get run on every function, and > only > when they have finished the function attributes pass gets run on every > function. That means that function attributes of callees will not have > been > calculated when the inliner (and the subsequent function passes) process a > function, which is bad. I think the pass manager should be fixed to not do > this, at which point the function attributes pass could be moved later. >So bottom up traversal of the (scc node of) callgraph is not sufficient to guarantee all callees are processed before the caller? Thanks, David> > Ciao, > > Duncan. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101129/9f452e5a/attachment.html>
Hi David,> > Interesting -- LLVM does perform on the fly cleanups during inlining > > transformation -- this will make summary update precise. One thing I > notice from > > the debug pass dump is that the 'deduce function attribute' pass happens > before > > the clean up -- Is it intended? > > you are correct. This is due to a limitation of the pass manager: it would > clearly be better to run the function attributes pass after the per-function > passes that follow the inliner, but currently if you try what happens is that > first the inliner and on the fly cleanups get run on every function, and only > when they have finished the function attributes pass gets run on every > function. That means that function attributes of callees will not have been > calculated when the inliner (and the subsequent function passes) process a > function, which is bad. I think the pass manager should be fixed to not do > this, at which point the function attributes pass could be moved later. > > > So bottom up traversal of the (scc node of) callgraph is not sufficient to > guarantee all callees are processed before the caller?that's not the problem, the problem is that the pass manager schedules two bottom up traversals, one for the inliner + cleanup passes and another for the function attributes pass, if you place place the function attributes pass later in the pass list. I don't know why, but it seems to be a pass manager bug (perhaps it is a feature...). Ciao, Duncan.
On Nov 29, 2010, at 8:40 AM, Duncan Sands wrote:>> >> >> So bottom up traversal of the (scc node of) callgraph is not sufficient to >> guarantee all callees are processed before the caller? > > that's not the problem, the problem is that the pass manager schedules two > bottom up traversals, one for the inliner + cleanup passes and another for > the function attributes pass, if you place place the function attributes > pass later in the pass list. I don't know why, but it seems to be a pass > manager bug (perhaps it is a feature...).I'm not sure what the issue is, but that is clearly a bug. -Chris