* [PATCH]middle-end: skip vectorization check on ilp32 on vect-early-break_124-pr114403.c
@ 2024-04-16 5:41 Tamar Christina
2024-04-16 7:00 ` Richard Biener
0 siblings, 1 reply; 5+ messages in thread
From: Tamar Christina @ 2024-04-16 5:41 UTC (permalink / raw)
To: gcc-patches; +Cc: nd, rguenther, jlaw
[-- Attachment #1: Type: text/plain, Size: 1294 bytes --]
Hi all,
The testcase seems to fail vectorization on -m32 since the access pattern is
determined as too complex. This skips the vectorization check on ilp32 systems
as I couldn't find a better proxy for being able to do strided 64-bit loads and
I suspect it would fail on all 32-bit targets.
Regtested on x86_64-pc-linux-gnu with -m32 and no issues.
Ok for master?
Thanks,
Tamar
gcc/testsuite/ChangeLog:
PR tree-optimization/114403
* gcc.dg/vect/vect-early-break_124-pr114403.c: Skip in ilp32.
---
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
index 1751296ab813fe85eaab1f58dc674bac10f6eb7a..db8e00556f116ca81c5a6558ec6ecd3b222ec93d 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
@@ -2,11 +2,11 @@
/* { dg-require-effective-target vect_early_break_hw } */
/* { dg-require-effective-target vect_long_long } */
-/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { ! ilp32 } } } } */
#include "tree-vect.h"
-typedef unsigned long PV;
+typedef unsigned long long PV;
typedef struct _buff_t {
int foo;
PV Val;
--
[-- Attachment #2: rb18418.patch --]
[-- Type: text/x-diff, Size: 782 bytes --]
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
index 1751296ab813fe85eaab1f58dc674bac10f6eb7a..db8e00556f116ca81c5a6558ec6ecd3b222ec93d 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
@@ -2,11 +2,11 @@
/* { dg-require-effective-target vect_early_break_hw } */
/* { dg-require-effective-target vect_long_long } */
-/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { ! ilp32 } } } } */
#include "tree-vect.h"
-typedef unsigned long PV;
+typedef unsigned long long PV;
typedef struct _buff_t {
int foo;
PV Val;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH]middle-end: skip vectorization check on ilp32 on vect-early-break_124-pr114403.c
2024-04-16 5:41 [PATCH]middle-end: skip vectorization check on ilp32 on vect-early-break_124-pr114403.c Tamar Christina
@ 2024-04-16 7:00 ` Richard Biener
2024-04-16 7:06 ` Jakub Jelinek
0 siblings, 1 reply; 5+ messages in thread
From: Richard Biener @ 2024-04-16 7:00 UTC (permalink / raw)
To: Tamar Christina; +Cc: gcc-patches, nd, jlaw
On Tue, 16 Apr 2024, Tamar Christina wrote:
> Hi all,
>
> The testcase seems to fail vectorization on -m32 since the access pattern is
> determined as too complex. This skips the vectorization check on ilp32 systems
> as I couldn't find a better proxy for being able to do strided 64-bit loads and
> I suspect it would fail on all 32-bit targets.
You could try having Val aligned to 64bits in the structure (likely
32bit targets have it not aligned).
> Regtested on x86_64-pc-linux-gnu with -m32 and no issues.
>
> Ok for master?
>
> Thanks,
> Tamar
>
> gcc/testsuite/ChangeLog:
>
> PR tree-optimization/114403
> * gcc.dg/vect/vect-early-break_124-pr114403.c: Skip in ilp32.
>
> ---
> diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
> index 1751296ab813fe85eaab1f58dc674bac10f6eb7a..db8e00556f116ca81c5a6558ec6ecd3b222ec93d 100644
> --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
> +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
> @@ -2,11 +2,11 @@
> /* { dg-require-effective-target vect_early_break_hw } */
> /* { dg-require-effective-target vect_long_long } */
>
> -/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
> +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { ! ilp32 } } } } */
>
> #include "tree-vect.h"
>
> -typedef unsigned long PV;
> +typedef unsigned long long PV;
> typedef struct _buff_t {
> int foo;
> PV Val;
>
>
>
>
>
--
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH]middle-end: skip vectorization check on ilp32 on vect-early-break_124-pr114403.c
2024-04-16 7:00 ` Richard Biener
@ 2024-04-16 7:06 ` Jakub Jelinek
2024-04-16 7:12 ` Tamar Christina
0 siblings, 1 reply; 5+ messages in thread
From: Jakub Jelinek @ 2024-04-16 7:06 UTC (permalink / raw)
To: Richard Biener; +Cc: Tamar Christina, gcc-patches, nd, jlaw
On Tue, Apr 16, 2024 at 09:00:53AM +0200, Richard Biener wrote:
> > PR tree-optimization/114403
> > * gcc.dg/vect/vect-early-break_124-pr114403.c: Skip in ilp32.
> >
> > ---
> > diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
> > index 1751296ab813fe85eaab1f58dc674bac10f6eb7a..db8e00556f116ca81c5a6558ec6ecd3b222ec93d 100644
> > --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
> > +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
> > @@ -2,11 +2,11 @@
> > /* { dg-require-effective-target vect_early_break_hw } */
> > /* { dg-require-effective-target vect_long_long } */
> >
> > -/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
> > +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { ! ilp32 } } } } */
> >
> > #include "tree-vect.h"
> >
> > -typedef unsigned long PV;
> > +typedef unsigned long long PV;
> > typedef struct _buff_t {
> > int foo;
> > PV Val;
As discussed on IRC, I think we want
--- gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c.jj 2024-04-16 08:43:36.001729192 +0200
+++ gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c 2024-04-16 08:55:11.296214959 +0200
@@ -64,8 +64,8 @@ int main ()
int store_size = sizeof(PV);
#pragma GCC novector
- for (int i = 0; i < NUM - 1; i+=store_size)
- if (0 != __builtin_memcmp (buffer+i, (char*)&tmp[i].Val, store_size))
+ for (int i = 0; i < NUM - 1; i++)
+ if (0 != __builtin_memcmp (buffer+i*store_size, (char*)&tmp[i].Val, store_size))
__builtin_abort ();
return 0;
instead (and then I think there is no need to switch PV from unsigned long
to unsigned long long, nor disabling on ilp32.
Jakub
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH]middle-end: skip vectorization check on ilp32 on vect-early-break_124-pr114403.c
2024-04-16 7:06 ` Jakub Jelinek
@ 2024-04-16 7:12 ` Tamar Christina
2024-04-16 13:44 ` Jakub Jelinek
0 siblings, 1 reply; 5+ messages in thread
From: Tamar Christina @ 2024-04-16 7:12 UTC (permalink / raw)
To: Jakub Jelinek, Richard Biener; +Cc: gcc-patches, nd, jlaw
[-- Attachment #1: Type: text/plain, Size: 2906 bytes --]
> On Tue, Apr 16, 2024 at 09:00:53AM +0200, Richard Biener wrote:
> > > PR tree-optimization/114403
> > > * gcc.dg/vect/vect-early-break_124-pr114403.c: Skip in ilp32.
> > >
> > > ---
> > > diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
> b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
> > > index
> 1751296ab813fe85eaab1f58dc674bac10f6eb7a..db8e00556f116ca81c5a6558e
> c6ecd3b222ec93d 100644
> > > --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
> > > +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
> > > @@ -2,11 +2,11 @@
> > > /* { dg-require-effective-target vect_early_break_hw } */
> > > /* { dg-require-effective-target vect_long_long } */
> > >
> > > -/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
> > > +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { ! ilp32 } } }
> } */
> > >
> > > #include "tree-vect.h"
> > >
> > > -typedef unsigned long PV;
> > > +typedef unsigned long long PV;
> > > typedef struct _buff_t {
> > > int foo;
> > > PV Val;
>
> As discussed on IRC, I think we want
> --- gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c.jj 2024-04-
> 16 08:43:36.001729192 +0200
> +++ gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c 2024-04-
> 16 08:55:11.296214959 +0200
> @@ -64,8 +64,8 @@ int main ()
>
> int store_size = sizeof(PV);
> #pragma GCC novector
> - for (int i = 0; i < NUM - 1; i+=store_size)
> - if (0 != __builtin_memcmp (buffer+i, (char*)&tmp[i].Val, store_size))
> + for (int i = 0; i < NUM - 1; i++)
> + if (0 != __builtin_memcmp (buffer+i*store_size, (char*)&tmp[i].Val, store_size))
> __builtin_abort ();
>
> return 0;
>
> instead (and then I think there is no need to switch PV from unsigned long
> to unsigned long long, nor disabling on ilp32.
>
Regtested on x86_64-pc-linux-gnu with -m32,-m64 and no issues.
Ok for master?
Thanks,
Tamar
gcc/testsuite/ChangeLog:
PR tree-optimization/114403
* gcc.dg/vect/vect-early-break_124-pr114403.c: Fix check loop.
-- inline copy of patch --
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
index 1751296ab813fe85eaab1f58dc674bac10f6eb7a..51abf245ccb51b85f06916a8a0238698911ab551 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
@@ -68,8 +68,8 @@ int main ()
int store_size = sizeof(PV);
#pragma GCC novector
- for (int i = 0; i < NUM - 1; i+=store_size)
- if (0 != __builtin_memcmp (buffer+i, (char*)&tmp[i].Val, store_size))
+ for (int i = 0; i < NUM - 1; i++)
+ if (0 != __builtin_memcmp (buffer+(i*store_size), (char*)&tmp[i].Val, store_size))
__builtin_abort ();
return 0;
[-- Attachment #2: rb18418.patch --]
[-- Type: application/octet-stream, Size: 730 bytes --]
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
index 1751296ab813fe85eaab1f58dc674bac10f6eb7a..51abf245ccb51b85f06916a8a0238698911ab551 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
@@ -68,8 +68,8 @@ int main ()
int store_size = sizeof(PV);
#pragma GCC novector
- for (int i = 0; i < NUM - 1; i+=store_size)
- if (0 != __builtin_memcmp (buffer+i, (char*)&tmp[i].Val, store_size))
+ for (int i = 0; i < NUM - 1; i++)
+ if (0 != __builtin_memcmp (buffer+(i*store_size), (char*)&tmp[i].Val, store_size))
__builtin_abort ();
return 0;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH]middle-end: skip vectorization check on ilp32 on vect-early-break_124-pr114403.c
2024-04-16 7:12 ` Tamar Christina
@ 2024-04-16 13:44 ` Jakub Jelinek
0 siblings, 0 replies; 5+ messages in thread
From: Jakub Jelinek @ 2024-04-16 13:44 UTC (permalink / raw)
To: Tamar Christina; +Cc: Richard Biener, gcc-patches, nd, jlaw
On Tue, Apr 16, 2024 at 07:12:23AM +0000, Tamar Christina wrote:
> Regtested on x86_64-pc-linux-gnu with -m32,-m64 and no issues.
>
> Ok for master?
>
> Thanks,
> Tamar
>
> gcc/testsuite/ChangeLog:
>
> PR tree-optimization/114403
> * gcc.dg/vect/vect-early-break_124-pr114403.c: Fix check loop.
>
> -- inline copy of patch --
>
> diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
> index 1751296ab813fe85eaab1f58dc674bac10f6eb7a..51abf245ccb51b85f06916a8a0238698911ab551 100644
> --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
> +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c
> @@ -68,8 +68,8 @@ int main ()
>
> int store_size = sizeof(PV);
> #pragma GCC novector
> - for (int i = 0; i < NUM - 1; i+=store_size)
> - if (0 != __builtin_memcmp (buffer+i, (char*)&tmp[i].Val, store_size))
> + for (int i = 0; i < NUM - 1; i++)
> + if (0 != __builtin_memcmp (buffer+(i*store_size), (char*)&tmp[i].Val, store_size))
> __builtin_abort ();
>
> return 0;
LGTM.
Jakub
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-04-16 13:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-16 5:41 [PATCH]middle-end: skip vectorization check on ilp32 on vect-early-break_124-pr114403.c Tamar Christina
2024-04-16 7:00 ` Richard Biener
2024-04-16 7:06 ` Jakub Jelinek
2024-04-16 7:12 ` Tamar Christina
2024-04-16 13:44 ` Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).