This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 3/3] Implement -flto-slim
> Well. Instead of putting checks everywhere for flag_lto_slim
> we should re-organize how/when the frontends dispatch to the
> middle-end (thus, look at the langhooks and see what common
> code that write_global_declarations does we can factor out).
>
> For example cgraph_optimize () should be called by common code
> and generally be the last thing the frontend does in w_g_d.
The problem is you still have to bail out and sometimes
the frontends do stuff afterwards which should not be skipped
(e.g. generating some warnings or updating repo and plugins)
Maybe some of that code could be moved earlier, but at least
I don't understand it all well enough to say if that is safe to
do or not.
So yes that could be done, but you would still need to have
a lot of check in the callers. I suspect it wouldn't reduce
the checking significantly.
-Andi