diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2018-09-04 11:58:14 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2018-09-04 11:58:14 +0000 |
commit | e20d979b7ada10b4665b0c97494ebeb1542ca047 (patch) | |
tree | 3be8845280bfbb517dc9181b72b69a9121603092 /gcc/tree-vrp.c | |
parent | c2c51a3e358294b5ddfa522fa4d973c3360699b4 (diff) | |
download | gcc-e20d979b7ada10b4665b0c97494ebeb1542ca047.zip gcc-e20d979b7ada10b4665b0c97494ebeb1542ca047.tar.gz gcc-e20d979b7ada10b4665b0c97494ebeb1542ca047.tar.bz2 |
tree-vrp.c (vrp_can_optimize_bit_op): Remove.
* tree-vrp.c (vrp_can_optimize_bit_op): Remove.
(extract_range_from_binary_expr_1): Do not call
vrp_can_optimize_bit_op.
* wide-int-range.cc (wide_int_range_can_optimize_bit_op): Make
static.
(wide_int_range_get_mask_and_bounds): New.
(wide_int_range_optimize_bit_op): New.
(wide_int_range_bit_ior): Call wide_int_range_optimize_bit_op.
(wide_int_range_bit_and): Same.
* wide-int-range.h (wide_int_range_can_optimize_bit_op): Remove.
(wide_int_range_optimize_bit_op): New.
(wide_int_range_get_mask_and_bounds): New.
From-SVN: r264078
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index c1774dc..d29a2c9 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -1067,49 +1067,6 @@ extract_range_from_multiplicative_op (value_range *vr, set_value_range_to_varying (vr); } -/* Value range wrapper for wide_int_range_can_optimize_bit_op. - - If a bit operation on two ranges can be easily optimized in terms - of a mask, store the optimized new range in VR and return TRUE. */ - -static bool -vrp_can_optimize_bit_op (value_range *vr, enum tree_code code, - const value_range *vr0, const value_range *vr1) -{ - tree lower_bound, upper_bound, mask; - if (code != BIT_AND_EXPR && code != BIT_IOR_EXPR) - return false; - if (range_int_cst_singleton_p (vr1)) - { - if (!range_int_cst_p (vr0)) - return false; - mask = vr1->min; - lower_bound = vr0->min; - upper_bound = vr0->max; - } - else if (range_int_cst_singleton_p (vr0)) - { - if (!range_int_cst_p (vr1)) - return false; - mask = vr0->min; - lower_bound = vr1->min; - upper_bound = vr1->max; - } - else - return false; - if (wide_int_range_can_optimize_bit_op (code, - wi::to_wide (lower_bound), - wi::to_wide (upper_bound), - wi::to_wide (mask))) - { - tree min = int_const_binop (code, lower_bound, mask); - tree max = int_const_binop (code, upper_bound, mask); - set_value_range (vr, VR_RANGE, min, max, NULL); - return true; - } - return false; -} - /* If BOUND will include a symbolic bound, adjust it accordingly, otherwise leave it as is. @@ -1704,9 +1661,6 @@ extract_range_from_binary_expr_1 (value_range *vr, } else if (code == BIT_AND_EXPR || code == BIT_IOR_EXPR || code == BIT_XOR_EXPR) { - if (vrp_can_optimize_bit_op (vr, code, &vr0, &vr1)) - return; - wide_int may_be_nonzero0, may_be_nonzero1; wide_int must_be_nonzero0, must_be_nonzero1; wide_int wmin, wmax; |