https://gcc.gnu.org/g:fe236f5bef799694f693f4eb004634738cb1c059

commit r17-4742-gfe236f5bef799694f693f4eb004634738cb1c059
Author: linden <[email protected]>
Date:   Sat Sep 26 18:41:54 2026 +1200

    ipa-cp: take widest_int parameters by const reference
    
    widest_int is a large inline-buffer type, and
    ipcp_bits_lattice::set_to_constant, meet_with and meet_with_1 only read
    these parameters.  Take them by const reference instead of copying;
    no functional change.
    
    gcc/ChangeLog:
            * ipa-cp.h (ipcp_bits_lattice::set_to_constant)
            (ipcp_bits_lattice::meet_with, ipcp_bits_lattice::meet_with_1):
            Take widest_int parameters by const reference.
            * ipa-cp.cc (ipcp_bits_lattice::set_to_constant)
            (ipcp_bits_lattice::meet_with, ipcp_bits_lattice::meet_with_1):
            Likewise.
    
    Signed-off-by: linden <[email protected]>

Diff:
---
 gcc/ipa-cp.cc | 9 ++++++---
 gcc/ipa-cp.h  | 6 +++---
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc
index d0428d04684e..574b109bad52 100644
--- a/gcc/ipa-cp.cc
+++ b/gcc/ipa-cp.cc
@@ -928,7 +928,8 @@ ipcp_bits_lattice::set_to_bottom ()
    when switching state from TOP.  */
 
 bool
-ipcp_bits_lattice::set_to_constant (widest_int value, widest_int mask)
+ipcp_bits_lattice::set_to_constant (const widest_int &value,
+                                   const widest_int &mask)
 {
   gcc_assert (top_p ());
   m_lattice_val = IPA_BITS_CONSTANT;
@@ -985,7 +986,8 @@ ipcp_bits_lattice::get_value_and_mask (tree operand, 
widest_int *valuep, widest_
    DROP_ALL_ONES, mask out any known bits with value one afterwards.  */
 
 bool
-ipcp_bits_lattice::meet_with_1 (widest_int value, widest_int mask,
+ipcp_bits_lattice::meet_with_1 (const widest_int &value,
+                               const widest_int &mask,
                                unsigned precision, bool drop_all_ones)
 {
   gcc_assert (constant_p ());
@@ -1008,7 +1010,8 @@ ipcp_bits_lattice::meet_with_1 (widest_int value, 
widest_int mask,
    described by <value, mask, sgn, precision.  */
 
 bool
-ipcp_bits_lattice::meet_with (widest_int value, widest_int mask,
+ipcp_bits_lattice::meet_with (const widest_int &value,
+                             const widest_int &mask,
                              unsigned precision)
 {
   if (bottom_p ())
diff --git a/gcc/ipa-cp.h b/gcc/ipa-cp.h
index af1fe8f1e75f..c22a74bb23f6 100644
--- a/gcc/ipa-cp.h
+++ b/gcc/ipa-cp.h
@@ -199,7 +199,7 @@ public:
   bool top_p () const { return m_lattice_val == IPA_BITS_UNDEFINED; }
   bool constant_p () const { return m_lattice_val == IPA_BITS_CONSTANT; }
   bool set_to_bottom ();
-  bool set_to_constant (widest_int, widest_int);
+  bool set_to_constant (const widest_int &, const widest_int &);
   bool known_nonzero_p () const;
   bool set_recipient_only ();
   bool recipient_only_p () const {return m_recipient_only; }
@@ -210,7 +210,7 @@ public:
   bool meet_with (ipcp_bits_lattice& other, unsigned, signop,
                  enum tree_code, tree, bool);
 
-  bool meet_with (widest_int, widest_int, unsigned);
+  bool meet_with (const widest_int &, const widest_int &, unsigned);
 
   void print (FILE *);
 
@@ -228,7 +228,7 @@ private:
      value is known to be constant.  */
   widest_int m_value, m_mask;
 
-  bool meet_with_1 (widest_int, widest_int, unsigned, bool);
+  bool meet_with_1 (const widest_int &, const widest_int &, unsigned, bool);
   void get_value_and_mask (tree, widest_int *, widest_int *);
 };

Reply via email to