[PATCH]: Make PRE handle globals

Daniel Berlin dberlin@dberlin.org
Sun Jul 8 00:49:00 GMT 2007


On 7/7/07, Jan Hubicka <hubicka@ucw.cz> wrote:
> > One of the longstanding deficiencies of GVNPRE (and FRE) was it's
> > inability to optimize away duplicate loads from globals, as well as
> > hoist them.
> >
> > The attached fixes this.  SCCVN knows how to value number globals
> > properly, which takes care of FRE.
> >
> > PRE needed a little more work.  In order to be able to store different
> > values on a global at different times, we "unshare" the global locally
> > when creating it's value expression (this does not affect the original
> > IR), and have a pointer map for value handles for decl's.
>
> Hi,
> this patch apparently cause 6% memory usage growth combine.c compilation
> -O3... Those might be just more pseudos to regalloc by more PRE.
>

It's probably because we had to copy DECL's at every point they have
different vuses :)

I've reverted the majority (PRE parts) of the patch, let me know if
the memory use doesn't go back down ;)

Basically what is left will still propagate constants/etc through
globals, but won't move globals around.



More information about the Gcc-patches mailing list