public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Enable VECT_COMPARE_COSTS by default
@ 2023-08-31 23:10 Juzhe-Zhong
  2023-09-01  9:57 ` Robin Dapp
  0 siblings, 1 reply; 3+ messages in thread
From: Juzhe-Zhong @ 2023-08-31 23:10 UTC (permalink / raw)
  To: gcc-patches; +Cc: kito.cheng, kito.cheng, jeffreyalaw, rdapp.gcc, Juzhe-Zhong

since we have added COST framework, we by default enable VECT_COMPARE_COSTS.

Also, add 16/32/64 to provide more choices for COST comparison.

This patch doesn't change any behavior from the current testsuite since we are using
default COST model.

gcc/ChangeLog:

	* config/riscv/riscv-v.cc (autovectorize_vector_modes): Enable VECT_COMPARE_COSTS by default.

---
 gcc/config/riscv/riscv-v.cc | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc
index 6228ff3d92e..c8ad96f44d5 100644
--- a/gcc/config/riscv/riscv-v.cc
+++ b/gcc/config/riscv/riscv-v.cc
@@ -2173,7 +2173,7 @@ autovectorize_vector_modes (vector_modes *modes, bool)
 	   full vectors for wider elements.
 	 - full_size / 8:
 	   Try using 64-bit containers for all element types.  */
-      static const int rvv_factors[] = {1, 2, 4, 8};
+      static const int rvv_factors[] = {1, 2, 4, 8, 16, 32, 64};
       for (unsigned int i = 0; i < sizeof (rvv_factors) / sizeof (int); i++)
 	{
 	  poly_uint64 units;
@@ -2183,12 +2183,8 @@ autovectorize_vector_modes (vector_modes *modes, bool)
 	    modes->safe_push (mode);
 	}
     }
-  unsigned int flag = 0;
   if (TARGET_VECTOR_VLS)
     {
-      /* Enable VECT_COMPARE_COSTS between VLA modes VLS modes for scalable
-	 auto-vectorization.  */
-      flag |= VECT_COMPARE_COSTS;
       /* Push all VLSmodes according to TARGET_MIN_VLEN.  */
       unsigned int i = 0;
       unsigned int base_size = TARGET_MIN_VLEN * riscv_autovec_lmul / 8;
@@ -2201,7 +2197,8 @@ autovectorize_vector_modes (vector_modes *modes, bool)
 	  size = base_size / (1U << i);
 	}
     }
-  return flag;
+  /* Enable LOOP_VINFO comparison in COST model.  */
+  return VECT_COMPARE_COSTS;
 }
 
 /* If the given VECTOR_MODE is an RVV mode,  first get the largest number
-- 
2.36.3


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

* Re: [PATCH] RISC-V: Enable VECT_COMPARE_COSTS by default
  2023-08-31 23:10 [PATCH] RISC-V: Enable VECT_COMPARE_COSTS by default Juzhe-Zhong
@ 2023-09-01  9:57 ` Robin Dapp
  2023-09-01 11:01   ` Li, Pan2
  0 siblings, 1 reply; 3+ messages in thread
From: Robin Dapp @ 2023-09-01  9:57 UTC (permalink / raw)
  To: Juzhe-Zhong, gcc-patches; +Cc: rdapp.gcc, kito.cheng, kito.cheng, jeffreyalaw

Hi Juzhe,

thanks, this is OK, we would have needed this sooner or later anyway.

Regards
 Robin


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

* RE: [PATCH] RISC-V: Enable VECT_COMPARE_COSTS by default
  2023-09-01  9:57 ` Robin Dapp
@ 2023-09-01 11:01   ` Li, Pan2
  0 siblings, 0 replies; 3+ messages in thread
From: Li, Pan2 @ 2023-09-01 11:01 UTC (permalink / raw)
  To: Robin Dapp, Juzhe-Zhong, gcc-patches; +Cc: kito.cheng, kito.cheng

Committed, thank Robin.

Pan

-----Original Message-----
From: Gcc-patches <gcc-patches-bounces+pan2.li=intel.com@gcc.gnu.org> On Behalf Of Robin Dapp via Gcc-patches
Sent: Friday, September 1, 2023 5:58 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] RISC-V: Enable VECT_COMPARE_COSTS by default

Hi Juzhe,

thanks, this is OK, we would have needed this sooner or later anyway.

Regards
 Robin


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

end of thread, other threads:[~2023-09-01 11:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-31 23:10 [PATCH] RISC-V: Enable VECT_COMPARE_COSTS by default Juzhe-Zhong
2023-09-01  9:57 ` Robin Dapp
2023-09-01 11: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).