public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Committed] RISC-V: Declare STMT_VINFO_TYPE (...) as local variable
@ 2024-01-02  1:52 Juzhe-Zhong
  0 siblings, 0 replies; only message in thread
From: Juzhe-Zhong @ 2024-01-02  1:52 UTC (permalink / raw)
  To: gcc-patches; +Cc: Juzhe-Zhong

Committed.

gcc/ChangeLog:

	* config/riscv/riscv-vector-costs.cc: Move STMT_VINFO_TYPE (...) to local.

---
 gcc/config/riscv/riscv-vector-costs.cc | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gcc/config/riscv/riscv-vector-costs.cc b/gcc/config/riscv/riscv-vector-costs.cc
index b41a79429d4..1199b3af067 100644
--- a/gcc/config/riscv/riscv-vector-costs.cc
+++ b/gcc/config/riscv/riscv-vector-costs.cc
@@ -279,10 +279,11 @@ compute_local_live_ranges (
 	      gimple *stmt = program_point.stmt;
 	      stmt_vec_info stmt_info = program_point.stmt_info;
 	      tree lhs = gimple_get_lhs (stmt);
+	      enum stmt_vec_info_type type
+		= STMT_VINFO_TYPE (vect_stmt_to_vectorize (stmt_info));
 	      if (lhs != NULL_TREE && is_gimple_reg (lhs)
 		  && (!POINTER_TYPE_P (TREE_TYPE (lhs))
-		      || STMT_VINFO_TYPE (vect_stmt_to_vectorize (stmt_info))
-			   != store_vec_info_type))
+		      || type != store_vec_info_type))
 		{
 		  biggest_mode = get_biggest_mode (biggest_mode,
 						   TYPE_MODE (TREE_TYPE (lhs)));
@@ -309,9 +310,7 @@ compute_local_live_ranges (
 		  if (poly_int_tree_p (var)
 		      || (is_gimple_val (var)
 			  && (!POINTER_TYPE_P (TREE_TYPE (var))
-			      || STMT_VINFO_TYPE (
-				   vect_stmt_to_vectorize (stmt_info))
-				   != load_vec_info_type)))
+			      || type != load_vec_info_type)))
 		    {
 		      biggest_mode
 			= get_biggest_mode (biggest_mode,
-- 
2.36.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-02  1:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-02  1:52 [Committed] RISC-V: Declare STMT_VINFO_TYPE (...) as local variable 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).