This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, V3, #7 of 10], Implement PCREL_OPT relocation optimization
- From: Michael Meissner <meissner at linux dot ibm dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: Michael Meissner <meissner at linux dot ibm dot com>, gcc-patches at gcc dot gnu dot org, dje dot gcc at gmail dot com
- Date: Tue, 3 Sep 2019 19:20:13 -0400
- Subject: Re: [PATCH, V3, #7 of 10], Implement PCREL_OPT relocation optimization
- References: <20190826173320.GA7958@ibm-toto.the-meissners.org> <20190826214341.GG11790@ibm-toto.the-meissners.org> <20190903225603.GI9749@gate.crashing.org>
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. 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.
--
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meissner@linux.ibm.com, phone: +1 (978) 899-4797