This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 5/5] combine: preferably delete dead SETs in PARALLELs
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 18 Nov 2014 06:38:49 -0600
- Subject: Re: [PATCH 5/5] combine: preferably delete dead SETs in PARALLELs
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1415984897 dot git dot segher at kernel dot crashing dot org> <6d31ccdf868ceee465d89fbc6ae80c141244f42b dot 1415984897 dot git dot segher at kernel dot crashing dot org> <546A64F2 dot 1040700 at redhat dot com>
On Mon, Nov 17, 2014 at 02:13:22PM -0700, Jeff Law wrote:
> On 11/14/14 12:19, Segher Boessenkool wrote:
> >If the result of combining some insns is a PARALLEL of two SETs, and that
> >is not a recognised insn, and one of the SETs is dead, combine tries to
> >use the remaining SET as insn.
> >
> >This patch changes things around so that the one SET is preferably used,
> >not the PARALLEL.
> >
> >
> >2014-11-14 Segher Boessenkool <segher@kernel.crashing.org>
> >
> >gcc/
> > * combine.c (try_combine): Prefer to delete dead SETs inside
> > a PARALLEL over keeping them.
> OK. Can this go forward independent of the other changes? Seems like
> it should.
Yes, only 4 depends on 3, the rest are independent patches.
> Does it help pr52714 where we'd like to rip apart a PARALLEL with two
> sets, one of which is dead. If so, it might allow us to optimize that
> code better.
It does not seem to fix the testcase. I'll investigate why not.
You're talking about the
(parallel [(set (pc) (pc))
(set (X) (sp))])
right? I guess the "set pc pc" is not marked as unused...
> Granted, it originally was an m68k issue, but presumably
> it's happening eleswhere or you wouldn't be poking at it :-)
The case that made me do this is PowerPC, where (with more patches) for
long long subfM1(long long a) { return 0x1ffffffff - a; }
we generated (-m32)
subfic 4,4,-1 ; subfic 3,3,1
where that first subfic is
(parallel [(set (reg 4) (not (reg 4)))
(set (ca) (const_int 1))])
with that second set dead, so we can just do
not 4,4 ; subfic 3,3,1
which is cheaper.
Segher