public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Changed vector size
@ 2023-03-27 10:37 chenyixuan
  2023-03-27 14:49 ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: chenyixuan @ 2023-03-27 10:37 UTC (permalink / raw)
  To: gcc-patches
  Cc: kito.cheng, andrew, oriachiuan, jiawei, shihua, shiyulong, Yixuan Chen

From: Yixuan Chen <chenyixuan@iscas.ac.cn>

Observed a vint type "ABS_EXPR" followed by extra 3 int type "ABS_EXPR". If want to test absolute value optimization for vector, maybe don't need 4 times.

gcc/testsuite/ChangeLog:

2023-03-27  Yixuan Chen  <chenyixuan@iscas.ac.cn>

        * g++.dg/pr94920.C: Declare the vector size as long as int.

---
 gcc/testsuite/g++.dg/pr94920.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.dg/pr94920.C b/gcc/testsuite/g++.dg/pr94920.C
index 126b00478d2..498bef93b3a 100644
--- a/gcc/testsuite/g++.dg/pr94920.C
+++ b/gcc/testsuite/g++.dg/pr94920.C
@@ -2,7 +2,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -Wno-psabi -fdump-tree-optimized" } */
 
-typedef int __attribute__((vector_size(4*sizeof(int)))) vint;
+typedef int __attribute__((vector_size(sizeof(int)))) vint;
 
 /* Same form as PR.  */
 __attribute__((noipa)) unsigned int foo(int x) {
-- 
2.40.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Changed vector size
  2023-03-27 10:37 [PATCH] Changed vector size chenyixuan
@ 2023-03-27 14:49 ` Richard Biener
  2023-03-29  8:34   ` 陈逸轩
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2023-03-27 14:49 UTC (permalink / raw)
  To: chenyixuan
  Cc: gcc-patches, kito.cheng, andrew, oriachiuan, jiawei, shihua, shiyulong

On Mon, Mar 27, 2023 at 12:37 PM <chenyixuan@iscas.ac.cn> wrote:
>
> From: Yixuan Chen <chenyixuan@iscas.ac.cn>
>
> Observed a vint type "ABS_EXPR" followed by extra 3 int type "ABS_EXPR". If want to test absolute value optimization for vector, maybe don't need 4 times.

A better solution would be to scan a dump before the veclower pass?

> gcc/testsuite/ChangeLog:
>
> 2023-03-27  Yixuan Chen  <chenyixuan@iscas.ac.cn>
>
>         * g++.dg/pr94920.C: Declare the vector size as long as int.
>
> ---
>  gcc/testsuite/g++.dg/pr94920.C | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/testsuite/g++.dg/pr94920.C b/gcc/testsuite/g++.dg/pr94920.C
> index 126b00478d2..498bef93b3a 100644
> --- a/gcc/testsuite/g++.dg/pr94920.C
> +++ b/gcc/testsuite/g++.dg/pr94920.C
> @@ -2,7 +2,7 @@
>  /* { dg-do compile } */
>  /* { dg-options "-O2 -Wno-psabi -fdump-tree-optimized" } */
>
> -typedef int __attribute__((vector_size(4*sizeof(int)))) vint;
> +typedef int __attribute__((vector_size(sizeof(int)))) vint;
>
>  /* Same form as PR.  */
>  __attribute__((noipa)) unsigned int foo(int x) {
> --
> 2.40.0
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: [PATCH] Changed vector size
  2023-03-27 14:49 ` Richard Biener
@ 2023-03-29  8:34   ` 陈逸轩
  2023-03-29  8:47     ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: 陈逸轩 @ 2023-03-29  8:34 UTC (permalink / raw)
  To: Richard Biener
  Cc: gcc-patches, kito.cheng, andrew, oriachiuan, jiawei, shihua, shiyulong

Thanks for your suggestion!But I met the issue that if I declare a int type variable,this variable can't be converted to vector type. Could you teach me more detail?

Best regards!
Yixuan Chen  

&quot;Richard Biener&quot; &lt;richard.guenther@gmail.com&gt;wrote:
> On Mon, Mar 27, 2023 at 12:37 PM <chenyixuan@iscas.ac.cn> wrote:
> >
> > From: Yixuan Chen <chenyixuan@iscas.ac.cn>
> >
> > Observed a vint type "ABS_EXPR" followed by extra 3 int type "ABS_EXPR". If want to test absolute value optimization for vector, maybe don't need 4 times.
> 
> A better solution would be to scan a dump before the veclower pass?
> 
> > gcc/testsuite/ChangeLog:
> >
> > 2023-03-27  Yixuan Chen  <chenyixuan@iscas.ac.cn>
> >
> >         * g++.dg/pr94920.C: Declare the vector size as long as int.
> >
> > ---
> >  gcc/testsuite/g++.dg/pr94920.C | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/gcc/testsuite/g++.dg/pr94920.C b/gcc/testsuite/g++.dg/pr94920.C
> > index 126b00478d2..498bef93b3a 100644
> > --- a/gcc/testsuite/g++.dg/pr94920.C
> > +++ b/gcc/testsuite/g++.dg/pr94920.C
> > @@ -2,7 +2,7 @@
> >  /* { dg-do compile } */
> >  /* { dg-options "-O2 -Wno-psabi -fdump-tree-optimized" } */
> >
> > -typedef int __attribute__((vector_size(4*sizeof(int)))) vint;
> > +typedef int __attribute__((vector_size(sizeof(int)))) vint;
> >
> >  /* Same form as PR.  */
> >  __attribute__((noipa)) unsigned int foo(int x) {
> > --
> > 2.40.0
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: [PATCH] Changed vector size
  2023-03-29  8:34   ` 陈逸轩
@ 2023-03-29  8:47     ` Richard Biener
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Biener @ 2023-03-29  8:47 UTC (permalink / raw)
  To: 陈逸轩
  Cc: gcc-patches, kito.cheng, andrew, oriachiuan, jiawei, shihua, shiyulong

On Wed, Mar 29, 2023 at 10:35 AM 陈逸轩 <chenyixuan@iscas.ac.cn> wrote:
>
> Thanks for your suggestion!But I met the issue that if I declare a int type variable,this variable can't be converted to vector type. Could you teach me more detail?

I don't understand what you mean.  I have pushed a fix.

Richard.

> Best regards!
> Yixuan Chen
>
> &quot;Richard Biener&quot; &lt;richard.guenther@gmail.com&gt;wrote:
> > On Mon, Mar 27, 2023 at 12:37 PM <chenyixuan@iscas.ac.cn> wrote:
> > >
> > > From: Yixuan Chen <chenyixuan@iscas.ac.cn>
> > >
> > > Observed a vint type "ABS_EXPR" followed by extra 3 int type "ABS_EXPR". If want to test absolute value optimization for vector, maybe don't need 4 times.
> >
> > A better solution would be to scan a dump before the veclower pass?
> >
> > > gcc/testsuite/ChangeLog:
> > >
> > > 2023-03-27  Yixuan Chen  <chenyixuan@iscas.ac.cn>
> > >
> > >         * g++.dg/pr94920.C: Declare the vector size as long as int.
> > >
> > > ---
> > >  gcc/testsuite/g++.dg/pr94920.C | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/gcc/testsuite/g++.dg/pr94920.C b/gcc/testsuite/g++.dg/pr94920.C
> > > index 126b00478d2..498bef93b3a 100644
> > > --- a/gcc/testsuite/g++.dg/pr94920.C
> > > +++ b/gcc/testsuite/g++.dg/pr94920.C
> > > @@ -2,7 +2,7 @@
> > >  /* { dg-do compile } */
> > >  /* { dg-options "-O2 -Wno-psabi -fdump-tree-optimized" } */
> > >
> > > -typedef int __attribute__((vector_size(4*sizeof(int)))) vint;
> > > +typedef int __attribute__((vector_size(sizeof(int)))) vint;
> > >
> > >  /* Same form as PR.  */
> > >  __attribute__((noipa)) unsigned int foo(int x) {
> > > --
> > > 2.40.0
> > >

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-29  8:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-27 10:37 [PATCH] Changed vector size chenyixuan
2023-03-27 14:49 ` Richard Biener
2023-03-29  8:34   ` 陈逸轩
2023-03-29  8:47     ` Richard Biener

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).