+2017-11-22 Jeff Law <law@redhat.com>
+
+ * gimple-ssa-evrp-analyze.c (evrp_range_analyzer::try_find_new_range):
+ Use new method allocate_value_range rather than accessing the
+ vrp_value_range_pool data member directly.
+ * tree-vrp.c (simplify_stmt_for_jump_threading): Tweak slightly
+ to use extract_range_from_stmt method to avoid need for
+ extract_range_from_assignment method.
+ (vrp_prop::vrp_finalize): Use set_lattice_propagation_complete
+ method rather than setting values_propgated data member directly.
+ * vr-values.h (class vr_values): Privatize vrp_value_range_pool,
+ and values propagated data members and extract_range_from_assignment
+ method. Reorder private data members to conform to standards.
+ Add new methods set_lattice_propagation_complete and
+ allocate_value_range.
+
2017-11-22 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/83030
if (gassign *assign_stmt = dyn_cast <gassign *> (stmt))
{
- value_range new_vr = VR_INITIALIZER;
tree lhs = gimple_assign_lhs (assign_stmt);
-
if (TREE_CODE (lhs) == SSA_NAME
&& (INTEGRAL_TYPE_P (TREE_TYPE (lhs))
- || POINTER_TYPE_P (TREE_TYPE (lhs))))
+ || POINTER_TYPE_P (TREE_TYPE (lhs)))
+ && stmt_interesting_for_vrp (stmt))
{
- vr_values->extract_range_from_assignment (&new_vr, assign_stmt);
+ edge dummy_e;
+ tree dummy_tree;
+ value_range new_vr = VR_INITIALIZER;
+ vr_values->extract_range_from_stmt (stmt, &dummy_e,
+ &dummy_tree, &new_vr);
if (range_int_cst_singleton_p (&new_vr))
return new_vr.min;
}
{
size_t i;
- vr_values.values_propagated = true;
+ /* We have completed propagating through the lattice. */
+ vr_values.set_lattice_propagation_complete ();
if (dump_file)
{
tree, tree, value_range *);
void extract_range_from_phi_node (gphi *, value_range *);
void extract_range_basic (value_range *, gimple *);
- void extract_range_from_assignment (value_range *, gassign *);
void extract_range_from_stmt (gimple *, edge *, tree *, value_range *);
void vrp_visit_cond_stmt (gcond *, edge *);
void simplify_cond_using_ranges_2 (gcond *);
bool simplify_stmt_using_ranges (gimple_stmt_iterator *);
- /* This probably belongs in the lattice rather than in here. */
- bool values_propagated;
+ /* Indicate that propagation through the lattice is complete. */
+ void set_lattice_propagation_complete (void) { values_propagated = true; }
- /* Allocation pools for tree-vrp allocations. */
- object_allocator<value_range> vrp_value_range_pool;
+ /* Allocate a new value_range object. */
+ value_range *allocate_value_range (void)
+ { return vrp_value_range_pool.allocate (); }
private:
- bitmap_obstack vrp_equiv_obstack;
void add_equivalence (bitmap *, const_tree);
bool vrp_stmt_computes_nonzero (gimple *);
bool op_with_boolean_value_range_p (tree);
tree vrp_evaluate_conditional_warnv_with_ops (enum tree_code,
tree, tree, bool,
bool *, bool *);
+ void extract_range_from_assignment (value_range *, gassign *);
void extract_range_from_assert (value_range *, tree);
void extract_range_from_ssa_name (value_range *, tree);
void extract_range_from_binary_expr (value_range *, enum tree_code,
gimple *);
bool simplify_internal_call_using_ranges (gimple_stmt_iterator *, gimple *);
+ /* Allocation pools for value_range objects. */
+ object_allocator<value_range> vrp_value_range_pool;
+
+ /* This probably belongs in the lattice rather than in here. */
+ bool values_propagated;
+
+ /* Allocations for equivalences all come from this obstack. */
+ bitmap_obstack vrp_equiv_obstack;
+
/* Value range array. After propagation, VR_VALUE[I] holds the range
of values that SSA name N_I may take. */
unsigned int num_vr_values;