This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Inlining fails on very simple code


On 11 Dec, Alexandre Oliva wrote:

> The fact that a function is used only once could only be used to
> decide whether to inline it if we did a global analysis of the
> program.  We don't have infrastructure in place for this kind of
> analysis, since we often emit code for functions before having seen
> the whole program.

I understand. This also explains why I had troubles to find the spot
where gcc tries to analyse how often a function is used. Would it be
possible to use the bitfield variable behind the TREE_USED macro to
count the number of callers or would that already be to late for
the treeinliner to work with that data? Also I think it might be
benefitial to generally inline the tree if the inline keyword is
given or the inlining criteria are met but also keep the copy of
the function alone around, do the optimisation passes on the code with
the inlined function and both the callee and caller alone and then
compare them and decide whether the glued code shows an improvement
over both functions alone. It seems to me that mr. Hubicka and mr.
Zlomek are trying that for loops and general statement; duplicating
code and checking for improvements that is.

--
Servus,
       Daniel 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]