+2019-06-12 Aldy Hernandez <aldyh@redhat.com>
+
+ * gimple-ssa-evrp.c (evrp_dom_walker::before_dom_children): Use
+ value_range::singleton_p.
+ * tree-vrp.c (value_range_constant_singleton): Remove.
+ * tree-vrp.h (value_range_constant_singleton): Remove.
+ * vr-values.c (vr_values::singleton): Use
+ value_range::singleton_p.
+
2019-06-12 Jakub Jelinek <jakub@redhat.com>
PR target/90811
value_range *vr = evrp_range_analyzer.get_value_range (lhs);
/* Mark PHIs whose lhs we fully propagate for removal. */
- tree val = value_range_constant_singleton (vr);
- if (val && may_propagate_copy (lhs, val))
+ tree val;
+ if (vr->singleton_p (&val) && may_propagate_copy (lhs, val))
{
stmts_to_remove.safe_push (phi);
continue;
value_range *vr = evrp_range_analyzer.get_value_range (output);
/* Mark stmts whose output we fully propagate for removal. */
- if ((val = value_range_constant_singleton (vr))
+ if (vr->singleton_p (&val)
&& may_propagate_copy (output, val)
&& !stmt_could_throw_p (cfun, stmt)
&& !gimple_has_side_effects (stmt))
|| virtual_operand_p (arg))
continue;
value_range *vr = evrp_range_analyzer.get_value_range (arg);
- tree val = value_range_constant_singleton (vr);
- if (val && may_propagate_copy (arg, val))
+ tree val;
+ if (vr->singleton_p (&val) && may_propagate_copy (arg, val))
propagate_value (use_p, val);
}
}
return vr->may_contain_p (build_int_cst (vr->type (), x));
}
-/* If *VR has a value range that is a single constant value return that,
- otherwise return NULL_TREE.
-
- ?? This actually returns TRUE for [&x, &x], so perhaps "constant"
- is not the best name. */
-
-tree
-value_range_constant_singleton (const value_range_base *vr)
-{
- tree result = NULL;
- if (vr->singleton_p (&result))
- return result;
- return NULL;
-}
-
/* Value range wrapper for wide_int_range_set_zero_nonzero_bits.
Compute MAY_BE_NONZERO and MUST_BE_NONZERO bit masks for range in VR.
extern bool vrp_bitmap_equal_p (const_bitmap, const_bitmap);
-extern tree value_range_constant_singleton (const value_range_base *);
extern bool range_int_cst_p (const value_range_base *);
extern bool range_int_cst_singleton_p (const value_range_base *);
if (TREE_CODE (op) != SSA_NAME)
return NULL_TREE;
- return value_range_constant_singleton (get_value_range (op));
+ tree t;
+ if (get_value_range (op)->singleton_p (&t))
+ return t;
+ return NULL;
}
/* Return true if op is in a boolean [0, 1] value-range. */