GCC memory consumption increased by recent patch!

Jan Hubicka jh@suse.cz
Tue Sep 14 20:40:00 GMT 2004


> Jan Hubicka wrote:
> 
> >>However, when is the inlining actually done?  If by the time I scan the 
> >>instructions, foo is already in bar, then there is no reason to have 
> >>data associated with the cloned copy of foo.  If the inlined copy of bar 
> >>   
> >>
> >
> >It is done at the very end of compilation when the function is being
> >compiled.  The idea is that the global passes of IPA optimizers should
> >work without actually touching function bodies, so we can do IPA where
> >the bodies are stored on disk and loaded on demand in the future.
> >
> >So what you see is matching the actual control flow of program.
> >
> > 
> >
> >>is what I am scanning and if I can figure out this is a clone, we can do 
> >>better.  Also, I figure out the set of functions to scan by just looking 
> >>   
> >>
> >
> >Clones are in the linked list starting on the cgraph_node (node->decl)
> >and linked via node->next_clone pointer (this is however going to change
> >soon once we support real cloning for intraprocedural constant
> >propagation Rayza is working on).
> >
> > 
> >
> >>at the list of cgraph nodes.  If I can see the function after inlining, 
> >>there is no reason to scan these either. 
> >>
> >>Also, do you ever fix up the cgraph?  I.e. if you inline foo into bar, 
> >>bar does not really call foo any more, it calls the functions that foo 
> >>called.
> >>   
> >>
> >
> >Yes, once the inlining is done, the clones are elliminated.  This is
> >usefull for memory management to, so I can release the function body
> >once all it's clones are dead.
> >
> >Honza
> > 
> >
> it sounds like I want to swap lines 2815 and 2817 of cgraphunit.c and 
> see if it works.
> 
> =======
>  cgraph_characterize_statics ();
> 
>  cgraph_expand_all_functions ();
> =======

This will not help you, since once functions are expanded and compiled,
there is nothing to optimize so the analysis will be faster but they
will do nothing.

One possibility might be to make aliasing (cgraph_characterize_statics?)
to happen before cgraph_decide_inlining so you have fewer nodes to work
on in the case the cloning is not going to make your analysis more
precise.

This can also make sense in the case we want to make use of the new
information for intraprocedural IPA and function cloning that is done
before inlining (but I know too little your and Razya's code to be sure
that this can help)

You still need to manage way how to clone the datastrcture associated
with nodes within cgraph_clone_node.  In the case you just have couple
of bitmaps that are read only after the analysis representing properties
of function, I guess you can just keep them shared.

Honza
> 
> >>kenny
> >>
> >>
> >>   
> >>
> 



More information about the Gcc-regression mailing list