public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH V2] RISC-V: Avoid unnecessary slideup in compress pattern of vec_perm
@ 2023-09-10 14:07 Juzhe-Zhong
  2023-09-10 14:07 ` 钟居哲
  2023-09-10 15:25 ` Jeff Law
  0 siblings, 2 replies; 4+ messages in thread
From: Juzhe-Zhong @ 2023-09-10 14:07 UTC (permalink / raw)
  To: gcc-patches; +Cc: kito.cheng, kito.cheng, jeffreyalaw, rdapp.gcc, Juzhe-Zhong

gcc/ChangeLog:

	* config/riscv/riscv-v.cc (shuffle_compress_patterns): Avoid unnecessary slideup.

---
 gcc/config/riscv/riscv-v.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc
index bee60de1d26..3cd1f61de0e 100644
--- a/gcc/config/riscv/riscv-v.cc
+++ b/gcc/config/riscv/riscv-v.cc
@@ -2647,7 +2647,8 @@ shuffle_compress_patterns (struct expand_vec_perm_d *d)
 
 	    For index = { 0, 2, 5, 6}, we need to slide op1 up before
 	    we apply compress approach.  */
-  bool need_slideup_p = maybe_ne (d->perm[vlen - 1], 2 * vec_len - 1);
+  bool need_slideup_p = maybe_ne (d->perm[vlen - 1], 2 * vec_len - 1)
+			&& !const_vec_duplicate_p (d->op1);
 
   /* If we leave it directly be handled by general gather,
      the code sequence will be:
-- 
2.36.3


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

* Re: [PATCH V2] RISC-V: Avoid unnecessary slideup in compress pattern of vec_perm
  2023-09-10 14:07 [PATCH V2] RISC-V: Avoid unnecessary slideup in compress pattern of vec_perm Juzhe-Zhong
@ 2023-09-10 14:07 ` 钟居哲
  2023-09-10 15:25 ` Jeff Law
  1 sibling, 0 replies; 4+ messages in thread
From: 钟居哲 @ 2023-09-10 14:07 UTC (permalink / raw)
  To: 钟居哲, gcc-patches
  Cc: kito.cheng, kito.cheng, Jeff Law, rdapp.gcc

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

Address comment: [PATCH V2] RISC-V: Avoid unnecessary slideup in compress pattern of vec_perm (gnu.org)



juzhe.zhong@rivai.ai
 
From: Juzhe-Zhong
Date: 2023-09-10 22:07
To: gcc-patches
CC: kito.cheng; kito.cheng; jeffreyalaw; rdapp.gcc; Juzhe-Zhong
Subject: [PATCH V2] RISC-V: Avoid unnecessary slideup in compress pattern of vec_perm
gcc/ChangeLog:
 
* config/riscv/riscv-v.cc (shuffle_compress_patterns): Avoid unnecessary slideup.
 
---
gcc/config/riscv/riscv-v.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
 
diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc
index bee60de1d26..3cd1f61de0e 100644
--- a/gcc/config/riscv/riscv-v.cc
+++ b/gcc/config/riscv/riscv-v.cc
@@ -2647,7 +2647,8 @@ shuffle_compress_patterns (struct expand_vec_perm_d *d)
    For index = { 0, 2, 5, 6}, we need to slide op1 up before
    we apply compress approach.  */
-  bool need_slideup_p = maybe_ne (d->perm[vlen - 1], 2 * vec_len - 1);
+  bool need_slideup_p = maybe_ne (d->perm[vlen - 1], 2 * vec_len - 1)
+ && !const_vec_duplicate_p (d->op1);
   /* If we leave it directly be handled by general gather,
      the code sequence will be:
-- 
2.36.3
 

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

* Re: [PATCH V2] RISC-V: Avoid unnecessary slideup in compress pattern of vec_perm
  2023-09-10 14:07 [PATCH V2] RISC-V: Avoid unnecessary slideup in compress pattern of vec_perm Juzhe-Zhong
  2023-09-10 14:07 ` 钟居哲
@ 2023-09-10 15:25 ` Jeff Law
  2023-09-10 23:01   ` Li, Pan2
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff Law @ 2023-09-10 15:25 UTC (permalink / raw)
  To: Juzhe-Zhong, gcc-patches; +Cc: kito.cheng, kito.cheng, rdapp.gcc



On 9/10/23 08:07, Juzhe-Zhong wrote:
> gcc/ChangeLog:
> 
> 	* config/riscv/riscv-v.cc (shuffle_compress_patterns): Avoid unnecessary slideup.
OK
jeff

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

* RE: [PATCH V2] RISC-V: Avoid unnecessary slideup in compress pattern of vec_perm
  2023-09-10 15:25 ` Jeff Law
@ 2023-09-10 23:01   ` Li, Pan2
  0 siblings, 0 replies; 4+ messages in thread
From: Li, Pan2 @ 2023-09-10 23:01 UTC (permalink / raw)
  To: Jeff Law, Juzhe-Zhong, gcc-patches; +Cc: kito.cheng, kito.cheng

Committed, thanks Jeff.

Pan

-----Original Message-----
From: Gcc-patches <gcc-patches-bounces+pan2.li=intel.com@gcc.gnu.org> On Behalf Of Jeff Law via Gcc-patches
Sent: Sunday, September 10, 2023 11:25 PM
To: Juzhe-Zhong <juzhe.zhong@rivai.ai>; gcc-patches@gcc.gnu.org
Cc: kito.cheng@sifive.com; kito.cheng@gmail.com
Subject: Re: [PATCH V2] RISC-V: Avoid unnecessary slideup in compress pattern of vec_perm



On 9/10/23 08:07, Juzhe-Zhong wrote:
> gcc/ChangeLog:
> 
> 	* config/riscv/riscv-v.cc (shuffle_compress_patterns): Avoid unnecessary slideup.
OK
jeff

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

end of thread, other threads:[~2023-09-10 23:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-10 14:07 [PATCH V2] RISC-V: Avoid unnecessary slideup in compress pattern of vec_perm Juzhe-Zhong
2023-09-10 14:07 ` 钟居哲
2023-09-10 15:25 ` Jeff Law
2023-09-10 23:01   ` Li, Pan2

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