public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Return const ref. for vl_vtype_info::get_avl_info
@ 2022-12-27 15:21 Kito Cheng
       [not found] ` <3E2DED7476121779+0309AD11-81CD-4256-9258-C93ED4FFB402@rivai.ai>
  0 siblings, 1 reply; 2+ messages in thread
From: Kito Cheng @ 2022-12-27 15:21 UTC (permalink / raw)
  To: gcc-patches, kito.cheng, jim.wilson.gcc, palmer, andrew,
	juzhe.zhong, jeffreyalaw
  Cc: Kito Cheng

Return const reference could prevent unnecessary copying.

gcc/

	* config/riscv/riscv-vsetvl.h (vl_vtype_info::get_avl_info):
	Return const reference rather than value.
---
 gcc/config/riscv/riscv-vsetvl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/riscv/riscv-vsetvl.h b/gcc/config/riscv/riscv-vsetvl.h
index 6f27004fab1..a5d3f256412 100644
--- a/gcc/config/riscv/riscv-vsetvl.h
+++ b/gcc/config/riscv/riscv-vsetvl.h
@@ -173,7 +173,7 @@ public:
   bool has_non_zero_avl () const;
 
   rtx get_avl () const { return m_avl.get_value (); }
-  avl_info get_avl_info () const { return m_avl; }
+  const avl_info &get_avl_info () const { return m_avl; }
   void set_avl_info (const avl_info &avl) { m_avl = avl; }
   uint8_t get_sew () const { return m_sew; }
   riscv_vector::vlmul_type get_vlmul () const { return m_vlmul; }
-- 
2.37.2


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

* Re: [PATCH] RISC-V: Return const ref. for vl_vtype_info: get_avl_info
       [not found] ` <3E2DED7476121779+0309AD11-81CD-4256-9258-C93ED4FFB402@rivai.ai>
@ 2022-12-28  1:36   ` Kito Cheng
  0 siblings, 0 replies; 2+ messages in thread
From: Kito Cheng @ 2022-12-28  1:36 UTC (permalink / raw)
  To: juzhe.zhong
  Cc: gcc-patches, kito.cheng, jim.wilson.gcc, palmer, andrew, jeffreyalaw

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

committed, thanks :)

On Wed, Dec 28, 2022 at 7:05 AM juzhe.zhong <juzhe.zhong@rivai.ai> wrote:

> LGTM.
> ---- Replied Message ----
> From Kito Cheng<kito.cheng@sifive.com> <kito.cheng@sifive.com>
> Date 12/27/2022 23:21
> To gcc-patches@gcc.gnu.org<gcc-patches@gcc.gnu.org>
> <gcc-patches@gcc.gnu.org>,
> kito.cheng@gmail.com<kito.cheng@gmail.com> <kito.cheng@gmail.com>,
> jim.wilson.gcc@gmail.com<jim.wilson.gcc@gmail.com>
> <jim.wilson.gcc@gmail.com>,
> palmer@dabbelt.com<palmer@dabbelt.com> <palmer@dabbelt.com>,
> andrew@sifive.com<andrew@sifive.com> <andrew@sifive.com>,
> juzhe.zhong@rivai.ai<juzhe.zhong@rivai.ai> <juzhe.zhong@rivai.ai>,
> jeffreyalaw@gmail.com<jeffreyalaw@gmail.com> <jeffreyalaw@gmail.com>
> Cc Kito Cheng<kito.cheng@sifive.com> <kito.cheng@sifive.com>
> Subject [PATCH] RISC-V: Return const ref. for vl_vtype_info::get_avl_info
>

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

end of thread, other threads:[~2022-12-28  1:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-27 15:21 [PATCH] RISC-V: Return const ref. for vl_vtype_info::get_avl_info Kito Cheng
     [not found] ` <3E2DED7476121779+0309AD11-81CD-4256-9258-C93ED4FFB402@rivai.ai>
2022-12-28  1:36   ` [PATCH] RISC-V: Return const ref. for vl_vtype_info: get_avl_info Kito Cheng

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