RISC-V: Return const ref. for vl_vtype_info::get_avl_info
authorKito Cheng <kito.cheng@sifive.com>
Tue, 27 Dec 2022 15:18:26 +0000 (23:18 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Wed, 28 Dec 2022 01:35:28 +0000 (09:35 +0800)
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

index 6f27004..a5d3f25 100644 (file)
@@ -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; }