Return non-legacy ranges in range.h.
authorAldy Hernandez <aldyh@redhat.com>
Mon, 10 Oct 2022 11:43:56 +0000 (13:43 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 10 Oct 2022 12:50:16 +0000 (14:50 +0200)
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

index 5c70c66..8138d6f 100644 (file)
@@ -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