This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/5] combine: handle I2 a parallel of two SETs
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Bernd Schmidt <bernds at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 26 Nov 2014 10:06:57 -0600
- Subject: Re: [PATCH 2/5] combine: handle I2 a parallel of two SETs
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1415984897 dot git dot segher at kernel dot crashing dot org> <f1316eb793d3a8a4f0e9302a7f33adaece291a43 dot 1415984897 dot git dot segher at kernel dot crashing dot org> <54665994 dot 500 at codesourcery dot com> <20141115125923 dot GA25332 at gate dot crashing dot org>
On Sat, Nov 15, 2014 at 06:59:23AM -0600, Segher Boessenkool wrote:
> On Fri, Nov 14, 2014 at 08:35:48PM +0100, Bernd Schmidt wrote:
> > On 11/14/2014 08:19 PM, Segher Boessenkool wrote:
> > >+ /* If I2 is a PARALLEL of two SETs of REGs (and perhaps some CLOBBERs),
> > >+ make those two SETs separate I1 and I2 insns, and make an I0 that is
> > >+ the original I1. */
> > >+ if (i0 == 0
> > >+ && GET_CODE (PATTERN (i2)) == PARALLEL
> > >+ && XVECLEN (PATTERN (i2), 0) >= 2
> > >+ && GET_CODE (XVECEXP (PATTERN (i2), 0, 0)) == SET
> > >+ && GET_CODE (XVECEXP (PATTERN (i2), 0, 1)) == SET
> > >+ && REG_P (SET_DEST (XVECEXP (PATTERN (i2), 0, 0)))
> > >+ && REG_P (SET_DEST (XVECEXP (PATTERN (i2), 0, 1)))
> > >+ && !reg_used_between_p (SET_DEST (XVECEXP (PATTERN (i2), 0, 0)),
> > >i2, i3)
> > >+ && !reg_used_between_p (SET_DEST (XVECEXP (PATTERN (i2), 0, 1)),
> > >i2, i3)
> >
> > Don't we have other code in combine checking the reg_used_between case?
Actually, no, no we don't.
Under the old regime (before adding the regno field to log_links), a
link links a first insn with its earliest successor that uses any of
the regs that first insn sets. This guarantees that in try_combine
none of the insns between I2 and I3 will use any of the registers set
by I2.
Under the new regime (patches 3 and 4) a link links a first insn with
its earliest successor that uses a particular reg the first insn sets.
For single sets, this is the same as before; but not so for multiple
sets.
There are only two cases where this matters: this patch, and the code
right before it (that never seems to trigger, not on any target; trying
to figure out if that is true, and if so, why).
New patchset is bootstrapping/testing.
Cheers,
Segher