On Tue, Sep 03, 2019 at 07:20:13PM -0400, Michael Meissner wrote:
> On Tue, Sep 03, 2019 at 05:56:03PM -0500, Segher Boessenkool wrote:
> > Hi!
> > 
> > On Mon, Aug 26, 2019 at 05:43:41PM -0400, Michael Meissner wrote:
> > > /* This file implements a RTL pass that looks for pc-relative loads of the
> > >    address of an external variable using the PCREL_GOT relocation and a 
> > > single
> > >    load/store that uses that GOT pointer.
> > 
> > Does this work better than having a peephole for it?  Is there some reason
> > you cannot do this with a peephole?
> 
> Yes.  Peepholes only look at adjacent insns.

Huh.  Wow.  Would you believe I never knew that (or I forgot)?  Well, that
explains why peepholes aren't very effective for us at all, alright!

> This optimization allows the load
> of the GOT address to be separated from the eventual load or store.
> 
> Peephole2's are likely too early, because you really, really, really don't 
> want
> any other pass moving things around.

That is a bit worrying...  What can go wrong?


Segher

Reply via email to