public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] Return non-legacy ranges in range.h.
@ 2022-10-10 12:49 Aldy Hernandez
  2022-10-10 12:49 ` [COMMITTED] x UNORD x should set NAN on the TRUE side (and !NAN on the FALSE side) Aldy Hernandez
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Aldy Hernandez @ 2022-10-10 12:49 UTC (permalink / raw)
  To: GCC patches; +Cc: Andrew MacLeod, Aldy Hernandez

int_range<1> is a legacy range (think anti ranges, legacy VRP, etc).
There is a penalty for converting anything built with <1> to
non-legacy.  Since most of the uses of these functions are now ranger,
we can save a miniscule amount of time by converting them to
non-legacy.

gcc/ChangeLog:

	* range.h (range_true): Return int_range<2>.
	(range_false): Same.
	(range_true_and_false): Same.
---
 gcc/range.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/range.h b/gcc/range.h
index 5c70c66566c..8138d6f5515 100644
--- a/gcc/range.h
+++ b/gcc/range.h
@@ -32,7 +32,7 @@ static inline int_range<1>
 range_true (tree type)
 {
   unsigned prec = TYPE_PRECISION (type);
-  return int_range<1> (type, wi::one (prec), wi::one (prec));
+  return int_range<2> (type, wi::one (prec), wi::one (prec));
 }
 
 // Return an irange instance that is a boolean FALSE.
@@ -41,7 +41,7 @@ static inline int_range<1>
 range_false (tree type)
 {
   unsigned prec = TYPE_PRECISION (type);
-  return int_range<1> (type, wi::zero (prec), wi::zero (prec));
+  return int_range<2> (type, wi::zero (prec), wi::zero (prec));
 }
 
 // Return an irange that covers both true and false.
@@ -50,7 +50,7 @@ static inline int_range<1>
 range_true_and_false (tree type)
 {
   unsigned prec = TYPE_PRECISION (type);
-  return int_range<1> (type, wi::zero (prec), wi::one (prec));
+  return int_range<2> (type, wi::zero (prec), wi::one (prec));
 }
 
 #endif // GCC_RANGE_H
-- 
2.37.3


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

end of thread, other threads:[~2022-10-10 12:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-10 12:49 [COMMITTED] Return non-legacy ranges in range.h Aldy Hernandez
2022-10-10 12:49 ` [COMMITTED] x UNORD x should set NAN on the TRUE side (and !NAN on the FALSE side) Aldy Hernandez
2022-10-10 12:49 ` [COMMITTED] The true side of x != x should set NAN Aldy Hernandez
2022-10-10 12:49 ` [COMMITTED] Add frange::maybe_isnan (bool sign) Aldy Hernandez
2022-10-10 12:49 ` [COMMITTED] Make range-op-float entries public 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).