This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 5/5] combine: preferably delete dead SETs in PARALLELs


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]