diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2018-08-01 15:03:01 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2018-08-01 15:03:01 +0000 |
commit | cd3ca9102eba6eae8944329cd72b74ff460e7b3b (patch) | |
tree | 917504501ffa1f0fd294f1546c81c4595a11e5a0 /gcc/tree-vrp.h | |
parent | 211cd1e2358d52d3863f727b650c65650dd5ce89 (diff) | |
download | gcc-cd3ca9102eba6eae8944329cd72b74ff460e7b3b.zip gcc-cd3ca9102eba6eae8944329cd72b74ff460e7b3b.tar.gz gcc-cd3ca9102eba6eae8944329cd72b74ff460e7b3b.tar.bz2 |
tree-vrp (zero_nonzero_bits_from_bounds): Rename to...
* tree-vrp (zero_nonzero_bits_from_bounds): Rename to...
(wide_int_set_zero_nonzero_bits): ...this.
(zero_nonzero_bits_from_vr): Rename to...
(vrp_set_zero_nonzero_bits): ...this.
(extract_range_from_multiplicative_op_1): Abstract wide int
code...
(wide_int_range_multiplicative_op): ...here.
(extract_range_from_binary_expr_1): Extract wide int binary
operations into their own functions.
(wide_int_range_lshift): New.
(wide_int_range_can_optimize_bit_op): New.
(wide_int_range_shift_undefined_p): New.
(wide_int_range_bit_xor): New.
(wide_int_range_bit_ior): New.
(wide_int_range_bit_and): New.
(wide_int_range_trunc_mod): New.
(extract_range_into_wide_ints): New.
(vrp_shift_undefined_p): New.
(extract_range_from_multiplicative_op): New.
(vrp_can_optimize_bit_op): New.
* tree-vrp.h (value_range::dump): New.
(wide_int_range_multiplicative_op): New.
(wide_int_range_lshift):New.
(wide_int_range_shift_undefined_p): New.
(wide_int_range_bit_xor): New.
(wide_int_range_bit_ior): New.
(wide_int_range_bit_and): New.
(wide_int_range_trunc_mod): New.
(zero_nonzero_bits_from_bounds): Rename to...
(wide_int_set_zero_nonzero_bits): ...this.
(zero_nonzero_bits_from_vr): Rename to...
(vrp_set_zero_nonzero_bits): ...this.
(range_easy_mask_min_max): Rename to...
(wide_int_range_can_optimize_bit_op): this.
From-SVN: r263218
Diffstat (limited to 'gcc/tree-vrp.h')
-rw-r--r-- | gcc/tree-vrp.h | 75 |
1 files changed, 68 insertions, 7 deletions
diff --git a/gcc/tree-vrp.h b/gcc/tree-vrp.h index daf12ce..8cac7da 100644 --- a/gcc/tree-vrp.h +++ b/gcc/tree-vrp.h @@ -49,6 +49,9 @@ struct GTY((for_user)) value_range /* Set of SSA names whose value ranges are equivalent to this one. This set is only valid when TYPE is VR_RANGE or VR_ANTI_RANGE. */ bitmap equiv; + + /* Dump value range to stderr. */ + void dump (); }; extern void vrp_intersect_ranges (value_range *vr0, value_range *vr1); @@ -115,6 +118,70 @@ extern bool wide_int_range_mult_wrapping (wide_int &res_lb, const wide_int &max0_, const wide_int &min1_, const wide_int &max1_); +extern bool wide_int_range_multiplicative_op (wide_int &res_lb, + wide_int &res_ub, + enum tree_code code, + signop sign, + unsigned prec, + const wide_int &vr0_lb, + const wide_int &vr0_ub, + const wide_int &vr1_lb, + const wide_int &vr1_ub, + bool overflow_undefined, + bool overflow_wraps); +extern bool wide_int_range_lshift (wide_int &res_lb, wide_int &res_ub, + signop sign, unsigned prec, + const wide_int &, const wide_int &, + const wide_int &, const wide_int &, + bool overflow_undefined, + bool overflow_wraps); +extern bool wide_int_range_shift_undefined_p (signop sign, unsigned prec, + const wide_int &min, + const wide_int &max); +extern void wide_int_set_zero_nonzero_bits (signop, + const wide_int &lb, + const wide_int &ub, + wide_int &may_be_nonzero, + wide_int &must_be_nonzero); +extern bool wide_int_range_can_optimize_bit_op (tree_code, + const wide_int &lb, + const wide_int &ub, + const wide_int &mask); +extern bool wide_int_range_bit_xor (wide_int &wmin, wide_int &wmax, + signop sign, + unsigned prec, + const wide_int &must_be_nonzero0, + const wide_int &may_be_nonzero0, + const wide_int &must_be_nonzero1, + const wide_int &may_be_nonzero1); +extern bool wide_int_range_bit_ior (wide_int &wmin, wide_int &wmax, + signop sign, + const wide_int &vr0_min, + const wide_int &vr0_max, + const wide_int &vr1_min, + const wide_int &vr1_max, + const wide_int &must_be_nonzero0, + const wide_int &may_be_nonzero0, + const wide_int &must_be_nonzero1, + const wide_int &may_be_nonzero1); +extern bool wide_int_range_bit_and (wide_int &wmin, wide_int &wmax, + signop sign, + unsigned prec, + const wide_int &vr0_min, + const wide_int &vr0_max, + const wide_int &vr1_min, + const wide_int &vr1_max, + const wide_int &must_be_nonzero0, + const wide_int &may_be_nonzero0, + const wide_int &must_be_nonzero1, + const wide_int &may_be_nonzero1); +extern void wide_int_range_trunc_mod (wide_int &wmin, wide_int &wmax, + signop sign, + unsigned prec, + const wide_int &vr0_min, + const wide_int &vr0_max, + const wide_int &vr1_min, + const wide_int &vr1_max); extern void extract_range_from_binary_expr_1 (value_range *, enum tree_code, tree, value_range *, value_range *); @@ -125,14 +192,8 @@ extern bool range_int_cst_p (value_range *); extern int operand_less_p (tree, tree); extern bool find_case_label_range (gswitch *, tree, tree, size_t *, size_t *); extern bool find_case_label_index (gswitch *, size_t, tree, size_t *); -extern void zero_nonzero_bits_from_bounds (signop, const wide_int&, - const wide_int&, wide_int *, - wide_int *); -extern bool zero_nonzero_bits_from_vr (const tree, value_range *, +extern bool vrp_set_zero_nonzero_bits (const tree, value_range *, wide_int *, wide_int *); -extern bool range_easy_mask_min_max (tree_code, - const wide_int &lb, const wide_int &ub, - const wide_int &mask); extern bool overflow_comparison_p (tree_code, tree, tree, bool, tree *); extern bool range_int_cst_singleton_p (value_range *); extern int value_inside_range (tree, tree, tree); |