This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][RFC] Less TODO_remove_unused_locals
Hunting for the "we're getting slower" bits I noticed that
TODO_remove_unused_locals is a big part of execute_function_todo
(and accounts for 1% of compile-time of ac.f90).
The following patch removes most of the remove_unused_locals
calls based on the fact that with anonymous SSA names now available
we should never create new locals (wishful thinking of course ...)
We still can kill references to existing ones.
and the important places to remove unused stuff are driven by
1) avoid creating yet another copy of the unused stuff, thus do
it before inlining, on the callee; 2) avoid pinning unused memory
while we operate on other function bodies, thus, do it at the end
of non-IPA pass pipelines
In the end this asks for more explicit placement and thus a
real pass ... but the following should be enough as a RFC and
be good enough for 4.8.
Yes, it looks good to me. I introduced this remove_unused_locals stuff
and I was aware it is executed quite too often. I meant to get some
data on this
but never got around that and moreover the number of execution has increased
over the years as we increased number of passes...
My recollection is that at that time the pass also did dropping of
some flags (ADDRESSABLE?) promoting into Gimple registers. This was
motivation to keep it working often since it was code quality thing
too. I suppose this is now done elsewhere.