public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-379] Inline irange::set_nonzero.
@ 2023-05-01  6:34 Aldy Hernandez
  0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2023-05-01  6:34 UTC (permalink / raw)
  To: gcc-cvs

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

commit r14-379-gbd0ac4b275daa91100fb22711f7f74637b382e29
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Sat Mar 4 12:35:07 2023 +0100

    Inline irange::set_nonzero.
    
    irange::set_nonzero is used everywhere and benefits immensely from
    inlining.
    
    gcc/ChangeLog:
    
            * value-range.h (irange::set_nonzero): Inline.

Diff:
---
 gcc/value-range.h | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/gcc/value-range.h b/gcc/value-range.h
index 9a834c91b17..5cff50e6d03 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -886,8 +886,24 @@ irange::upper_bound () const
 inline void
 irange::set_nonzero (tree type)
 {
-  wide_int zero = wi::zero (TYPE_PRECISION (type));
-  set (type, zero, zero, VR_ANTI_RANGE);
+  unsigned prec = TYPE_PRECISION (type);
+
+  if (TYPE_UNSIGNED (type))
+    {
+      m_type = type;
+      m_kind = VR_RANGE;
+      m_base[0] = wi::one (prec);
+      m_base[1] = m_nonzero_mask = wi::minus_one (prec);
+      m_num_ranges = 1;
+
+      if (flag_checking)
+	verify_range ();
+    }
+  else
+    {
+      wide_int zero = wi::zero (prec);
+      set (type, zero, zero, VR_ANTI_RANGE);
+    }
 }
 
 // Set value range VR to a ZERO range of type TYPE.

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

only message in thread, other threads:[~2023-05-01  6:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-01  6:34 [gcc r14-379] Inline irange::set_nonzero Aldy Hernandez

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