public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Enable vectorization for vect-early-break_124-pr114403.c
@ 2024-05-20  7:59 Li Xu
  2024-05-20  8:15 ` juzhe.zhong
  0 siblings, 1 reply; 4+ messages in thread
From: Li Xu @ 2024-05-20  7:59 UTC (permalink / raw)
  To: gcc-patches
  Cc: kito.cheng, palmer, tamar.christina, richard.guenther,
	Richard.Sandiford, juzhe.zhong, zhengyu, pan2.li, xuli

From: xuli <xuli1@eswincomputing.com>

Because "targetm.slow_unaligned_access" is set to true by default
(aka -mtune=rocket) for RISC-V, it causes the __builtin_memcpy with
8 bytes failed to folded into int64 assignment during ccp1.

So adding "-mtune=generic-ooo" to the RISC-V target can vectorize
vect-early-break_124-pr114403.c.

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/vect-early-break_124-pr114403.c: Enable vectrization for RISC-V target.
---
 gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 101ae1e0eaa..610b951b262 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
@@ -1,8 +1,9 @@
 /* { dg-add-options vect_early_break } */
 /* { dg-require-effective-target vect_early_break_hw } */
 /* { dg-require-effective-target vect_long_long } */
+/* { dg-additional-options "-mtune=generic-ooo" { target riscv*-*-* } } */
 
-/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { xfail riscv*-*-* } } } */
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
 
 #include "tree-vect.h"
 
@@ -74,4 +75,3 @@ int main ()
 
   return 0;
 }
-
-- 
2.17.1


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

* Re: [PATCH] RISC-V: Enable vectorization for vect-early-break_124-pr114403.c
  2024-05-20  7:59 [PATCH] RISC-V: Enable vectorization for vect-early-break_124-pr114403.c Li Xu
@ 2024-05-20  8:15 ` juzhe.zhong
  2024-05-21 14:58   ` Robin Dapp
  0 siblings, 1 reply; 4+ messages in thread
From: juzhe.zhong @ 2024-05-20  8:15 UTC (permalink / raw)
  To: Li Xu, gcc-patches
  Cc: kito.cheng, palmer, tamar.christina, Richard Biener,
	richard.sandiford, zhengyu, pan2.li, Li Xu, Robin Dapp

[-- Attachment #1: Type: text/plain, Size: 1739 bytes --]

CC Robin who knows better than me in case of scheduling model in RISC-V



juzhe.zhong@rivai.ai
 
From: Li Xu
Date: 2024-05-20 15:59
To: gcc-patches
CC: kito.cheng; palmer; tamar.christina; richard.guenther; Richard.Sandiford; juzhe.zhong; zhengyu; pan2.li; xuli
Subject: [PATCH] RISC-V: Enable vectorization for vect-early-break_124-pr114403.c
From: xuli <xuli1@eswincomputing.com>
 
Because "targetm.slow_unaligned_access" is set to true by default
(aka -mtune=rocket) for RISC-V, it causes the __builtin_memcpy with
8 bytes failed to folded into int64 assignment during ccp1.
 
So adding "-mtune=generic-ooo" to the RISC-V target can vectorize
vect-early-break_124-pr114403.c.
 
gcc/testsuite/ChangeLog:
 
* gcc.dg/vect/vect-early-break_124-pr114403.c: Enable vectrization for RISC-V target.
---
gcc/testsuite/gcc.dg/vect/vect-early-break_124-pr114403.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
 
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 101ae1e0eaa..610b951b262 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
@@ -1,8 +1,9 @@
/* { dg-add-options vect_early_break } */
/* { dg-require-effective-target vect_early_break_hw } */
/* { dg-require-effective-target vect_long_long } */
+/* { dg-additional-options "-mtune=generic-ooo" { target riscv*-*-* } } */
-/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { xfail riscv*-*-* } } } */
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
#include "tree-vect.h"
@@ -74,4 +75,3 @@ int main ()
   return 0;
}
-
-- 
2.17.1
 
 

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

* Re: [PATCH] RISC-V: Enable vectorization for vect-early-break_124-pr114403.c
  2024-05-20  8:15 ` juzhe.zhong
@ 2024-05-21 14:58   ` Robin Dapp
  2024-05-22  0:59     ` Li Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Robin Dapp @ 2024-05-21 14:58 UTC (permalink / raw)
  To: juzhe.zhong, Li Xu, gcc-patches
  Cc: rdapp.gcc, kito.cheng, palmer, tamar.christina, Richard Biener,
	richard.sandiford, zhengyu, pan2.li

The patch is OK from the riscv side.  generic-ooo includes fast unaligned
access.

Regards
 Robin

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

* Re: Re: [PATCH] RISC-V: Enable vectorization for vect-early-break_124-pr114403.c
  2024-05-21 14:58   ` Robin Dapp
@ 2024-05-22  0:59     ` Li Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Li Xu @ 2024-05-22  0:59 UTC (permalink / raw)
  To: Robin Dapp, juzhe.zhong, gcc-patches
  Cc: Robin Dapp, kito.cheng, palmer, tamar.christina, Richard Biener,
	richard.sandiford, zhengyu, pan2.li

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

Committed, thanks.



xuli1@eswincomputing.com
 
From: Robin Dapp
Date: 2024-05-21 22:58
To: juzhe.zhong@rivai.ai; Li Xu; gcc-patches
CC: rdapp.gcc; kito.cheng; palmer; tamar.christina; Richard Biener; richard.sandiford; zhengyu; pan2.li
Subject: Re: [PATCH] RISC-V: Enable vectorization for vect-early-break_124-pr114403.c
The patch is OK from the riscv side.  generic-ooo includes fast unaligned
access.
 
Regards
Robin

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

end of thread, other threads:[~2024-05-22  0:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-20  7:59 [PATCH] RISC-V: Enable vectorization for vect-early-break_124-pr114403.c Li Xu
2024-05-20  8:15 ` juzhe.zhong
2024-05-21 14:58   ` Robin Dapp
2024-05-22  0:59     ` Li Xu

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