public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Minor fix for max_point
@ 2024-04-02  8:34 demin.han
  2024-04-02  8:36 ` juzhe.zhong
  0 siblings, 1 reply; 2+ messages in thread
From: demin.han @ 2024-04-02  8:34 UTC (permalink / raw)
  To: gcc-patches; +Cc: juzhe.zhong, kito.cheng, pan2.li, jeffreyalaw, rdapp.gcc

The program points start from 1, so max_point should be equal to
length().

Tested on RV64 and no regression.

gcc/ChangeLog:

	* config/riscv/riscv-vector-costs.cc: Use length()

Signed-off-by: demin.han <demin.han@starfivetech.com>
---
 gcc/config/riscv/riscv-vector-costs.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/riscv/riscv-vector-costs.cc b/gcc/config/riscv/riscv-vector-costs.cc
index 484196b15b4..9f7fe936a29 100644
--- a/gcc/config/riscv/riscv-vector-costs.cc
+++ b/gcc/config/riscv/riscv-vector-costs.cc
@@ -759,7 +759,7 @@ update_local_live_ranges (
 
 		We will be likely using one more vector variable.  */
 	      unsigned int max_point
-		= (*program_points_per_bb.get (bb)).length () - 1;
+		= (*program_points_per_bb.get (bb)).length ();
 	      auto *live_ranges = live_ranges_per_bb.get (bb);
 	      bool existed_p = false;
 	      tree var = type == load_vec_info_type
-- 
2.44.0


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

* Re: [PATCH] RISC-V: Minor fix for max_point
  2024-04-02  8:34 [PATCH] RISC-V: Minor fix for max_point demin.han
@ 2024-04-02  8:36 ` juzhe.zhong
  0 siblings, 0 replies; 2+ messages in thread
From: juzhe.zhong @ 2024-04-02  8:36 UTC (permalink / raw)
  To: demin.han, gcc-patches; +Cc: kito.cheng, pan2.li, jeffreyalaw, Robin Dapp

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

It's obvious fix to previous incorrect typo.
So LGTM to trunk (GCC-14).

Thanks.


juzhe.zhong@rivai.ai
 
From: demin.han
Date: 2024-04-02 16:34
To: gcc-patches
CC: juzhe.zhong; kito.cheng; pan2.li; jeffreyalaw; rdapp.gcc
Subject: [PATCH] RISC-V: Minor fix for max_point
The program points start from 1, so max_point should be equal to
length().
 
Tested on RV64 and no regression.
 
gcc/ChangeLog:
 
* config/riscv/riscv-vector-costs.cc: Use length()
 
Signed-off-by: demin.han <demin.han@starfivetech.com>
---
gcc/config/riscv/riscv-vector-costs.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
 
diff --git a/gcc/config/riscv/riscv-vector-costs.cc b/gcc/config/riscv/riscv-vector-costs.cc
index 484196b15b4..9f7fe936a29 100644
--- a/gcc/config/riscv/riscv-vector-costs.cc
+++ b/gcc/config/riscv/riscv-vector-costs.cc
@@ -759,7 +759,7 @@ update_local_live_ranges (
We will be likely using one more vector variable.  */
      unsigned int max_point
- = (*program_points_per_bb.get (bb)).length () - 1;
+ = (*program_points_per_bb.get (bb)).length ();
      auto *live_ranges = live_ranges_per_bb.get (bb);
      bool existed_p = false;
      tree var = type == load_vec_info_type
-- 
2.44.0
 
 

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

end of thread, other threads:[~2024-04-02  8:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-02  8:34 [PATCH] RISC-V: Minor fix for max_point demin.han
2024-04-02  8:36 ` juzhe.zhong

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