> On Fri, Oct 11, 2019 at 11:03 AM Jan Hubicka <hubi...@ucw.cz> wrote:
> >
> > Hi,
> > this patch prevents tree creation druing WPA stream out (to avoid
> > touching pages and triggering COW).  It fixes the following
> >  - gimple streamer produces MEM_REF wrappings for global decls.
> >    This is to preserve the type of access and is not necessary for
> >    WPA->LTRANS streaming when decls ar eno longer going to be merged.
> >  - we renumber stmt uids during streaming WPA summaries
> >  - loop optimizer is initialized in output_function.
> > After testing the patch I noticed that output_function does one extra
> > renumbering of stmts. This seems quite broken and I will fix it
> > incrementally.
> >
> > Bootstrapped/regtested x86_64-linux, comitted.
> 
> Huh.  Why do we stream function bodies at WPA time at all?
> We should already have input sections we can copy/remap?
> 
> That is, why does gcc_assert (!flag_wpa) in output_function trip?

Because we produce new bodies (such as merged ctors) and also bodies
read by ipa-ICF to memory are then streamed form in-memory copies rather
than the pickled sections.

The overall idea is to keep things flexble enough so IPA passes can
produce new functions and also load bodies to memory and modify them.
The second is useful for development where one can first get pass
working modifying at WPA time and then work on optimization summaries.
I also think we may end up with passes that does more involved
modifications on small portions of program (perhaps matric reorg could)
I am also using this to play with re-running early opts at WPA time and
seeing how many optimizations are missed by not early
inlining/propagating dead code via nothrow etc etc.

Honza

Reply via email to