]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Simplify range-op shift mask generation
authorRichard Biener <rguenther@suse.de>
Tue, 24 Sep 2024 12:23:40 +0000 (14:23 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 24 Sep 2024 13:21:11 +0000 (15:21 +0200)
The following reduces the number of wide_ints built which show up
in the profile for PR114855 as the largest remaining bit at -O1.

* range-op.cc (operator_rshift::op1_range): Use wi::mask instead
of shift and not.

gcc/range-op.cc

index c576f6882219dc025b4954b0e9ecdda9128e69c6..3f5cf08344021e852a540b3fca6bdeb4d7059c61 100644 (file)
@@ -2863,7 +2863,7 @@ operator_rshift::op1_range (irange &r,
       // OP1 is anything from 0011 1000 to 0011 1111.  That is, a
       // range from LHS<<3 plus a mask of the 3 bits we shifted on the
       // right hand side (0x07).
-      wide_int mask = wi::bit_not (wi::lshift (wi::minus_one (prec), shift));
+      wide_int mask = wi::mask (shift.to_uhwi (), false, prec);
       int_range_max mask_range (type,
                                wi::zero (TYPE_PRECISION (type)),
                                mask);