[rtl] Harden 'set_noop_p' for non-constant selectors [PR94279] (was: [Patch, RTL] Eliminate redundant vec_select moves)

2020-04-22 Thread Thomas Schwinge
Hi! First: please be gentle: I don't speak RTL. ;-) And second: it's been some time. On 2013-12-04T16:06:48+, Tejas Belagod wrote: > gcc/ > * rtlanal.c (set_noop_p): Return nonzero in case of redundant vec_select > for overlapping register lanes. This got committed to trunk in

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-14 Thread H.J. Lu
On Wed, Dec 11, 2013 at 7:49 AM, Richard Sandiford wrote: > "H.J. Lu" writes: >> On Wed, Dec 11, 2013 at 1:13 AM, Richard Sandiford >> wrote: >>> Richard Henderson writes: On 12/10/2013 10:44 AM, Richard Sandiford wrote: > Sorry, I don't understand. I never said it was invalid. I sai

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-11 Thread Tejas Belagod
H.J. Lu wrote: On Wed, Dec 11, 2013 at 8:26 AM, Tejas Belagod wrote: H.J. Lu wrote: On Wed, Dec 11, 2013 at 7:49 AM, Richard Sandiford wrote: "H.J. Lu" writes: On Wed, Dec 11, 2013 at 1:13 AM, Richard Sandiford wrote: Richard Henderson writes: On 12/10/2013 10:44 AM, Richard Sandiford

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-11 Thread H.J. Lu
On Wed, Dec 11, 2013 at 8:26 AM, Tejas Belagod wrote: > H.J. Lu wrote: >> >> On Wed, Dec 11, 2013 at 7:49 AM, Richard Sandiford >> wrote: >>> >>> "H.J. Lu" writes: On Wed, Dec 11, 2013 at 1:13 AM, Richard Sandiford wrote: > > Richard Henderson writes: >> >> On 12

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-11 Thread Tejas Belagod
H.J. Lu wrote: On Wed, Dec 11, 2013 at 7:49 AM, Richard Sandiford wrote: "H.J. Lu" writes: On Wed, Dec 11, 2013 at 1:13 AM, Richard Sandiford wrote: Richard Henderson writes: On 12/10/2013 10:44 AM, Richard Sandiford wrote: Sorry, I don't understand. I never said it was invalid. I said

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-11 Thread H.J. Lu
On Wed, Dec 11, 2013 at 7:49 AM, Richard Sandiford wrote: > "H.J. Lu" writes: >> On Wed, Dec 11, 2013 at 1:13 AM, Richard Sandiford >> wrote: >>> Richard Henderson writes: On 12/10/2013 10:44 AM, Richard Sandiford wrote: > Sorry, I don't understand. I never said it was invalid. I sai

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-11 Thread Richard Sandiford
"H.J. Lu" writes: > On Wed, Dec 11, 2013 at 1:13 AM, Richard Sandiford > wrote: >> Richard Henderson writes: >>> On 12/10/2013 10:44 AM, Richard Sandiford wrote: Sorry, I don't understand. I never said it was invalid. I said (subreg:SF (reg:V4SF X) 1) was invalid if (reg:V4SF X) repr

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-11 Thread H.J. Lu
On Wed, Dec 11, 2013 at 1:13 AM, Richard Sandiford wrote: > Richard Henderson writes: >> On 12/10/2013 10:44 AM, Richard Sandiford wrote: >>> Sorry, I don't understand. I never said it was invalid. I said >>> (subreg:SF (reg:V4SF X) 1) was invalid if (reg:V4SF X) represents >>> a single registe

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-11 Thread Richard Sandiford
Richard Henderson writes: > On 12/10/2013 10:44 AM, Richard Sandiford wrote: >> Sorry, I don't understand. I never said it was invalid. I said >> (subreg:SF (reg:V4SF X) 1) was invalid if (reg:V4SF X) represents >> a single register. On a little-endian target, the offset cannot be >> anything o

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread H.J. Lu
On Tue, Dec 10, 2013 at 2:33 PM, H.J. Lu wrote: > On Tue, Dec 10, 2013 at 2:25 PM, Tejas Belagod > wrote: >> On 10 December 2013 21:51, H.J. Lu wrote: >>> On Tue, Dec 10, 2013 at 1:09 PM, H.J. Lu wrote: On Tue, Dec 10, 2013 at 12:39 PM, Richard Henderson wrote: > On 12/10/2013

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread H.J. Lu
On Tue, Dec 10, 2013 at 2:25 PM, Tejas Belagod wrote: > On 10 December 2013 21:51, H.J. Lu wrote: >> On Tue, Dec 10, 2013 at 1:09 PM, H.J. Lu wrote: >>> On Tue, Dec 10, 2013 at 12:39 PM, Richard Henderson wrote: On 12/10/2013 10:44 AM, Richard Sandiford wrote: > Sorry, I don't understa

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread Tejas Belagod
On 10 December 2013 21:51, H.J. Lu wrote: > On Tue, Dec 10, 2013 at 1:09 PM, H.J. Lu wrote: >> On Tue, Dec 10, 2013 at 12:39 PM, Richard Henderson wrote: >>> On 12/10/2013 10:44 AM, Richard Sandiford wrote: Sorry, I don't understand. I never said it was invalid. I said (subreg:SF (re

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread H.J. Lu
On Tue, Dec 10, 2013 at 1:09 PM, H.J. Lu wrote: > On Tue, Dec 10, 2013 at 12:39 PM, Richard Henderson wrote: >> On 12/10/2013 10:44 AM, Richard Sandiford wrote: >>> Sorry, I don't understand. I never said it was invalid. I said >>> (subreg:SF (reg:V4SF X) 1) was invalid if (reg:V4SF X) represen

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread H.J. Lu
On Tue, Dec 10, 2013 at 12:39 PM, Richard Henderson wrote: > On 12/10/2013 10:44 AM, Richard Sandiford wrote: >> Sorry, I don't understand. I never said it was invalid. I said >> (subreg:SF (reg:V4SF X) 1) was invalid if (reg:V4SF X) represents >> a single register. On a little-endian target, t

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread Richard Henderson
On 12/10/2013 10:44 AM, Richard Sandiford wrote: > Sorry, I don't understand. I never said it was invalid. I said > (subreg:SF (reg:V4SF X) 1) was invalid if (reg:V4SF X) represents > a single register. On a little-endian target, the offset cannot be > anything other than 0 in that case. > > So

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread Paul_Koning
On Dec 10, 2013, at 2:12 PM, H.J. Lu wrote: > On Tue, Dec 10, 2013 at 11:05 AM, Tejas Belagod wrote: >> ... >> So, if (subreg:DI (match_operand:V4SF 1 "register_operand" "x,x") 0) is a >> valid subreg, why not allow it in CANNOT_CHANGE_MODE_CLASS (like in Kirill's >> patch http://gcc.gnu.org/ml

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread H.J. Lu
On Tue, Dec 10, 2013 at 11:05 AM, Tejas Belagod wrote: > H.J. Lu wrote: >> >> On Tue, Dec 10, 2013 at 9:26 AM, Tejas Belagod wrote: >>> >>> H.J. Lu wrote: On Tue, Dec 10, 2013 at 9:04 AM, Kirill Yukhin wrote: > > On 10 Dec 08:23, H.J. Lu wrote: >> >> What is wrong

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread Tejas Belagod
H.J. Lu wrote: On Tue, Dec 10, 2013 at 9:26 AM, Tejas Belagod wrote: H.J. Lu wrote: On Tue, Dec 10, 2013 at 9:04 AM, Kirill Yukhin wrote: On 10 Dec 08:23, H.J. Lu wrote: What is wrong to pass the correct offset to CANNOT_CHANGE_MODE_CLASS? Backends are free to ignore it. Yes, but as fas a

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread H.J. Lu
On Tue, Dec 10, 2013 at 10:44 AM, Richard Sandiford wrote: > "H.J. Lu" writes: >> On Tue, Dec 10, 2013 at 10:26 AM, Richard Sandiford >> wrote: >>> "H.J. Lu" writes: On Tue, Dec 10, 2013 at 9:57 AM, Richard Sandiford wrote: > "H.J. Lu" writes: >> On Tue, Dec 10, 2013 at 8:05

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread Richard Sandiford
"H.J. Lu" writes: > On Tue, Dec 10, 2013 at 10:26 AM, Richard Sandiford > wrote: >> "H.J. Lu" writes: >>> On Tue, Dec 10, 2013 at 9:57 AM, Richard Sandiford >>> wrote: "H.J. Lu" writes: > On Tue, Dec 10, 2013 at 8:05 AM, Kirill Yukhin > wrote: >> On 09 Dec 14:08, H.J. Lu wrot

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread H.J. Lu
On Tue, Dec 10, 2013 at 10:26 AM, Richard Sandiford wrote: > "H.J. Lu" writes: >> On Tue, Dec 10, 2013 at 9:57 AM, Richard Sandiford >> wrote: >>> "H.J. Lu" writes: On Tue, Dec 10, 2013 at 8:05 AM, Kirill Yukhin wrote: > On 09 Dec 14:08, H.J. Lu wrote: >> >> There are no

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread Richard Sandiford
"H.J. Lu" writes: > On Tue, Dec 10, 2013 at 9:57 AM, Richard Sandiford > wrote: >> "H.J. Lu" writes: >>> On Tue, Dec 10, 2013 at 8:05 AM, Kirill Yukhin >>> wrote: On 09 Dec 14:08, H.J. Lu wrote: > > There are no regressions on Linux/x86-64 with -m32 and -m64. > Can you check if

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread H.J. Lu
On Tue, Dec 10, 2013 at 9:57 AM, Richard Sandiford wrote: > "H.J. Lu" writes: >> On Tue, Dec 10, 2013 at 8:05 AM, Kirill Yukhin >> wrote: >>> On 09 Dec 14:08, H.J. Lu wrote: There are no regressions on Linux/x86-64 with -m32 and -m64. Can you check if it improves code quality on

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread Richard Sandiford
"H.J. Lu" writes: > On Tue, Dec 10, 2013 at 8:05 AM, Kirill Yukhin > wrote: >> On 09 Dec 14:08, H.J. Lu wrote: >>> >>> There are no regressions on Linux/x86-64 with -m32 and -m64. >>> Can you check if it improves code quality on x886? >> >> As second thought. If Tejas and Richard are right and i

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread H.J. Lu
On Tue, Dec 10, 2013 at 9:26 AM, Tejas Belagod wrote: > H.J. Lu wrote: >> >> On Tue, Dec 10, 2013 at 9:04 AM, Kirill Yukhin >> wrote: >>> >>> On 10 Dec 08:23, H.J. Lu wrote: What is wrong to pass the correct offset to CANNOT_CHANGE_MODE_CLASS? Backends are free to ignore it.

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread Tejas Belagod
H.J. Lu wrote: On Tue, Dec 10, 2013 at 9:04 AM, Kirill Yukhin wrote: On 10 Dec 08:23, H.J. Lu wrote: What is wrong to pass the correct offset to CANNOT_CHANGE_MODE_CLASS? Backends are free to ignore it. Yes, but as fas as understand this hook as a predicate saying if it not-safe to change mo

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread H.J. Lu
On Tue, Dec 10, 2013 at 9:04 AM, Kirill Yukhin wrote: > On 10 Dec 08:23, H.J. Lu wrote: >> What is wrong to pass the correct offset to >> CANNOT_CHANGE_MODE_CLASS? Backends are free to >> ignore it. > > Yes, but as fas as understand this hook as a predicate > saying if it not-safe to change mode1

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread H.J. Lu
On Tue, Dec 10, 2013 at 9:09 AM, Kirill Yukhin wrote: > On 10 Dec 09:02, H.J. Lu wrote: >> On Tue, Dec 10, 2013 at 8:05 AM, Kirill Yukhin >> wrote: >> > On 09 Dec 14:08, H.J. Lu wrote: >> > NOINLINE float >> > foo32x2_le (float32x2_t x) >> > { >> > +#ifdef __i386__ >> > + __builtin_ia32_emms

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread Kirill Yukhin
On 10 Dec 09:02, H.J. Lu wrote: > On Tue, Dec 10, 2013 at 8:05 AM, Kirill Yukhin > wrote: > > On 09 Dec 14:08, H.J. Lu wrote: > > NOINLINE float > > foo32x2_le (float32x2_t x) > > { > > +#ifdef __i386__ > > + __builtin_ia32_emms (); > > +#endif > >return bar (x[0]); > > } > You should ch

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread Kirill Yukhin
On 10 Dec 08:23, H.J. Lu wrote: > What is wrong to pass the correct offset to > CANNOT_CHANGE_MODE_CLASS? Backends are free to > ignore it. Yes, but as fas as understand this hook as a predicate saying if it not-safe to change mode1 to mode2 for given register class. I don't think that offsets sh

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread H.J. Lu
On Tue, Dec 10, 2013 at 8:05 AM, Kirill Yukhin wrote: > On 09 Dec 14:08, H.J. Lu wrote: >> >> There are no regressions on Linux/x86-64 with -m32 and -m64. >> Can you check if it improves code quality on x886? > > As second thought. If Tejas and Richard are right and it is simply incorrect > to che

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread Paul_Koning
On Dec 10, 2013, at 9:50 AM, Kirill Yukhin wrote: > Hello, > On 09 Dec 14:08, H.J. Lu wrote: >> There are no regressions on Linux/x86-64 with -m32 and -m64. >> Can you check if it improves code quality on x886? > > That is exactly what I was talking about. However I wasn't sure > that we can ch

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread H.J. Lu
On Tue, Dec 10, 2013 at 8:05 AM, Kirill Yukhin wrote: > On 09 Dec 14:08, H.J. Lu wrote: >> >> There are no regressions on Linux/x86-64 with -m32 and -m64. >> Can you check if it improves code quality on x886? > > As second thought. If Tejas and Richard are right and it is simply incorrect > to che

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread Kirill Yukhin
On 09 Dec 14:08, H.J. Lu wrote: > > There are no regressions on Linux/x86-64 with -m32 and -m64. > Can you check if it improves code quality on x886? As second thought. If Tejas and Richard are right and it is simply incorrect to check any offsets in this hook, may be we can end up with patch in

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-10 Thread Kirill Yukhin
Hello, On 09 Dec 14:08, H.J. Lu wrote: > There are no regressions on Linux/x86-64 with -m32 and -m64. > Can you check if it improves code quality on x886? That is exactly what I was talking about. However I wasn't sure that we can change already defined (and used throughout ports) target hook. An

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-09 Thread H.J. Lu
On Mon, Dec 9, 2013 at 5:48 AM, H.J. Lu wrote: > On Mon, Dec 9, 2013 at 5:00 AM, H.J. Lu wrote: >> On Mon, Dec 9, 2013 at 1:56 AM, Tejas Belagod wrote: >>> Kirill Yukhin wrote: Hello, On 05 Dec 16:40, Kirill Yukhin wrote: > > On 05 Dec 05:30, H.J. Lu wrote: >> >>>

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-09 Thread H.J. Lu
On Mon, Dec 9, 2013 at 5:00 AM, H.J. Lu wrote: > On Mon, Dec 9, 2013 at 1:56 AM, Tejas Belagod wrote: >> Kirill Yukhin wrote: >>> >>> Hello, >>> >>> On 05 Dec 16:40, Kirill Yukhin wrote: On 05 Dec 05:30, H.J. Lu wrote: > > Kirill, can you take a look why it doesn't work for x86?

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-09 Thread H.J. Lu
On Mon, Dec 9, 2013 at 1:56 AM, Tejas Belagod wrote: > Kirill Yukhin wrote: >> >> Hello, >> >> On 05 Dec 16:40, Kirill Yukhin wrote: >>> >>> On 05 Dec 05:30, H.J. Lu wrote: Kirill, can you take a look why it doesn't work for x86? >>> >>> Okay, I'll look at this. >> >> >> I've looked at t

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-09 Thread Richard Sandiford
Tejas Belagod writes: > Kirill Yukhin wrote: >> Hello, >> >> On 05 Dec 16:40, Kirill Yukhin wrote: >>> On 05 Dec 05:30, H.J. Lu wrote: Kirill, can you take a look why it doesn't work for x86? >>> Okay, I'll look at this. >> >> I've looked at this. It seems that `CANNOT_CHANGE_MODE_CLASS' >>

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-09 Thread Tejas Belagod
Kirill Yukhin wrote: Hello, On 05 Dec 16:40, Kirill Yukhin wrote: On 05 Dec 05:30, H.J. Lu wrote: Kirill, can you take a look why it doesn't work for x86? Okay, I'll look at this. I've looked at this. It seems that `CANNOT_CHANGE_MODE_CLASS' is too conservative for x86. In rtlanal.c we hav

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-08 Thread Kirill Yukhin
Hello, On 05 Dec 16:40, Kirill Yukhin wrote: > On 05 Dec 05:30, H.J. Lu wrote: > > Kirill, can you take a look why it doesn't work for x86? > Okay, I'll look at this. I've looked at this. It seems that `CANNOT_CHANGE_MODE_CLASS' is too conservative for x86. In rtlanal.c we have `simplify_subreg_

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-06 Thread Jakub Jelinek
On Fri, Dec 06, 2013 at 05:12:08PM +, Tejas Belagod wrote: > 2013-12-06 Tejas Belagod > > testsuite/ > * gcc.dg/vect/vect-nop-move.c: Fix dg options. Ok, thanks. > --- a/gcc/testsuite/gcc.dg/vect/vect-nop-move.c > +++ b/gcc/testsuite/gcc.dg/vect/vect-nop-move.c > @@ -1,6 +1,6 @@

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-06 Thread Tejas Belagod
Jakub Jelinek wrote: On Wed, Dec 04, 2013 at 08:14:43AM -0800, H.J. Lu wrote: --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-nop-move.c @@ -0,0 +1,64 @@ +/* { dg-do run } */ +/* { dg-require-effective-target vect_float } */ +/* { dg-options "-O3 -fdump-rtl-combine-details" } */ Please chan

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-06 Thread Tejas Belagod
Jakub Jelinek wrote: On Wed, Dec 04, 2013 at 08:14:43AM -0800, H.J. Lu wrote: --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-nop-move.c @@ -0,0 +1,64 @@ +/* { dg-do run } */ +/* { dg-require-effective-target vect_float } */ +/* { dg-options "-O3 -fdump-rtl-combine-details" } */ Please chan

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-05 Thread Jakub Jelinek
On Wed, Dec 04, 2013 at 08:14:43AM -0800, H.J. Lu wrote: > > --- /dev/null > > +++ b/gcc/testsuite/gcc.dg/vect/vect-nop-move.c > > @@ -0,0 +1,64 @@ > > +/* { dg-do run } */ > > +/* { dg-require-effective-target vect_float } */ > > +/* { dg-options "-O3 -fdump-rtl-combine-details" } */ Please chang

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-05 Thread Jeff Law
On 12/05/13 09:12, Tejas Belagod wrote: Now that Kirill's looking at why this doesn't work for x86, could I check this in without enabling vect-nop-move.c for targets (i?86-*-* x86_64-*-*)? If not, I'm happy to wait. Yea, that's fine with me. jeff

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-05 Thread Tejas Belagod
Jeff Law wrote: On 12/04/13 09:06, Tejas Belagod wrote: Richard Sandiford wrote: Tejas Belagod writes: Richard Sandiford wrote: Tejas Belagod writes: The problem is that one reg rtx can span several hard registers. E.g. (reg:V4SI 32) might represent one 64-bit register (no. 32), but it mig

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-05 Thread Kirill Yukhin
Hello, On 05 Dec 05:30, H.J. Lu wrote: > Kirill, can you take a look why it doesn't work for x86? Okay, I'll look at this. -- Thanks, K

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-05 Thread H.J. Lu
On Thu, Dec 5, 2013 at 5:17 AM, Tejas Belagod wrote: > H.J. Lu wrote: >> >> On Wed, Dec 4, 2013 at 9:29 AM, Jeff Law wrote: >>> >>> On 12/04/13 09:14, H.J. Lu wrote: >>> > + > +/* { dg-final { scan-rtl-dump "deleting noop move" "combine" { target > aarch64*-*-* } } } */

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-05 Thread Tejas Belagod
H.J. Lu wrote: On Wed, Dec 4, 2013 at 9:29 AM, Jeff Law wrote: On 12/04/13 09:14, H.J. Lu wrote: + +/* { dg-final { scan-rtl-dump "deleting noop move" "combine" { target aarch64*-*-* } } } */ Any particular reason why it doesn't work for x86? I don't think so. I'm pretty sure Tejas is foc

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-04 Thread Jeff Law
On 12/04/13 09:06, Tejas Belagod wrote: Richard Sandiford wrote: Tejas Belagod writes: Richard Sandiford wrote: Tejas Belagod writes: The problem is that one reg rtx can span several hard registers. E.g. (reg:V4SI 32) might represent one 64-bit register (no. 32), but it might instead repres

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-04 Thread Richard Sandiford
Tejas Belagod writes: > Richard Sandiford wrote: >> Tejas Belagod writes: >>> Richard Sandiford wrote: Tejas Belagod writes: >> The problem is that one reg rtx can span several hard registers. >> E.g. (reg:V4SI 32) might represent one 64-bit register (no. 32), >> but it might in

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-04 Thread H.J. Lu
On Wed, Dec 4, 2013 at 9:29 AM, Jeff Law wrote: > On 12/04/13 09:14, H.J. Lu wrote: > >>> + >>> +/* { dg-final { scan-rtl-dump "deleting noop move" "combine" { target >>> aarch64*-*-* } } } */ >> >> >> Any particular reason why it doesn't work for x86? > > I don't think so. I'm pretty sure Tejas

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-04 Thread Jeff Law
On 12/04/13 09:14, H.J. Lu wrote: + +/* { dg-final { scan-rtl-dump "deleting noop move" "combine" { target aarch64*-*-* } } } */ Any particular reason why it doesn't work for x86? I don't think so. I'm pretty sure Tejas is focused on ARM platforms for the obvious reason. jeff

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-04 Thread H.J. Lu
On Wed, Dec 4, 2013 at 8:06 AM, Tejas Belagod wrote: > Thanks Richard. Here is a revised patch. Sorry about the delay - I was > investigating to make sure an LRA ICE I was seeing on aarch64 was unrelated > to this patch. I've added a test case that I expect to pass for aarch64. > I've also added t

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-12-04 Thread Tejas Belagod
Richard Sandiford wrote: Tejas Belagod writes: Richard Sandiford wrote: Tejas Belagod writes: The problem is that one reg rtx can span several hard registers. E.g. (reg:V4SI 32) might represent one 64-bit register (no. 32), but it might instead represent two 32-bit registers (nos. 32 and 33)

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-11-28 Thread Richard Sandiford
Tejas Belagod writes: > Richard Sandiford wrote: >> Tejas Belagod writes: The problem is that one reg rtx can span several hard registers. E.g. (reg:V4SI 32) might represent one 64-bit register (no. 32), but it might instead represent two 32-bit registers (nos. 32 and 33). Obv

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-11-27 Thread Tejas Belagod
Richard Sandiford wrote: Tejas Belagod writes: The problem is that one reg rtx can span several hard registers. E.g. (reg:V4SI 32) might represent one 64-bit register (no. 32), but it might instead represent two 32-bit registers (nos. 32 and 33). Obviously the latter's not very likely for vecto

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-11-10 Thread Richard Sandiford
Tejas Belagod writes: >> The problem is that one reg rtx can span several hard registers. >> E.g. (reg:V4SI 32) might represent one 64-bit register (no. 32), >> but it might instead represent two 32-bit registers (nos. 32 and 33). >> Obviously the latter's not very likely for vectors this small, >

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-11-07 Thread Tejas Belagod
Richard Sandiford wrote: Tejas Belagod writes: Richard Sandiford wrote: Tejas Belagod writes: Richard Sandiford wrote: Tejas Belagod writes: Richard Sandiford wrote: Tejas Belagod writes: + /* This is big-endian-safe because the elements are kept in target + memory order. So, for eg.

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-11-07 Thread Richard Sandiford
Tejas Belagod writes: > Richard Sandiford wrote: >> Tejas Belagod writes: >>> Richard Sandiford wrote: Tejas Belagod writes: > Richard Sandiford wrote: >> Tejas Belagod writes: >>> + /* This is big-endian-safe because the elements are kept in target >>> + memory order. So

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-11-07 Thread Tejas Belagod
Richard Sandiford wrote: Tejas Belagod writes: Richard Sandiford wrote: Tejas Belagod writes: Richard Sandiford wrote: Tejas Belagod writes: + /* This is big-endian-safe because the elements are kept in target + memory order. So, for eg. PARALLEL element value of 2 is the same in +

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-11-06 Thread Bill Schmidt
On Wed, 2013-11-06 at 17:34 +, Richard Sandiford wrote: > Tejas Belagod writes: > > Richard Sandiford wrote: > >> Tejas Belagod writes: > >>> Richard Sandiford wrote: > Tejas Belagod writes: > > + /* This is big-endian-safe because the elements are kept in target > > + memo

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-11-06 Thread Richard Sandiford
Tejas Belagod writes: > Richard Sandiford wrote: >> Tejas Belagod writes: >>> Richard Sandiford wrote: Tejas Belagod writes: > + /* This is big-endian-safe because the elements are kept in target > + memory order. So, for eg. PARALLEL element value of 2 is the same > in >

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-11-06 Thread Tejas Belagod
Richard Sandiford wrote: Tejas Belagod writes: Richard Sandiford wrote: Tejas Belagod writes: + /* This is big-endian-safe because the elements are kept in target + memory order. So, for eg. PARALLEL element value of 2 is the same in + either endian-ness. */ + if (GET_CODE (src)

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-11-06 Thread Bill Schmidt
On Wed, 2013-11-06 at 10:42 -0600, Bill Schmidt wrote: > On Wed, 2013-11-06 at 15:01 +0100, Richard Biener wrote: > > On Wed, Nov 6, 2013 at 2:24 PM, Tejas Belagod wrote: > > > > > > Hi, > > > > > > The attached patch eliminates moves of the form > > > > > > set( (reg:DI n) vec_select:DI

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-11-06 Thread Bill Schmidt
On Wed, 2013-11-06 at 15:01 +0100, Richard Biener wrote: > On Wed, Nov 6, 2013 at 2:24 PM, Tejas Belagod wrote: > > > > Hi, > > > > The attached patch eliminates moves of the form > > > > set( (reg:DI n) vec_select:DI ( (reg:V2DI n) (parallel [const 0] > > > > i.e. eliminates lower lan

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-11-06 Thread Richard Sandiford
Tejas Belagod writes: > Richard Sandiford wrote: >> Tejas Belagod writes: >>> + /* This is big-endian-safe because the elements are kept in target >>> + memory order. So, for eg. PARALLEL element value of 2 is the same in >>> + either endian-ness. */ >>> + if (GET_CODE (src) == VEC_SE

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-11-06 Thread Tejas Belagod
Richard Sandiford wrote: Tejas Belagod writes: + /* This is big-endian-safe because the elements are kept in target + memory order. So, for eg. PARALLEL element value of 2 is the same in + either endian-ness. */ + if (GET_CODE (src) == VEC_SELECT + && REG_P (XEXP (src, 0)) && R

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-11-06 Thread Richard Sandiford
Tejas Belagod writes: > + /* This is big-endian-safe because the elements are kept in target > + memory order. So, for eg. PARALLEL element value of 2 is the same in > + either endian-ness. */ > + if (GET_CODE (src) == VEC_SELECT > + && REG_P (XEXP (src, 0)) && REG_P (dst) > +

Re: [Patch, RTL] Eliminate redundant vec_select moves.

2013-11-06 Thread Richard Biener
On Wed, Nov 6, 2013 at 2:24 PM, Tejas Belagod wrote: > > Hi, > > The attached patch eliminates moves of the form > > set( (reg:DI n) vec_select:DI ( (reg:V2DI n) (parallel [const 0] > > i.e. eliminates lower lane moves between src and dst where src and dst are > the same register and t

[Patch, RTL] Eliminate redundant vec_select moves.

2013-11-06 Thread Tejas Belagod
Hi, The attached patch eliminates moves of the form set( (reg:DI n) vec_select:DI ( (reg:V2DI n) (parallel [const 0] i.e. eliminates lower lane moves between src and dst where src and dst are the same register and this causes rtl to instead use the destination register in the req