On Tue, Jan 19, 2016 at 01:42:00PM +0100, Jan Hubicka wrote:
> > One solution I do envision, which might help, would be to try to figure
> > out which types are unused, and discard those.  Say, scan all variables
> > within a lexical scope (including nested blocks), deciding which ones
> > can be discarded, and then, as we move out of the nesting, we can
> > decide, from last to first, which types are unused, and mark as used
> > types refereced from retained variables and other types that are used,
> > removing those that, when reached during this backward scan, remain
> > marked as unused.  Or something along these lines, taking nested
> > functions into account, if needed, and anything else I may have missed
> > ;-)
> 
> dropping the type_decls definitly buys us a memory with LTO and firefox.  How
> hard would be to implement the prunning of dead TYPE_DECLs as you suggest?

The problem might be if some types are only referenced from unused variables
for which we emit just debug stmts but no other references to them.
Or would we not prune in that case (i.e. only prune types if no variables
before unused locals prunning refer to those types)?

        Jakub

Reply via email to