Remove some uses of deprecated irange API.
gcc/ChangeLog: * builtins.cc (expand_builtin_strnlen): Rewrite deprecated irange API uses to new API. * gimple-predicate-analysis.cc (find_var_cmp_const): Same. * internal-fn.cc (get_min_precision): Same. * match.pd: Same. * tree-affine.cc (expr_to_aff_combination): Same. * tree-data-ref.cc (dr_step_indicator): Same. * tree-dfa.cc (get_ref_base_and_extent): Same. * tree-scalar-evolution.cc (iv_can_overflow_p): Same. * tree-ssa-phiopt.cc (two_value_replacement): Same. * tree-ssa-pre.cc (insert_into_preds_of_block): Same. * tree-ssa-reassoc.cc (optimize_range_tests_to_bit_test): Same. * tree-ssa-strlen.cc (compare_nonzero_chars): Same. * tree-switch-conversion.cc (bit_test_cluster::emit): Same. * tree-vect-patterns.cc (vect_recog_divmod_pattern): Same. * tree.cc (get_range_pos_neg): Same.
This commit is contained in:
parent
1a8087c7d1
commit
637037f4e6
15 changed files with 39 additions and 37 deletions
|
@ -3494,7 +3494,7 @@ expand_builtin_strnlen (tree exp, rtx target, machine_mode target_mode)
|
|||
wide_int min, max;
|
||||
value_range r;
|
||||
get_global_range_query ()->range_of_expr (r, bound);
|
||||
if (r.kind () != VR_RANGE)
|
||||
if (r.varying_p () || r.undefined_p ())
|
||||
return NULL_RTX;
|
||||
min = r.lower_bound ();
|
||||
max = r.upper_bound ();
|
||||
|
|
|
@ -307,7 +307,8 @@ find_var_cmp_const (pred_chain_union preds, gphi *phi, gimple **flag_def,
|
|||
value_range r;
|
||||
if (!INTEGRAL_TYPE_P (type)
|
||||
|| !get_range_query (cfun)->range_of_expr (r, cond_rhs)
|
||||
|| r.kind () != VR_RANGE)
|
||||
|| r.undefined_p ()
|
||||
|| r.varying_p ())
|
||||
continue;
|
||||
|
||||
wide_int min = r.lower_bound ();
|
||||
|
|
|
@ -775,7 +775,8 @@ get_min_precision (tree arg, signop sign)
|
|||
return prec + (orig_sign != sign);
|
||||
value_range r;
|
||||
while (!get_global_range_query ()->range_of_expr (r, arg)
|
||||
|| r.kind () != VR_RANGE)
|
||||
|| r.varying_p ()
|
||||
|| r.undefined_p ())
|
||||
{
|
||||
gimple *g = SSA_NAME_DEF_STMT (arg);
|
||||
if (is_gimple_assign (g)
|
||||
|
|
10
gcc/match.pd
10
gcc/match.pd
|
@ -525,7 +525,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
|
|||
value_range vr0;
|
||||
if (ovf1 == wi::OVF_NONE && ovf2 == wi::OVF_NONE
|
||||
&& get_global_range_query ()->range_of_expr (vr0, @4)
|
||||
&& vr0.kind () == VR_RANGE)
|
||||
&& !vr0.varying_p () && !vr0.undefined_p ())
|
||||
{
|
||||
wide_int wmin0 = vr0.lower_bound ();
|
||||
wide_int wmax0 = vr0.upper_bound ();
|
||||
|
@ -566,7 +566,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
|
|||
value_range vr0;
|
||||
if (ovf1 == wi::OVF_NONE && ovf2 == wi::OVF_NONE
|
||||
&& get_global_range_query ()->range_of_expr (vr0, @0)
|
||||
&& vr0.kind () == VR_RANGE)
|
||||
&& !vr0.varying_p () && !vr0.undefined_p ())
|
||||
{
|
||||
wide_int wmin0 = vr0.lower_bound ();
|
||||
wide_int wmax0 = vr0.upper_bound ();
|
||||
|
@ -853,8 +853,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
|
|||
if (INTEGRAL_TYPE_P (type)
|
||||
&& get_global_range_query ()->range_of_expr (vr0, @0)
|
||||
&& get_global_range_query ()->range_of_expr (vr1, @1)
|
||||
&& vr0.kind () == VR_RANGE
|
||||
&& vr1.kind () == VR_RANGE)
|
||||
&& !vr0.varying_p () && !vr0.undefined_p ()
|
||||
&& !vr1.varying_p () && !vr1.undefined_p ())
|
||||
{
|
||||
wide_int wmin0 = vr0.lower_bound ();
|
||||
wide_int wmax0 = vr0.upper_bound ();
|
||||
|
@ -3010,7 +3010,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
|
|||
|
||||
value_range vr;
|
||||
if (get_global_range_query ()->range_of_expr (vr, @0)
|
||||
&& vr.kind () == VR_RANGE)
|
||||
&& !vr.varying_p () && !vr.undefined_p ())
|
||||
{
|
||||
wide_int wmin0 = vr.lower_bound ();
|
||||
wide_int wmax0 = vr.upper_bound ();
|
||||
|
|
|
@ -351,7 +351,8 @@ expr_to_aff_combination (aff_tree *comb, tree_code code, tree type,
|
|||
&& TYPE_OVERFLOW_WRAPS (itype)
|
||||
&& TREE_CODE (op1) == INTEGER_CST
|
||||
&& get_range_query (cfun)->range_of_expr (vr, op0)
|
||||
&& vr.kind () == VR_RANGE)
|
||||
&& !vr.varying_p ()
|
||||
&& !vr.undefined_p ())
|
||||
{
|
||||
wide_int minv = vr.lower_bound ();
|
||||
wide_int maxv = vr.upper_bound ();
|
||||
|
|
|
@ -6351,7 +6351,7 @@ dr_step_indicator (struct data_reference *dr, int useful_min)
|
|||
value_range vr;
|
||||
if (TREE_CODE (step) != SSA_NAME
|
||||
|| !get_range_query (cfun)->range_of_expr (vr, step)
|
||||
|| vr.kind () != VR_RANGE)
|
||||
|| vr.undefined_p ())
|
||||
{
|
||||
step_min = wi::to_wide (TYPE_MIN_VALUE (type));
|
||||
step_max = wi::to_wide (TYPE_MAX_VALUE (type));
|
||||
|
|
|
@ -542,7 +542,8 @@ get_ref_base_and_extent (tree exp, poly_int64_pod *poffset,
|
|||
&& (unit_size = array_ref_element_size (exp),
|
||||
TREE_CODE (unit_size) == INTEGER_CST)
|
||||
&& query->range_of_expr (vr, index)
|
||||
&& vr.kind () == VR_RANGE)
|
||||
&& !vr.varying_p ()
|
||||
&& !vr.undefined_p ())
|
||||
{
|
||||
wide_int min = vr.lower_bound ();
|
||||
wide_int max = vr.upper_bound ();
|
||||
|
|
|
@ -3032,7 +3032,8 @@ iv_can_overflow_p (class loop *loop, tree type, tree base, tree step)
|
|||
|
||||
if (!INTEGRAL_TYPE_P (TREE_TYPE (base))
|
||||
|| !get_range_query (cfun)->range_of_expr (r, base)
|
||||
|| r.kind () != VR_RANGE)
|
||||
|| r.varying_p ()
|
||||
|| r.undefined_p ())
|
||||
return true;
|
||||
|
||||
base_min = r.lower_bound ();
|
||||
|
@ -3040,7 +3041,8 @@ iv_can_overflow_p (class loop *loop, tree type, tree base, tree step)
|
|||
|
||||
if (!INTEGRAL_TYPE_P (TREE_TYPE (step))
|
||||
|| !get_range_query (cfun)->range_of_expr (r, step)
|
||||
|| r.kind () != VR_RANGE)
|
||||
|| r.varying_p ()
|
||||
|| r.undefined_p ())
|
||||
return true;
|
||||
|
||||
step_min = r.lower_bound ();
|
||||
|
|
|
@ -687,22 +687,13 @@ two_value_replacement (basic_block cond_bb, basic_block middle_bb,
|
|||
<= TYPE_PRECISION (TREE_TYPE (lhs)))))
|
||||
return false;
|
||||
|
||||
wide_int min, max;
|
||||
value_range r;
|
||||
get_range_query (cfun)->range_of_expr (r, lhs);
|
||||
if (r.undefined_p ())
|
||||
r.set_varying (TREE_TYPE (lhs));
|
||||
wide_int min = r.lower_bound ();
|
||||
wide_int max = r.upper_bound ();
|
||||
|
||||
if (r.kind () == VR_RANGE)
|
||||
{
|
||||
min = r.lower_bound ();
|
||||
max = r.upper_bound ();
|
||||
}
|
||||
else
|
||||
{
|
||||
int prec = TYPE_PRECISION (TREE_TYPE (lhs));
|
||||
signop sgn = TYPE_SIGN (TREE_TYPE (lhs));
|
||||
min = wi::min_value (prec, sgn);
|
||||
max = wi::max_value (prec, sgn);
|
||||
}
|
||||
if (min + 1 != max
|
||||
|| (wi::to_wide (rhs) != min
|
||||
&& wi::to_wide (rhs) != max))
|
||||
|
|
|
@ -3247,7 +3247,8 @@ insert_into_preds_of_block (basic_block block, unsigned int exprnum,
|
|||
{
|
||||
value_range r;
|
||||
if (get_range_query (cfun)->range_of_expr (r, expr->u.nary->op[0])
|
||||
&& r.kind () == VR_RANGE
|
||||
&& !r.undefined_p ()
|
||||
&& !r.varying_p ()
|
||||
&& !wi::neg_p (r.lower_bound (), SIGNED)
|
||||
&& !wi::neg_p (r.upper_bound (), SIGNED))
|
||||
{
|
||||
|
|
|
@ -3372,7 +3372,8 @@ optimize_range_tests_to_bit_test (enum tree_code opcode, int first, int length,
|
|||
value_range r;
|
||||
if (TREE_CODE (exp) == SSA_NAME
|
||||
&& get_range_query (cfun)->range_of_expr (r, exp)
|
||||
&& r.kind () == VR_RANGE
|
||||
&& !r.undefined_p ()
|
||||
&& !r.varying_p ()
|
||||
&& wi::leu_p (r.upper_bound () - r.lower_bound (), prec - 1))
|
||||
{
|
||||
wide_int min = r.lower_bound ();
|
||||
|
|
|
@ -350,18 +350,19 @@ compare_nonzero_chars (strinfo *si, gimple *stmt,
|
|||
return -1;
|
||||
|
||||
value_range vr;
|
||||
if (!rvals->range_of_expr (vr, si->nonzero_chars, stmt))
|
||||
return -1;
|
||||
value_range_kind rng = vr.kind ();
|
||||
if (rng != VR_RANGE)
|
||||
if (!rvals->range_of_expr (vr, si->nonzero_chars, stmt)
|
||||
|| vr.varying_p ()
|
||||
|| vr.undefined_p ())
|
||||
return -1;
|
||||
|
||||
/* If the offset is less than the minimum length or if the bounds
|
||||
of the length range are equal return the result of the comparison
|
||||
same as in the constant case. Otherwise return a conservative
|
||||
result. */
|
||||
int cmpmin = compare_tree_int (vr.min (), off);
|
||||
if (cmpmin > 0 || tree_int_cst_equal (vr.min (), vr.max ()))
|
||||
tree lower = wide_int_to_tree (vr.type (), vr.lower_bound ());
|
||||
tree upper = wide_int_to_tree (vr.type (), vr.upper_bound ());
|
||||
int cmpmin = compare_tree_int (lower, off);
|
||||
if (cmpmin > 0 || tree_int_cst_equal (lower, upper))
|
||||
return cmpmin;
|
||||
|
||||
return -1;
|
||||
|
|
|
@ -1590,7 +1590,8 @@ bit_test_cluster::emit (tree index_expr, tree index_type,
|
|||
value_range r;
|
||||
if (TREE_CODE (index_expr) == SSA_NAME
|
||||
&& get_range_query (cfun)->range_of_expr (r, index_expr)
|
||||
&& r.kind () == VR_RANGE
|
||||
&& !r.undefined_p ()
|
||||
&& !r.varying_p ()
|
||||
&& wi::leu_p (r.upper_bound () - r.lower_bound (), prec - 1))
|
||||
{
|
||||
wide_int min = r.lower_bound ();
|
||||
|
|
|
@ -4598,7 +4598,7 @@ vect_recog_divmod_pattern (vec_info *vinfo,
|
|||
int msb = 1;
|
||||
value_range r;
|
||||
get_range_query (cfun)->range_of_expr (r, oprnd0);
|
||||
if (r.kind () == VR_RANGE)
|
||||
if (!r.varying_p () && !r.undefined_p ())
|
||||
{
|
||||
if (!wi::neg_p (r.lower_bound (), TYPE_SIGN (itype)))
|
||||
msb = 0;
|
||||
|
|
|
@ -14296,7 +14296,8 @@ get_range_pos_neg (tree arg)
|
|||
if (TREE_CODE (arg) != SSA_NAME)
|
||||
return 3;
|
||||
value_range r;
|
||||
while (!get_global_range_query ()->range_of_expr (r, arg) || r.kind () != VR_RANGE)
|
||||
while (!get_global_range_query ()->range_of_expr (r, arg)
|
||||
|| r.undefined_p () || r.varying_p ())
|
||||
{
|
||||
gimple *g = SSA_NAME_DEF_STMT (arg);
|
||||
if (is_gimple_assign (g)
|
||||
|
|
Loading…
Add table
Reference in a new issue