[LLVMdev] LLVM Inliner
Duncan Sands
baldrick at free.fr
Mon Nov 29 08:40:05 PST 2010
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.
More information about the llvm-dev
mailing list